Skip to content

Commit b72555d

Browse files
committed
feat: scaffold libs/server-sdk-dynamodb-source
1 parent 07fcf30 commit b72555d

16 files changed

Lines changed: 464 additions & 0 deletions

File tree

.github/workflows/manual-sdk-release-artifacts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- libs/client-sdk:launchdarkly-cpp-client
1717
- libs/server-sdk:launchdarkly-cpp-server
1818
- libs/server-sdk-redis-source:launchdarkly-cpp-server-redis-source
19+
- libs/server-sdk-dynamodb-source:launchdarkly-cpp-server-dynamodb-source
1920

2021
name: Publish SDK Artifacts
2122

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: libs/server-sdk-dynamodb-source
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md' # Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [ "main", "feat/**" ]
10+
paths-ignore:
11+
- '**.md'
12+
schedule:
13+
# Run daily at midnight PST
14+
- cron: '0 8 * * *'
15+
16+
jobs:
17+
build-dynamodb:
18+
runs-on: ubuntu-22.04
19+
steps:
20+
# https://github.com/actions/checkout/releases/tag/v4.3.0
21+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
22+
- uses: ./.github/actions/ci
23+
with:
24+
cmake_target: launchdarkly-cpp-server-dynamodb-source
25+
# No tests yet; PR 1 is scaffold-only and proves the AWS SDK builds.
26+
run_tests: false
27+
# AWS C++ SDK requires libcurl at link time on Linux/macOS.
28+
install_curl: true
29+
simulate_release: false
30+
build-dynamodb-mac:
31+
runs-on: macos-15
32+
steps:
33+
# https://github.com/actions/checkout/releases/tag/v4.3.0
34+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
35+
- uses: ./.github/actions/ci
36+
with:
37+
cmake_target: launchdarkly-cpp-server-dynamodb-source
38+
platform_version: 12
39+
run_tests: false
40+
install_curl: true
41+
simulate_release: false
42+
build-dynamodb-windows:
43+
runs-on: windows-2022
44+
steps:
45+
# https://github.com/actions/checkout/releases/tag/v4.3.0
46+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
47+
# https://github.com/ilammy/msvc-dev-cmd/releases/tag/v1.13.0
48+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
49+
- uses: ./.github/actions/ci
50+
env:
51+
BOOST_LIBRARY_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
52+
BOOST_LIBRARYDIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
53+
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
54+
with:
55+
cmake_target: launchdarkly-cpp-server-dynamodb-source
56+
platform_version: 2022
57+
toolset: msvc
58+
run_tests: false
59+
install_curl: true
60+
simulate_windows_release: false

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"libs/internal": "0.13.0",
66
"libs/server-sdk": "3.10.1",
77
"libs/server-sdk-redis-source": "2.2.2",
8+
"libs/server-sdk-dynamodb-source": "0.1.0",
89
"libs/server-sdk-otel": "0.1.1",
910
"libs/networking": "0.2.0"
1011
}

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ option(LD_BUILD_EXAMPLES "Build hello-world examples." ON)
108108

109109
option(LD_BUILD_REDIS_SUPPORT "Build redis support." OFF)
110110

111+
option(LD_BUILD_DYNAMODB_SUPPORT "Build DynamoDB support." OFF)
112+
111113
option(LD_BUILD_OTEL_SUPPORT "Build OpenTelemetry integration." OFF)
112114

113115
option(LD_CURL_NETWORKING "Enable CURL-based networking for SSE client (alternative to Boost.Beast/Foxy)" OFF)
@@ -223,6 +225,11 @@ if (LD_BUILD_REDIS_SUPPORT)
223225
add_subdirectory(libs/server-sdk-redis-source)
224226
endif ()
225227

228+
if (LD_BUILD_DYNAMODB_SUPPORT)
229+
message("LaunchDarkly: building server-side DynamoDB support")
230+
add_subdirectory(libs/server-sdk-dynamodb-source)
231+
endif ()
232+
226233
if (LD_BUILD_OTEL_SUPPORT)
227234
message("LaunchDarkly: building OpenTelemetry integration")
228235
add_subdirectory(libs/server-sdk-otel)

cmake/aws-sdk-cpp.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.11)
2+
3+
include(FetchContent)
4+
5+
# Limit the AWS SDK build to just the DynamoDB service client.
6+
# Without this, the SDK builds ~50 service clients and CI time becomes untenable.
7+
set(BUILD_ONLY "dynamodb" CACHE STRING "" FORCE)
8+
9+
# We don't want to build or run the AWS SDK's own tests.
10+
set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
11+
set(AUTORUN_UNIT_TESTS OFF CACHE BOOL "" FORCE)
12+
13+
# Match the static-library default the rest of the SDK uses. When LD_BUILD_SHARED_LIBS
14+
# is ON at the top level, the surrounding CMake script may flip BUILD_SHARED_LIBS;
15+
# this cache entry only sets the default.
16+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
17+
18+
# Don't install the AWS SDK headers/libs alongside our own.
19+
set(AWS_SDK_WARNINGS_ARE_ERRORS OFF CACHE BOOL "" FORCE)
20+
21+
FetchContent_Declare(aws-sdk-cpp
22+
GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp.git
23+
# 1.11.805
24+
GIT_TAG ecae762dfdddf9b538c1b490007f4dd5aa16a9bb
25+
# aws-sdk-cpp uses git submodules for aws-crt-cpp and the underlying
26+
# AWS C SDK libraries; FetchContent must clone them recursively.
27+
GIT_SUBMODULES_RECURSE TRUE
28+
OVERRIDE_FIND_PACKAGE
29+
)
30+
31+
FetchContent_MakeAvailable(aws-sdk-cpp)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This project aims to follow modern cmake guidelines, e.g.
2+
# https://cliutils.gitlab.io/modern-cmake
3+
4+
# Required for Apple Silicon support.
5+
cmake_minimum_required(VERSION 3.19)
6+
7+
project(
8+
LaunchDarklyCPPServerDynamoDBSource
9+
VERSION 0.1.0 # {x-release-please-version}
10+
DESCRIPTION "LaunchDarkly C++ Server SDK DynamoDB Source"
11+
LANGUAGES CXX C
12+
)
13+
14+
set(LIBNAME "launchdarkly-cpp-server-dynamodb-source")
15+
16+
# If this project is the main CMake project (as opposed to being included via add_subdirectory)
17+
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
18+
# Disable C++ extensions for portability.
19+
set(CMAKE_CXX_EXTENSIONS OFF)
20+
# Enable folder support in IDEs.
21+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
22+
endif ()
23+
24+
# Needed to fetch external dependencies.
25+
include(FetchContent)
26+
27+
include(${CMAKE_FILES}/aws-sdk-cpp.cmake)
28+
29+
add_subdirectory(src)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Doxyfile 1.8.17
2+
3+
# This file describes the settings to be used by the documentation system
4+
# doxygen (www.doxygen.org) for a project.
5+
#
6+
# All text after a double hash (##) is considered a comment and is placed in
7+
# front of the TAG it is preceding.
8+
#
9+
# All text after a single hash (#) is considered a comment and will be ignored.
10+
# The format is:
11+
# TAG = value [value, ...]
12+
# For lists, items can also be appended using:
13+
# TAG += value [value, ...]
14+
# Values that contain spaces should be placed between quotes (\" \").
15+
16+
#---------------------------------------------------------------------------
17+
# Project related configuration options
18+
#---------------------------------------------------------------------------
19+
20+
# This tag specifies the encoding used for all characters in the configuration
21+
# file that follow. The default is UTF-8 which is also the encoding used for all
22+
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
23+
# iconv built into libc) for the transcoding. See
24+
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
25+
# The default value is: UTF-8.
26+
27+
DOXYFILE_ENCODING = UTF-8
28+
29+
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
30+
# double-quotes, unless you are using Doxywizard) that should identify the
31+
# project for which the documentation is generated. This name is used in the
32+
# title of most generated pages and in a few other places.
33+
# The default value is: My Project.
34+
35+
PROJECT_NAME = "C++ Server-Side SDK DynamoDB Source"
36+
37+
# Using the PROJECT_BRIEF tag one can provide an optional one line description
38+
# for a project that appears at the top of each page and should give viewer a
39+
# quick idea about the purpose of the project. Keep the description short.
40+
41+
PROJECT_BRIEF = "Provide SDK data via DynamoDB"
42+
43+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
44+
# into which the generated documentation will be written. If a relative path is
45+
# entered, it will be relative to the location where doxygen was started. If
46+
# left blank the current directory will be used.
47+
48+
OUTPUT_DIRECTORY = docs
49+
50+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
51+
# to include (a tag file for) the STL sources as input, then you should set this
52+
# tag to YES in order to let doxygen match functions declarations and
53+
# definitions whose arguments contain STL classes (e.g. func(std::string);
54+
# versus func(std::string) {}). This also make the inheritance and collaboration
55+
# diagrams that involve STL classes more complete and accurate.
56+
# The default value is: NO.
57+
58+
BUILTIN_STL_SUPPORT = YES
59+
60+
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
61+
# enum is documented as struct, union, or enum with the name of the typedef. So
62+
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
63+
# with name TypeT. When disabled the typedef will appear as a member of a file,
64+
# namespace, or class. And the struct will be named TypeS. This can typically be
65+
# useful for C code in case the coding convention dictates that all compound
66+
# types are typedef'ed and only the typedef is referenced, never the tag name.
67+
# The default value is: NO.
68+
69+
TYPEDEF_HIDES_STRUCT = YES
70+
71+
#---------------------------------------------------------------------------
72+
# Configuration options related to the input files
73+
#---------------------------------------------------------------------------
74+
75+
# The INPUT tag is used to specify the files and/or directories that contain
76+
# documented source files. You may enter file names like myfile.cpp or
77+
# directories like /usr/src/myproject. Separate the files or directories with
78+
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
79+
# Note: If this tag is empty the current directory is searched.
80+
81+
INPUT = include src docs
82+
83+
# The RECURSIVE tag can be used to specify whether or not subdirectories should
84+
# be searched for input files as well.
85+
# The default value is: NO.
86+
87+
RECURSIVE = YES
88+
89+
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
90+
# is part of the input, its contents will be placed on the main page
91+
# (index.html). This can be useful if you have a project on for instance GitHub
92+
# and want to reuse the introduction page also for the doxygen output.
93+
94+
USE_MDFILE_AS_MAINPAGE = ./docs/doc.md
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
LaunchDarkly Server-Side SDK - DynamoDB Source for C/C++
2+
===================================
3+
4+
[![Actions Status](https://github.com/launchdarkly/cpp-sdks/actions/workflows/server-dynamodb.yml/badge.svg)](https://github.com/launchdarkly/cpp-sdks/actions/workflows/server-dynamodb.yml)
5+
[![Documentation](https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8)](https://launchdarkly.github.io/cpp-sdks/libs/server-sdk-dynamodb-source/docs/html/)
6+
7+
The LaunchDarkly Server-Side SDK DynamoDB Source for C/C++ is designed for use with the Server-Side SDK.
8+
9+
This component will allow the Server-Side SDK to retrieve feature flag configurations from DynamoDB, rather than
10+
from LaunchDarkly.
11+
12+
> [!NOTE]
13+
> This library currently contains only scaffolding. The functional `DynamoDBDataSource` and Big Segments store
14+
> implementation will land in subsequent releases.
15+
16+
LaunchDarkly overview
17+
-------------------------
18+
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags
19+
daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started)
20+
using LaunchDarkly today!
21+
22+
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
23+
24+
Compatibility
25+
-------------------------
26+
27+
This component is compatible with POSIX environments (Linux, OS X, BSD) and Windows.
28+
29+
Getting started
30+
---------------
31+
32+
Download a release archive from
33+
the [Github releases](https://github.com/launchdarkly/cpp-sdks/releases?q=cpp-server-dynamodb&expanded=true) for use in
34+
your project.
35+
36+
Refer to the [SDK documentation][reference-guide] for complete instructions on
37+
installing and using the SDK.
38+
39+
### Incorporating the DynamoDB Source
40+
41+
The component can be used via a C++ or C interface and can be incorporated via a static library or shared object. The
42+
static library and shared object each have their own use cases and limitations.
43+
44+
The static library supports both the C++ and C interface. When using the static library, you should ensure that it is
45+
compiled using a compatible configuration and toolchain. For instance, when using MSVC, it needs to be using the same
46+
runtime library.
47+
48+
The C++ API does not have a stable ABI, so if this is important to you, consider using the shared object with the C API.
49+
50+
The shared library (so, DLL, dylib), only supports the C interface.
51+
52+
The examples here are to help with getting started, but generally speaking this component should be incorporated using
53+
your
54+
build system (CMake for instance).
55+
56+
### CMake Usage
57+
58+
When configuring the SDK via CMake, you need to explicitly enable this component (example):
59+
60+
```
61+
cmake -GNinja -D LD_BUILD_DYNAMODB_SUPPORT=ON ..
62+
```
63+
64+
It is disabled by default to avoid pulling in the `aws-sdk-cpp` dependency that this component is
65+
implemented with.
66+
67+
This will expose the `launchdarkly::server_dynamodb_source` target.
68+
69+
Next, link the target to your executable or library:
70+
71+
```cmake
72+
target_link_libraries(my-target PRIVATE launchdarkly::server_dynamodb_source)
73+
```
74+
75+
This will cause `launchdarkly::server` to be linked as well.
76+
77+
Learn more
78+
-----------
79+
80+
Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly.
81+
You can also head straight to
82+
the [complete reference guide for this SDK][reference-guide].
83+
84+
Testing
85+
-------
86+
87+
We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test
88+
for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each
89+
method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all
90+
behave correctly.
91+
92+
Contributing
93+
------------
94+
95+
We encourage pull requests and other contributions from the community. Read
96+
our [contributing guidelines](../../CONTRIBUTING.md) for instructions on how to contribute to this SDK.
97+
98+
Verifying SDK build provenance with the SLSA framework
99+
------------
100+
101+
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](../../PROVENANCE.md).
102+
103+
About LaunchDarkly
104+
-----------
105+
106+
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to
107+
iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard.
108+
With LaunchDarkly, you can:
109+
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group),
110+
gathering feedback and bug reports from real-world use cases.
111+
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on
112+
key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
113+
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy,
114+
or even restart the application with a changed configuration file.
115+
* Grant access to certain features based on user attributes, like payment plan (eg: users on the 'gold' plan get
116+
access to more features than users in the 'silver' plan). Disable parts of your application to facilitate
117+
maintenance, without taking everything offline.
118+
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies.
119+
Read [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
120+
* Explore LaunchDarkly
121+
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
122+
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and
123+
SDK reference guides
124+
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API
125+
documentation
126+
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product
127+
updates
128+
129+
[reference-guide]: https://docs.launchdarkly.com/sdk/server-side/c-c--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Overview
2+
3+
The Server-side SDK DynamoDB Source can be used as a source of SDK data
4+
instead of the normal LaunchDarkly Streaming or Polling data sources.
5+
6+
This library is currently a scaffold; the public API will land in a
7+
subsequent release.

0 commit comments

Comments
 (0)