Skip to content

Commit 3bebc65

Browse files
authored
feat: add C++23 AWS Durable Execution SDK (#1)
1 parent c8e8fa3 commit 3bebc65

74 files changed

Lines changed: 27313 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Configure
19+
run: >-
20+
cmake -S . -B build
21+
-DCMAKE_BUILD_TYPE=Release
22+
-DDURABLE_EXECUTION_BUILD_BENCHMARKS=ON
23+
24+
- name: Build
25+
run: cmake --build build --parallel 2
26+
27+
- name: Test
28+
run: ctest --test-dir build --output-on-failure
29+
30+
- name: Install
31+
run: cmake --install build --prefix "${{ runner.temp }}/install"
32+
33+
- name: Configure package consumer
34+
run: >-
35+
cmake -S tests/package_consumer
36+
-B "${{ runner.temp }}/consumer"
37+
-DCMAKE_BUILD_TYPE=Release
38+
-DCMAKE_PREFIX_PATH="${{ runner.temp }}/install"
39+
40+
- name: Build package consumer
41+
run: >-
42+
cmake --build "${{ runner.temp }}/consumer" --parallel 2
43+
44+
- name: Run package consumer
45+
run: "${{ runner.temp }}/consumer/package_consumer"
46+
47+
- name: Benchmark smoke test
48+
run: ./build/durable_execution_microbench
49+
50+
sanitizers:
51+
runs-on: ubuntu-24.04
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Configure
56+
run: >-
57+
cmake -S . -B build-sanitize
58+
-DCMAKE_BUILD_TYPE=Debug
59+
-DDURABLE_EXECUTION_BUILD_EXAMPLES=OFF
60+
-DDURABLE_EXECUTION_ENABLE_SANITIZERS=ON
61+
62+
- name: Build
63+
run: cmake --build build-sanitize --parallel 2
64+
65+
- name: Test
66+
env:
67+
ASAN_OPTIONS: detect_leaks=1
68+
run: ctest --test-dir build-sanitize --output-on-failure
69+
70+
conformance:
71+
if: >-
72+
github.event_name != 'pull_request' ||
73+
github.event.pull_request.head.repo.full_name == github.repository
74+
runs-on: ubuntu-24.04
75+
timeout-minutes: 90
76+
concurrency:
77+
group: durable-cpp-conformance-persistent
78+
cancel-in-progress: false
79+
permissions:
80+
contents: read
81+
id-token: write
82+
env:
83+
AWS_REGION: us-west-2
84+
AWS_DEFAULT_REGION: us-west-2
85+
CONFORMANCE_COMMIT: 02d6dca971a38c13d94d6233d12f687e55b2a572
86+
AWS_SDK_CPP_COMMIT: 29656157ab3aec2464a16564b912aa2fdbbf6437
87+
AWS_LAMBDA_CPP_COMMIT: 30ec0a905cc7e415f4ae7e3a8b898dc8d7c536d0
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- uses: actions/setup-python@v5
92+
with:
93+
python-version: "3.14"
94+
95+
- uses: aws-actions/configure-aws-credentials@v4
96+
with:
97+
role-to-assume: ${{ secrets.INTEGRATION_ROLE_ARN }}
98+
aws-region: ${{ env.AWS_REGION }}
99+
role-session-name: durable-cpp-${{ github.run_id }}
100+
mask-aws-account-id: true
101+
102+
- name: Verify integration account
103+
env:
104+
EXPECTED_ACCOUNT: ${{ secrets.INTEGRATION_ACCOUNT }}
105+
run: |
106+
actual_account=$(aws sts get-caller-identity --query Account --output text)
107+
test "$actual_account" = "$EXPECTED_ACCOUNT"
108+
echo "Integration account verified"
109+
110+
- name: Checkout pinned conformance suite
111+
run: |
112+
git clone --filter=blob:none \
113+
https://github.com/aws/aws-durable-execution-conformance-tests.git \
114+
"${RUNNER_TEMP}/conformance"
115+
git -C "${RUNNER_TEMP}/conformance" checkout "${CONFORMANCE_COMMIT}"
116+
python -m pip install \
117+
"${RUNNER_TEMP}/conformance/packages/aws-durable-execution-conformance-tests"
118+
119+
- name: Checkout pinned AWS SDK for C++
120+
run: |
121+
git clone --filter=blob:none --no-checkout \
122+
https://github.com/aws/aws-sdk-cpp.git \
123+
"${RUNNER_TEMP}/aws-sdk-cpp"
124+
git -C "${RUNNER_TEMP}/aws-sdk-cpp" sparse-checkout init --cone
125+
git -C "${RUNNER_TEMP}/aws-sdk-cpp" sparse-checkout set \
126+
cmake \
127+
toolchains \
128+
src/aws-cpp-sdk-core \
129+
generated/src/aws-cpp-sdk-lambda
130+
git -C "${RUNNER_TEMP}/aws-sdk-cpp" checkout "${AWS_SDK_CPP_COMMIT}"
131+
git -C "${RUNNER_TEMP}/aws-sdk-cpp" submodule update \
132+
--init --recursive crt/aws-crt-cpp
133+
134+
- name: Checkout pinned aws-lambda-cpp
135+
run: |
136+
git clone --filter=blob:none \
137+
https://github.com/awslabs/aws-lambda-cpp.git \
138+
"${RUNNER_TEMP}/aws-lambda-cpp"
139+
git -C "${RUNNER_TEMP}/aws-lambda-cpp" checkout \
140+
"${AWS_LAMBDA_CPP_COMMIT}"
141+
142+
- name: Restore Amazon Linux build cache
143+
uses: actions/cache@v4
144+
with:
145+
path: .cache/conformance-al2023
146+
key: al2023-v1-${{ runner.os }}-${{ env.AWS_SDK_CPP_COMMIT }}-${{ env.AWS_LAMBDA_CPP_COMMIT }}-${{ hashFiles('scripts/build_conformance_al2023.sh') }}-${{ github.sha }}
147+
restore-keys: al2023-v1-${{ runner.os }}-${{ env.AWS_SDK_CPP_COMMIT }}-${{ env.AWS_LAMBDA_CPP_COMMIT }}-${{ hashFiles('scripts/build_conformance_al2023.sh') }}-
148+
149+
- name: Build Amazon Linux 2023 package
150+
env:
151+
AWS_SDK_CPP_SOURCE: ${{ runner.temp }}/aws-sdk-cpp
152+
AWS_LAMBDA_CPP_SOURCE: ${{ runner.temp }}/aws-lambda-cpp
153+
BUILD_ROOT: ${{ github.workspace }}/.cache/conformance-al2023
154+
JOBS: "2"
155+
run: scripts/build_conformance_al2023.sh
156+
157+
- name: Install SAM CLI container wrapper
158+
run: |
159+
mkdir -p "${RUNNER_TEMP}/bin"
160+
cat >"${RUNNER_TEMP}/bin/sam" <<'EOF'
161+
#!/usr/bin/env bash
162+
set -euo pipefail
163+
exec docker run --rm \
164+
-e AWS_ACCESS_KEY_ID \
165+
-e AWS_SECRET_ACCESS_KEY \
166+
-e AWS_SESSION_TOKEN \
167+
-e AWS_REGION \
168+
-e AWS_DEFAULT_REGION \
169+
-e SAM_CLI_TELEMETRY=0 \
170+
-v "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}" \
171+
-v "${RUNNER_TEMP}:${RUNNER_TEMP}" \
172+
-w "${PWD}" \
173+
public.ecr.aws/sam/build-provided.al2023 \
174+
sam "$@"
175+
EOF
176+
chmod +x "${RUNNER_TEMP}/bin/sam"
177+
echo "${RUNNER_TEMP}/bin" >>"${GITHUB_PATH}"
178+
179+
- name: Run all official conformance requirements
180+
run: |
181+
mkdir -p conformance-output/history
182+
durable-execution-conformance \
183+
--template conformance/template.json \
184+
--language cpp \
185+
--region "${AWS_REGION}" \
186+
--name "cpp-persistent" \
187+
--max-workers 4 \
188+
--suite all \
189+
--no-cleanup \
190+
--report console json junit \
191+
--report-file "${GITHUB_WORKSPACE}/conformance-output/report" \
192+
--history-dir "${GITHUB_WORKSPACE}/conformance-output/history" \
193+
--fail-on failed+uncovered
194+
195+
- name: Upload conformance reports
196+
if: always()
197+
uses: actions/upload-artifact@v4
198+
with:
199+
name: conformance-${{ github.run_id }}
200+
path: conformance-output/
201+
if-no-files-found: warn

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/build/
2+
/build-*/
3+
/cmake-build-*/
4+
/.cache/
5+
/.clangd/
6+
__pycache__/
7+
*.pyc
8+
compile_commands.json
9+
*.gcda
10+
*.gcno
11+
*.profraw
12+
*.profdata
13+
conformance/durable_execution_conformance.zip

0 commit comments

Comments
 (0)