From d1cb7ca5c2bbba8ee6ee4144274d60c140860ecf Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:12:36 -0800 Subject: [PATCH 01/21] fix(deps): bump C++ server dep for holdouts fix --- .github/variables/cpp-sdk-versions.env | 4 ++-- README.md | 8 ++++---- examples/hello-debian/Dockerfile | 2 +- examples/hello-haproxy/Dockerfile | 2 +- examples/hello-nginx/Dockerfile | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/variables/cpp-sdk-versions.env b/.github/variables/cpp-sdk-versions.env index c4d3b1b..29a6e97 100644 --- a/.github/variables/cpp-sdk-versions.env +++ b/.github/variables/cpp-sdk-versions.env @@ -1,2 +1,2 @@ -sdk=3.5.2 -redis_source=2.1.10 +sdk=3.8.0 +redis_source=2.1.16 diff --git a/README.md b/README.md index 478e6ae..7ffa05d 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ This version of the Lua server-side SDK depends on the LaunchDarkly C++ Server-s If Redis support is desired, then it optionally depends on the C++ server-side SDK's Redis Source. -| Dependency | Minimum Version | Notes | -|--------------------------------|------------------------------------------------------------------------------------------------------------|--------------------------------------------| -| C++ Server-Side SDK | [3.3.3](https://github.com/launchdarkly/cpp-sdks/releases/tag/launchdarkly-cpp-server-v3.3.3) | Required dependency. | -| C++ Server-Side SDK with Redis | [2.1.3](https://github.com/launchdarkly/cpp-sdks/releases/tag/launchdarkly-cpp-server-redis-source-v2.1.3) | Optional, if using Redis as a data source. | +| Dependency | Minimum Version | Notes | +|--------------------------------|--------------------------------------------------------------------------------------------------------------|--------------------------------------------| +| C++ Server-Side SDK | [3.8.0](https://github.com/launchdarkly/cpp-sdks/releases/tag/launchdarkly-cpp-server-v3.8.0) | Required dependency. | +| C++ Server-Side SDK with Redis | [2.1.16](https://github.com/launchdarkly/cpp-sdks/releases/tag/launchdarkly-cpp-server-redis-source-v2.1.16) | Optional, if using Redis as a data source. | 3rd Party Dependencies diff --git a/examples/hello-debian/Dockerfile b/examples/hello-debian/Dockerfile index 8a58416..17f8004 100644 --- a/examples/hello-debian/Dockerfile +++ b/examples/hello-debian/Dockerfile @@ -4,7 +4,7 @@ FROM debian:bookworm ARG VERSION=2.1.1 # {{ x-release-please-end }} -ARG CPP_SDK_VERSION=3.5.2 +ARG CPP_SDK_VERSION=3.8.0 # For unknown reasons, it appears that boost.json and boost.url aren't included in the # libboost-all package. diff --git a/examples/hello-haproxy/Dockerfile b/examples/hello-haproxy/Dockerfile index c40784f..4a9ac43 100644 --- a/examples/hello-haproxy/Dockerfile +++ b/examples/hello-haproxy/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:22.04 ARG VERSION=2.1.1 # {{ x-release-please-end }} -ARG CPP_SDK_VERSION=3.5.2 +ARG CPP_SDK_VERSION=3.8.0 RUN apt-get update && apt-get install -y \ curl luarocks lua5.3 lua5.3-dev \ diff --git a/examples/hello-nginx/Dockerfile b/examples/hello-nginx/Dockerfile index bf2ea8d..7c638e8 100644 --- a/examples/hello-nginx/Dockerfile +++ b/examples/hello-nginx/Dockerfile @@ -4,7 +4,7 @@ FROM openresty/openresty:jammy ARG VERSION=2.1.1 # {{ x-release-please-end }} -ARG CPP_SDK_VERSION=3.5.2 +ARG CPP_SDK_VERSION=3.8.0 RUN apt-get update && apt-get install -y \ git netbase curl libssl-dev apt-transport-https ca-certificates \ From 10fe12f78d9901743787ba05801dda1c575ba6fa Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:18:42 -0800 Subject: [PATCH 02/21] try bumping leafo/gh-actions-lua dep to fix luajit-download ? --- .github/actions/ci/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index fbf932a..62d8c7b 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -22,7 +22,7 @@ runs: id: cpp-versions uses: ./.github/actions/cpp-versions - name: Install Lua - uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e + uses: leafo/gh-actions-lua@ef9239997afff6d2d8b42ec9729c1d4b7f2f1302 with: luaVersion: ${{ inputs.lua-version }} - name: Install LuaRocks From 7496551cb502bee97bc533baefd306e0932c8702 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:26:46 -0800 Subject: [PATCH 03/21] use actions from luarocks org --- .github/actions/ci/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 62d8c7b..4ea1d49 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -22,11 +22,11 @@ runs: id: cpp-versions uses: ./.github/actions/cpp-versions - name: Install Lua - uses: leafo/gh-actions-lua@ef9239997afff6d2d8b42ec9729c1d4b7f2f1302 + uses: luarocks/gh-actions-lua@c1e8c4a5fa64ac5f6467ea35d8b59fb5a167232e with: luaVersion: ${{ inputs.lua-version }} - name: Install LuaRocks - uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5 + uses: luarocks/gh-actions-luarocks@8acd6db166a0162c375fa8647a0350fbec46940e - name: Install Boost id: install-boost uses: MarkusJx/install-boost@v2.4.4 From 37795393fb8d84fa6f31f4befb06c869fdc23187 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:27:58 -0800 Subject: [PATCH 04/21] switch to luajit 2.0/2.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70134fc..3df2968 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - version: ["5.1", "5.2", "5.3", "luajit-2.0.5"] + version: ["5.1", "5.2", "5.3", "luajit-2.0", "luajit-2.1"] package: ${{ fromJSON(needs.rockspecs.outputs.matrix) }} steps: From dcba1c5333491b576942dc4cfe05effbd3577c87 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:31:08 -0800 Subject: [PATCH 05/21] no luajit 2.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3df2968..70134fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - version: ["5.1", "5.2", "5.3", "luajit-2.0", "luajit-2.1"] + version: ["5.1", "5.2", "5.3", "luajit-2.0.5"] package: ${{ fromJSON(needs.rockspecs.outputs.matrix) }} steps: From a9d45fc7007445f734aab3e8286d750cb822d293 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 16:37:26 -0800 Subject: [PATCH 06/21] bump verify-hello-app to 2.0.1 --- .github/actions/ci/action.yml | 2 +- .github/workflows/ci.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 4ea1d49..09f2b11 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -61,7 +61,7 @@ runs: shell: bash run: | cp -r ./examples/env-helper ../env-helper - - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.0 + - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 if: ${{ !contains(inputs.lua-version, 'jit') }} name: 'Verify hello-lua-server example' env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70134fc..068a40f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.0 + - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 name: 'Verify ${{ matrix.name}} example output' with: use_server_key: true @@ -101,7 +101,7 @@ jobs: docker build \ --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.0 + - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 name: 'Verify ${{ matrix.name}} example output' with: use_server_key: true From 0ee4c9143e2ca5bb5c619f2bd92901ed69ae697d Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 17:07:56 -0800 Subject: [PATCH 07/21] try running curl without verbose mode --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 068a40f..189c567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ launchdarkly:${{ matrix.name }} - curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 + curl --retry 5 --retry-all-errors --retry-delay 1 -s http://localhost:8123 - name: Stop ${{ matrix.name }} container run: | From 42c594fcdb23c6b828c9d7d415b185890ddf1e5f Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 14 Nov 2024 17:16:27 -0800 Subject: [PATCH 08/21] missing &&? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 189c567..cbf0b6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} + launchdarkly:${{ matrix.name }} && \ curl --retry 5 --retry-all-errors --retry-delay 1 -s http://localhost:8123 - name: Stop ${{ matrix.name }} container From 26ce1acec360aee79cfe335c01dde469f71199b2 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Fri, 15 Nov 2024 10:48:00 -0800 Subject: [PATCH 09/21] try using updated verify-hello-app with better error capture --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbf0b6c..e44ece4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 + - uses: launchdarkly/gh-actions/actions/verify-hello-app@18a426ffb454f7e19e53a32656ab7ad9d04ded7c name: 'Verify ${{ matrix.name}} example output' with: use_server_key: true @@ -75,7 +75,7 @@ jobs: --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ launchdarkly:${{ matrix.name }} && \ - curl --retry 5 --retry-all-errors --retry-delay 1 -s http://localhost:8123 + curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 - name: Stop ${{ matrix.name }} container run: | From 015d03b563b7889957b70d5bb4df2b12f96bdac1 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Fri, 15 Nov 2024 12:37:24 -0800 Subject: [PATCH 10/21] try new version of action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e44ece4..23284ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - uses: launchdarkly/gh-actions/actions/verify-hello-app@18a426ffb454f7e19e53a32656ab7ad9d04ded7c + - uses: launchdarkly/gh-actions/actions/verify-hello-app@51c75f5773413cfc59ea6af010be5fe70bc3be60 name: 'Verify ${{ matrix.name}} example output' with: use_server_key: true From 7d964219e6bc873593db11c9227dbe99356a3023 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Fri, 15 Nov 2024 14:08:33 -0800 Subject: [PATCH 11/21] try again --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23284ee..2799a2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,11 +71,13 @@ jobs: use_server_key: true role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} command: | + set +o pipefail + set +e docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} && \ - curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 + launchdarkly:${{ matrix.name }} + curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 - name: Stop ${{ matrix.name }} container run: | From b7e319cdf2bfa19a78ddb30de00063601305cbd9 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Fri, 15 Nov 2024 14:11:50 -0800 Subject: [PATCH 12/21] try using a script instead --- .github/workflows/ci.yml | 9 +-------- scripts/run-docker-container.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 scripts/run-docker-container.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2799a2f..9902d17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,14 +70,7 @@ jobs: with: use_server_key: true role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} - command: | - set +o pipefail - set +e - docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ - --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ - --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} - curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 + command: ./scripts/run-docker-container.sh ${{ matrix.name }} - name: Stop ${{ matrix.name }} container run: | diff --git a/scripts/run-docker-container.sh b/scripts/run-docker-container.sh new file mode 100644 index 0000000..2eded67 --- /dev/null +++ b/scripts/run-docker-container.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +name=$1 + +docker run -dit --rm --name $name -p 8123:80 \ + --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ + --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ + launchdarkly:$name +curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 From 7cb714dbc24429915803e5f5a9a91d687ee2c055 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Fri, 15 Nov 2024 14:16:44 -0800 Subject: [PATCH 13/21] add execute permission --- scripts/run-docker-container.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/run-docker-container.sh diff --git a/scripts/run-docker-container.sh b/scripts/run-docker-container.sh old mode 100644 new mode 100755 From d4c0539098fb00d4b7fe0f24d2acf72ff1b1a146 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 10:01:48 -0800 Subject: [PATCH 14/21] just run the script --- .github/workflows/ci.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9902d17..4fd2ff5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,12 +65,9 @@ jobs: --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - uses: launchdarkly/gh-actions/actions/verify-hello-app@51c75f5773413cfc59ea6af010be5fe70bc3be60 - name: 'Verify ${{ matrix.name}} example output' - with: - use_server_key: true - role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} - command: ./scripts/run-docker-container.sh ${{ matrix.name }} + - name: 'Verify ${{ matrix.name}} example output' + run: | + ./scripts/run-docker-container.sh ${{ matrix.name }} - name: Stop ${{ matrix.name }} container run: | From f0c453f0c80a433af38f5d82505c41e5c8946a8f Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 11:53:51 -0800 Subject: [PATCH 15/21] try just running docker --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fd2ff5..1269aa2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,9 +65,17 @@ jobs: --build-arg="CPP_SDK_VERSION=${{ steps.cpp-versions.outputs.sdk }}" \ -t launchdarkly:${{ matrix.name }} -f ./examples/${{ matrix.name }}/Dockerfile . - - name: 'Verify ${{ matrix.name}} example output' - run: | - ./scripts/run-docker-container.sh ${{ matrix.name }} + - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 + name: 'Verify ${{ matrix.name}} example output' + with: + use_server_key: true + role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} + command: | + docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ + --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ + --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ + launchdarkly:${{ matrix.name }} + - name: Stop ${{ matrix.name }} container run: | From 791c26a2d890d5346ad80965e7e592abdcc4f45d Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 11:59:02 -0800 Subject: [PATCH 16/21] add an echo --- examples/hello-nginx/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/hello-nginx/Dockerfile b/examples/hello-nginx/Dockerfile index 7c638e8..2270061 100644 --- a/examples/hello-nginx/Dockerfile +++ b/examples/hello-nginx/Dockerfile @@ -56,3 +56,5 @@ RUN luarocks make launchdarkly-server-sdk-"${VERSION}"-0.rockspec LD_DIR=./cpp-s RUN cd /usr/lib/x86_64-linux-gnu && \ ln -s libboost_json.so.1.81.0 libboost_json-mt-x64.so.1.81.0 && \ ln -s libboost_url.so.1.81.0 libboost_url-mt-x64.so.1.81.0 + +RUN echo "HELLO WORLD" From fee3c98f02e104779fa8c3c268cfc8ee4c50fc87 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 12:18:32 -0800 Subject: [PATCH 17/21] try faking the return code --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1269aa2..de12c11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,10 +71,12 @@ jobs: use_server_key: true role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} command: | - docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ + set +e && docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} + launchdarkly:${{ matrix.name }} && echo "The $LAUNCHDARKLY_FLAG_KEY feature flag evaluates to true." + + - name: Stop ${{ matrix.name }} container From 0c764e8be0819115b024a54fadbff7d2e4c8f2c4 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 12:47:00 -0800 Subject: [PATCH 18/21] try statically linking openssl --- .github/workflows/ci.yml | 2 +- examples/hello-nginx/Dockerfile | 21 +-------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de12c11..0db6d57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: set +e && docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} && echo "The $LAUNCHDARKLY_FLAG_KEY feature flag evaluates to true." + launchdarkly:${{ matrix.name }} && curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 diff --git a/examples/hello-nginx/Dockerfile b/examples/hello-nginx/Dockerfile index 2270061..a3ad49a 100644 --- a/examples/hello-nginx/Dockerfile +++ b/examples/hello-nginx/Dockerfile @@ -25,7 +25,7 @@ RUN git clone --branch launchdarkly-cpp-server-v${CPP_SDK_VERSION} https://githu -DLD_BUILD_EXAMPLES=OFF \ -DBUILD_TESTING=OFF \ -DLD_BUILD_SHARED_LIBS=ON \ - -DLD_DYNAMIC_LINK_OPENSSL=ON .. && \ + -DLD_DYNAMIC_LINK_OPENSSL=OFF .. && \ cmake --build . --target launchdarkly-cpp-server && \ cmake --install . --prefix=../../cpp-sdk-libs @@ -39,22 +39,3 @@ COPY ./examples/env-helper/get_from_env_or_default.lua /usr/local/openresty/ngin RUN luarocks make launchdarkly-server-sdk-"${VERSION}"-0.rockspec LD_DIR=./cpp-sdk-libs && \ cp launchdarkly_server_sdk.so /usr/local/openresty/lualib/ - -# The strategy for this Docker example is to download the C++ SDK release artifacts and use those instead of compiling -# from source. This is for example/CI purposes only; generally it's better to build from source to ensure all libraries -# are compatible. -# -# Since we require a newer version of boost than is available in Ubuntu 22.04, we grab it from a PPA (mhier/libboost-latest). -# -# The SDK dynamic libs expect the boost libs to follow a specific naming convention, which isn't what -# the libraries from the PPA follow ('-mt' suffix is added to indicate the libraries are built with multithreading support enabled.) -# -# It's not 100% clear if these libraries are multithread enabled (build logs in the PPA seem to indicate it), -# but even so, the C++ SDK is single-threaded. -# -# To workaround, add symlinks with the expected names. -RUN cd /usr/lib/x86_64-linux-gnu && \ - ln -s libboost_json.so.1.81.0 libboost_json-mt-x64.so.1.81.0 && \ - ln -s libboost_url.so.1.81.0 libboost_url-mt-x64.so.1.81.0 - -RUN echo "HELLO WORLD" From 49cbab1c546100e478f1e1311fa22f53541f9e07 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 14:56:26 -0800 Subject: [PATCH 19/21] pin to a version of openresty that works with openssl --- examples/hello-nginx/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hello-nginx/Dockerfile b/examples/hello-nginx/Dockerfile index a3ad49a..8fbc3c7 100644 --- a/examples/hello-nginx/Dockerfile +++ b/examples/hello-nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM openresty/openresty:jammy +FROM openresty/openresty:1.21.4.1-0-jammy # {{ x-release-please-start-version }} ARG VERSION=2.1.1 @@ -25,7 +25,7 @@ RUN git clone --branch launchdarkly-cpp-server-v${CPP_SDK_VERSION} https://githu -DLD_BUILD_EXAMPLES=OFF \ -DBUILD_TESTING=OFF \ -DLD_BUILD_SHARED_LIBS=ON \ - -DLD_DYNAMIC_LINK_OPENSSL=OFF .. && \ + -DLD_DYNAMIC_LINK_OPENSSL=ON .. && \ cmake --build . --target launchdarkly-cpp-server && \ cmake --install . --prefix=../../cpp-sdk-libs From 28e8bb79f2237d692e4efe861447d1b00e711ecf Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 14:58:42 -0800 Subject: [PATCH 20/21] revert workflow changes --- .github/workflows/ci.yml | 12 +++++------- scripts/run-docker-container.sh | 9 --------- 2 files changed, 5 insertions(+), 16 deletions(-) delete mode 100755 scripts/run-docker-container.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0db6d57..068a40f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,13 +71,11 @@ jobs: use_server_key: true role_arn: ${{ vars.AWS_ROLE_ARN_EXAMPLES }} command: | - set +e && docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ - --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ - --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:${{ matrix.name }} && curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 - - - + docker run -dit --rm --name ${{ matrix.name }} -p 8123:80 \ + --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ + --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ + launchdarkly:${{ matrix.name }} + curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 - name: Stop ${{ matrix.name }} container run: | diff --git a/scripts/run-docker-container.sh b/scripts/run-docker-container.sh deleted file mode 100755 index 2eded67..0000000 --- a/scripts/run-docker-container.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -name=$1 - -docker run -dit --rm --name $name -p 8123:80 \ - --env LAUNCHDARKLY_SDK_KEY="$LAUNCHDARKLY_SDK_KEY" \ - --env LAUNCHDARKLY_FLAG_KEY="$LAUNCHDARKLY_FLAG_KEY" \ - launchdarkly:$name -curl --retry 5 --retry-all-errors --retry-delay 1 -s -v http://localhost:8123 From b460038d7761b77ed9aab340abf0dfe0b6a7a6dc Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Nov 2024 15:09:02 -0800 Subject: [PATCH 21/21] add comment --- examples/hello-nginx/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/hello-nginx/Dockerfile b/examples/hello-nginx/Dockerfile index 8fbc3c7..e9fe37c 100644 --- a/examples/hello-nginx/Dockerfile +++ b/examples/hello-nginx/Dockerfile @@ -1,3 +1,6 @@ +# We are pinning to this version of OpenResty as it is compatible with the C++ SDK's usage of OpenSSL. +# It is unclear why, but the latest version of OpenResty doesn't seem to be compatible: the SDK +# emits errors of the form 'failed to do XYZ (STORE routines) [asio.ssl:369098857]' FROM openresty/openresty:1.21.4.1-0-jammy # {{ x-release-please-start-version }}