Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/manual-sdk-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- libs/client-sdk:launchdarkly-cpp-client
- libs/server-sdk:launchdarkly-cpp-server
- libs/server-sdk-redis-source:launchdarkly-cpp-server-redis-source
- libs/server-sdk-dynamodb-source:launchdarkly-cpp-server-dynamodb-source

name: Publish SDK Artifacts

Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/server-dynamodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: libs/server-sdk-dynamodb-source

on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ "main", "feat/**" ]
paths-ignore:
- '**.md'
schedule:
# Run daily at midnight PST
- cron: '0 8 * * *'

jobs:
build-dynamodb:
runs-on: ubuntu-22.04
steps:
# https://github.com/actions/checkout/releases/tag/v4.3.0
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-server-dynamodb-source
# No tests yet; PR 1 is scaffold-only and proves the AWS SDK builds.
run_tests: false
# AWS C++ SDK requires libcurl at link time on Linux/macOS.
install_curl: true
simulate_release: false
build-dynamodb-mac:
runs-on: macos-15
steps:
# https://github.com/actions/checkout/releases/tag/v4.3.0
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-server-dynamodb-source
platform_version: 12
run_tests: false
install_curl: true
simulate_release: false
build-dynamodb-windows:
runs-on: windows-2022
steps:
# https://github.com/actions/checkout/releases/tag/v4.3.0
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
# https://github.com/ilammy/msvc-dev-cmd/releases/tag/v1.13.0
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
- uses: ./.github/actions/ci
env:
BOOST_LIBRARY_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
BOOST_LIBRARYDIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
with:
cmake_target: launchdarkly-cpp-server-dynamodb-source
platform_version: 2022
toolset: msvc
run_tests: false
install_curl: true
simulate_windows_release: false
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"libs/internal": "0.13.0",
"libs/server-sdk": "3.10.1",
"libs/server-sdk-redis-source": "2.2.2",
"libs/server-sdk-dynamodb-source": "0.1.0",
"libs/server-sdk-otel": "0.1.1",
"libs/networking": "0.2.0"
}
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ option(LD_BUILD_EXAMPLES "Build hello-world examples." ON)

option(LD_BUILD_REDIS_SUPPORT "Build redis support." OFF)

option(LD_BUILD_DYNAMODB_SUPPORT "Build DynamoDB support." OFF)

option(LD_BUILD_OTEL_SUPPORT "Build OpenTelemetry integration." OFF)

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

if (LD_BUILD_DYNAMODB_SUPPORT)
message("LaunchDarkly: building server-side DynamoDB support")
add_subdirectory(libs/server-sdk-dynamodb-source)
endif ()

if (LD_BUILD_OTEL_SUPPORT)
message("LaunchDarkly: building OpenTelemetry integration")
add_subdirectory(libs/server-sdk-otel)
Expand Down
26 changes: 26 additions & 0 deletions cmake/aws-sdk-cpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.11)

include(FetchContent)

# Limit the AWS SDK build to just the DynamoDB service client.
# Without this, the SDK builds ~50 service clients and CI time becomes untenable.
set(BUILD_ONLY "dynamodb" CACHE STRING "" FORCE)

# We don't want to build or run the AWS SDK's own tests.
set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(AUTORUN_UNIT_TESTS OFF CACHE BOOL "" FORCE)

# Don't install the AWS SDK headers/libs alongside our own.
set(AWS_SDK_WARNINGS_ARE_ERRORS OFF CACHE BOOL "" FORCE)

FetchContent_Declare(aws-sdk-cpp
GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp.git
# 1.11.805
GIT_TAG ecae762dfdddf9b538c1b490007f4dd5aa16a9bb
# aws-sdk-cpp uses git submodules for aws-crt-cpp and the underlying
# AWS C SDK libraries; FetchContent must clone them recursively.
GIT_SUBMODULES_RECURSE TRUE
OVERRIDE_FIND_PACKAGE
)

FetchContent_MakeAvailable(aws-sdk-cpp)
1 change: 1 addition & 0 deletions libs/server-sdk-dynamodb-source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
29 changes: 29 additions & 0 deletions libs/server-sdk-dynamodb-source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This project aims to follow modern cmake guidelines, e.g.
# https://cliutils.gitlab.io/modern-cmake

# Required for Apple Silicon support.
cmake_minimum_required(VERSION 3.19)

project(
LaunchDarklyCPPServerDynamoDBSource
VERSION 0.1.0 # {x-release-please-version}
DESCRIPTION "LaunchDarkly C++ Server SDK DynamoDB Source"
LANGUAGES CXX C
)

set(LIBNAME "launchdarkly-cpp-server-dynamodb-source")

# If this project is the main CMake project (as opposed to being included via add_subdirectory)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Disable C++ extensions for portability.
set(CMAKE_CXX_EXTENSIONS OFF)
# Enable folder support in IDEs.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif ()

# Needed to fetch external dependencies.
include(FetchContent)

include(${CMAKE_FILES}/aws-sdk-cpp.cmake)

add_subdirectory(src)
94 changes: 94 additions & 0 deletions libs/server-sdk-dynamodb-source/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Doxyfile 1.8.17

# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists, items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (\" \").

#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------

# This tag specifies the encoding used for all characters in the configuration
# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
# The default value is: UTF-8.

DOXYFILE_ENCODING = UTF-8

# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
# project for which the documentation is generated. This name is used in the
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "C++ Server-Side SDK DynamoDB Source"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "Provide SDK data via DynamoDB"

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = docs

# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should set this
# tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string);
# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.

BUILTIN_STL_SUPPORT = YES

# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically be
# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.

TYPEDEF_HIDES_STRUCT = YES

#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------

# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = include src docs

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.

RECURSIVE = YES

# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE = ./docs/doc.md
129 changes: 129 additions & 0 deletions libs/server-sdk-dynamodb-source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
LaunchDarkly Server-Side SDK - DynamoDB Source for C/C++
===================================

[![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)
[![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/)

The LaunchDarkly Server-Side SDK DynamoDB Source for C/C++ is designed for use with the Server-Side SDK.

This component will allow the Server-Side SDK to retrieve feature flag configurations from DynamoDB, rather than
from LaunchDarkly.

> [!NOTE]
> This library currently contains only scaffolding. The functional `DynamoDBDataSource` and Big Segments store
> implementation will land in subsequent releases.

LaunchDarkly overview
-------------------------
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags
daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started)
using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Compatibility
-------------------------

This component is compatible with POSIX environments (Linux, OS X, BSD) and Windows.

Getting started
---------------

Download a release archive from
the [Github releases](https://github.com/launchdarkly/cpp-sdks/releases?q=cpp-server-dynamodb&expanded=true) for use in
your project.

Refer to the [SDK documentation][reference-guide] for complete instructions on
installing and using the SDK.

### Incorporating the DynamoDB Source

The component can be used via a C++ or C interface and can be incorporated via a static library or shared object. The
static library and shared object each have their own use cases and limitations.

The static library supports both the C++ and C interface. When using the static library, you should ensure that it is
compiled using a compatible configuration and toolchain. For instance, when using MSVC, it needs to be using the same
runtime library.

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.

The shared library (so, DLL, dylib), only supports the C interface.

The examples here are to help with getting started, but generally speaking this component should be incorporated using
your
build system (CMake for instance).

### CMake Usage

When configuring the SDK via CMake, you need to explicitly enable this component (example):

```
cmake -GNinja -D LD_BUILD_DYNAMODB_SUPPORT=ON ..
```

It is disabled by default to avoid pulling in the `aws-sdk-cpp` dependency that this component is
implemented with.

This will expose the `launchdarkly::server_dynamodb_source` target.

Next, link the target to your executable or library:

```cmake
target_link_libraries(my-target PRIVATE launchdarkly::server_dynamodb_source)
```

This will cause `launchdarkly::server` to be linked as well.

Learn more
-----------

Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly.
You can also head straight to
the [complete reference guide for this SDK][reference-guide].

Testing
-------

We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test
for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each
method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all
behave correctly.

Contributing
------------

We encourage pull requests and other contributions from the community. Read
our [contributing guidelines](../../CONTRIBUTING.md) for instructions on how to contribute to this SDK.

Verifying SDK build provenance with the SLSA framework
------------

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).

About LaunchDarkly
-----------

* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to
iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard.
With LaunchDarkly, you can:
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group),
gathering feedback and bug reports from real-world use cases.
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on
key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy,
or even restart the application with a changed configuration file.
* Grant access to certain features based on user attributes, like payment plan (eg: users on the 'gold' plan get
access to more features than users in the 'silver' plan). Disable parts of your application to facilitate
maintenance, without taking everything offline.
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies.
Read [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
* Explore LaunchDarkly
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and
SDK reference guides
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API
documentation
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product
updates

[reference-guide]: https://docs.launchdarkly.com/sdk/server-side/c-c--
7 changes: 7 additions & 0 deletions libs/server-sdk-dynamodb-source/docs/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Overview

The Server-side SDK DynamoDB Source can be used as a source of SDK data
instead of the normal LaunchDarkly Streaming or Polling data sources.

This library is currently a scaffold; the public API will land in a
subsequent release.
Loading
Loading