Skip to content

Commit b94faf6

Browse files
authored
Merge branch 'main' into feat/withRetry
2 parents df4715a + a05ccd1 commit b94faf6

114 files changed

Lines changed: 43408 additions & 30 deletions

File tree

Some content is hidden

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

.github/workflows/deploy-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: pip install hatch
6060
- name: Build examples
6161
run: |
62-
hatch run -- examples:pip install -e packages/aws-durable-execution-sdk-python packages/aws-durable-execution-sdk-python-otel
62+
hatch run -- examples:pip install -e packages/aws-durable-execution-sdk-python packages/aws-durable-execution-sdk-python-otel packages/aws-durable-execution-sdk-python-testing
6363
hatch run examples:build
6464
6565
- name: Deploy Lambda function - ${{ matrix.example.name }}

.github/workflows/ecr-release.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Upload Testing SDK Emulator Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
env:
12+
package_path: packages/aws-durable-execution-sdk-python-testing
13+
aws_region: us-east-1
14+
ecr_repository_name: durable-functions/aws-durable-execution-emulator
15+
16+
jobs:
17+
build-and-upload-image-to-ecr:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
full_image_arm64: ${{ steps.build-publish.outputs.full_image_arm64 }}
21+
full_image_x86_64: ${{ steps.build-publish.outputs.full_image_x86_64 }}
22+
ecr_registry_repository: ${{ steps.build-publish.outputs.ecr_registry_repository }}
23+
version: ${{ steps.version.outputs.VERSION }}
24+
strategy:
25+
matrix:
26+
include:
27+
- arch: x86_64
28+
platform: linux/amd64
29+
- arch: arm64
30+
platform: linux/arm64
31+
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
ref: ${{ github.event.release.tag_name }}
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
39+
with:
40+
python-version: "3.13"
41+
42+
- name: Install Hatch
43+
run: python -m pip install --upgrade hatch==1.16.5
44+
45+
- name: Set up QEMU for multi-platform builds
46+
if: matrix.arch == 'arm64'
47+
uses: docker/setup-qemu-action@v3
48+
with:
49+
platforms: arm64
50+
51+
- name: Build distribution
52+
working-directory: ${{ env.package_path }}
53+
run: hatch build
54+
55+
- name: Get version from __about__.py
56+
id: version
57+
run: |
58+
VERSION=$(grep "^__version__" "${{ env.package_path }}/src/aws_durable_execution_sdk_python_testing/__about__.py" | cut -d'"' -f2)
59+
echo "VERSION=$VERSION"
60+
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
61+
62+
- name: Configure AWS Credentials
63+
uses: aws-actions/configure-aws-credentials@v4
64+
with:
65+
role-to-assume: ${{ secrets.ECR_UPLOAD_IAM_ROLE_ARN }}
66+
aws-region: ${{ env.aws_region }}
67+
68+
- name: Login to Amazon ECR
69+
id: login-ecr-public
70+
uses: aws-actions/amazon-ecr-login@v2
71+
with:
72+
registry-type: public
73+
74+
- name: Build, tag, and push image to Amazon ECR
75+
id: build-publish
76+
shell: bash
77+
env:
78+
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
79+
ECR_REPOSITORY: ${{ env.ecr_repository_name }}
80+
PER_ARCH_IMAGE_TAG: v${{ steps.version.outputs.VERSION }}-${{ matrix.arch }}
81+
run: |
82+
docker build --platform "${{ matrix.platform }}" --provenance false "${{ env.package_path }}" -f "${{ env.package_path }}/Dockerfile" -t "$ECR_REGISTRY/$ECR_REPOSITORY:$PER_ARCH_IMAGE_TAG"
83+
docker push "$ECR_REGISTRY/$ECR_REPOSITORY:$PER_ARCH_IMAGE_TAG"
84+
echo "ecr_registry_repository=$ECR_REGISTRY/$ECR_REPOSITORY" >> "$GITHUB_OUTPUT"
85+
echo "full_image_${{ matrix.arch }}=$ECR_REGISTRY/$ECR_REPOSITORY:$PER_ARCH_IMAGE_TAG" >> "$GITHUB_OUTPUT"
86+
87+
create-ecr-manifest-per-arch:
88+
runs-on: ubuntu-latest
89+
needs: [build-and-upload-image-to-ecr]
90+
steps:
91+
- name: Configure AWS Credentials
92+
uses: aws-actions/configure-aws-credentials@v4
93+
with:
94+
role-to-assume: ${{ secrets.ECR_UPLOAD_IAM_ROLE_ARN }}
95+
aws-region: ${{ env.aws_region }}
96+
97+
- name: Login to Amazon ECR
98+
uses: aws-actions/amazon-ecr-login@v2
99+
with:
100+
registry-type: public
101+
102+
- name: Create and push explicit version manifest
103+
run: |
104+
docker manifest create "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:v${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
105+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}" \
106+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}"
107+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:v${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
108+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}" \
109+
--arch arm64 \
110+
--os linux
111+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:v${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
112+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}" \
113+
--arch amd64 \
114+
--os linux
115+
docker manifest push "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:v${{ needs.build-and-upload-image-to-ecr.outputs.version }}"
116+
117+
- name: Create and push latest manifest
118+
run: |
119+
docker manifest create "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}" \
120+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}" \
121+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}"
122+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}" \
123+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}" \
124+
--arch arm64 \
125+
--os linux
126+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}" \
127+
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}" \
128+
--arch amd64 \
129+
--os linux
130+
docker manifest push "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}"

.github/workflows/integration-tests.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ jobs:
2222
with:
2323
path: language-sdk
2424

25-
- name: Checkout the latest Testing SDK
26-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27-
with:
28-
repository: aws/aws-durable-execution-sdk-python-testing
29-
path: language-sdk/packages/testing-sdk
30-
3125
- name: Set up Python ${{ matrix.python-version }}
3226
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3327
with:
@@ -40,7 +34,6 @@ jobs:
4034
working-directory: language-sdk
4135
run: |
4236
echo "Running SDK tests..."
43-
hatch run -- test:pip install -e packages/testing-sdk
4437
hatch run types:check
4538
hatch run test:cov
4639
@@ -61,12 +54,6 @@ jobs:
6154
with:
6255
path: language-sdk
6356

64-
- name: Checkout the latest Testing SDK
65-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
66-
with:
67-
repository: aws/aws-durable-execution-sdk-python-testing
68-
path: language-sdk/packages/testing-sdk
69-
7057
- name: Set up Python 3.13
7158
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
7259
with:
@@ -105,7 +92,6 @@ jobs:
10592
KMS_KEY_ARN: ${{ secrets.KMS_KEY_ARN }}
10693
run: |
10794
echo "Building examples..."
108-
hatch run -- examples:pip install -e packages/testing-sdk
10995
hatch run examples:build
11096
11197
# Get first integration example for testing

.github/workflows/pypi-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
path: packages/aws-durable-execution-sdk-python
2727
- name: aws-durable-execution-sdk-python-otel
2828
path: packages/aws-durable-execution-sdk-python-otel
29+
- name: aws-durable-execution-sdk-python-testing
30+
path: packages/aws-durable-execution-sdk-python-testing
2931

3032
steps:
3133
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -58,6 +60,7 @@ jobs:
5860
package:
5961
- name: aws-durable-execution-sdk-python
6062
- name: aws-durable-execution-sdk-python-otel
63+
- name: aws-durable-execution-sdk-python-testing
6164
permissions:
6265
id-token: write
6366

packages/aws-durable-execution-sdk-python-examples/cli.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,12 @@ def build_examples():
4646
shutil.rmtree(build_dir)
4747
build_dir.mkdir()
4848

49-
# Copy testing library from current environment
50-
try:
51-
import aws_durable_execution_sdk_python_testing
52-
53-
sdk_path = Path(aws_durable_execution_sdk_python_testing.__file__).parent
54-
logger.info("Copying SDK from %s", sdk_path)
55-
shutil.copytree(
56-
sdk_path, build_dir / "aws_durable_execution_sdk_python_testing"
57-
)
58-
except (ImportError, OSError):
59-
logger.exception("Failed to copy testing library")
60-
return False
61-
6249
# Install local packages so their runtime dependencies are included in
6350
# the Lambda deployment package.
6451
runtime_packages = [
6552
packages_dir / "aws-durable-execution-sdk-python",
6653
packages_dir / "aws-durable-execution-sdk-python-otel",
54+
packages_dir / "aws-durable-execution-sdk-python-testing",
6755
]
6856
try:
6957
subprocess.run(
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.13-slim
2+
3+
# Copy and install the wheel
4+
COPY dist/*.whl /tmp/
5+
RUN pip install --no-cache-dir /tmp/*.whl && rm -rf /tmp/*.whl
6+
7+
# AWS credentials (required for boto3)
8+
ENV AWS_ACCESS_KEY_ID=foo \
9+
AWS_SECRET_ACCESS_KEY=bar \
10+
AWS_DEFAULT_REGION=us-east-1
11+
12+
EXPOSE 9014
13+
14+
CMD ["dex-local-runner", "start-server", \
15+
"--host", "0.0.0.0", \
16+
"--port", "9014", \
17+
"--log-level", "DEBUG", \
18+
"--lambda-endpoint", "http://host.docker.internal:3001", \
19+
"--store-type", "sqlite", \
20+
"--store-path", "/tmp/.durable-executions-local/durable-executions.db"]

0 commit comments

Comments
 (0)