Skip to content

Commit

Permalink
fix(deps): bump C++ server dep for holdouts fix (#109)
Browse files Browse the repository at this point in the history
This also switches to forks of the lua/luajit CI action, which have been
forked into the `luarocks` org.

The forks seem to be more up-to-date and are capable of fetching
`luajit`, which is apparently not working with the old version of the
action as LuaJIT is now distributed only via git.
  • Loading branch information
cwaldren-ld authored Nov 18, 2024
1 parent 8efb8fa commit 53a7ef1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ runs:
id: cpp-versions
uses: ./.github/actions/cpp-versions
- name: Install Lua
uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e
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/[email protected]
Expand Down Expand Up @@ -61,7 +61,7 @@ runs:
shell: bash
run: |
cp -r ./examples/env-helper ../env-helper
- uses: launchdarkly/gh-actions/actions/[email protected].0
- uses: launchdarkly/gh-actions/actions/[email protected].1
if: ${{ !contains(inputs.lua-version, 'jit') }}
name: 'Verify hello-lua-server example'
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/variables/cpp-sdk-versions.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sdk=3.5.2
redis_source=2.1.10
sdk=3.8.0
redis_source=2.1.16
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].0
- uses: launchdarkly/gh-actions/actions/[email protected].1
name: 'Verify ${{ matrix.name}} example output'
with:
use_server_key: true
Expand Down Expand Up @@ -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/[email protected].0
- uses: launchdarkly/gh-actions/actions/[email protected].1
name: 'Verify ${{ matrix.name}} example output'
with:
use_server_key: true
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-haproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
24 changes: 5 additions & 19 deletions examples/hello-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM openresty/openresty:jammy
# 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 }}
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 \
Expand Down Expand Up @@ -39,20 +42,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

0 comments on commit 53a7ef1

Please sign in to comment.