feat: publish emulator image directly from testing library#196
feat: publish emulator image directly from testing library#196
Conversation
|
🤖 Emulator PR Created A draft PR has been created with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 The emulator will build binaries using the exact testing SDK commit locked in uv.lock. |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
🔄 Emulator PR Updated The emulator PR has been updated with locked dependencies: ➡️ https://github.com/aws/aws-durable-execution-emulator/pull/401 |
|
|
||
| # Copy and install the wheel | ||
| COPY dist/*.whl /tmp/ | ||
| RUN pip install --no-cache-dir /tmp/*.whl && rm -rf /tmp/*.whl |
There was a problem hiding this comment.
nit: rm wouldn't reduce image size
There was a problem hiding this comment.
you could use a bind mount
RUN --mount=type=bind,source=dist,target=/tmp/dist pip install --no-cache-dir /tmp/dist/*.whl
(then you don't need to COPY before)
| # AWS credentials (required for boto3) | ||
| ENV AWS_ACCESS_KEY_ID=foo \ | ||
| AWS_SECRET_ACCESS_KEY=bar \ | ||
| AWS_DEFAULT_REGION=us-east-1 |
There was a problem hiding this comment.
could be a nice addition, but maybe not essential:
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:9014/health').read()" || exit 1
There was a problem hiding this comment.
I did not include this since the SAM CLI already does this healthcheck. In addition, this was causing the image to fail when running through the SAM CLI. As it's not essential, I opted to not use my time there.
.github/workflows/ecr-release.yml
Outdated
| env: | ||
| ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | ||
| ECR_REPOSITORY: ${{ env.ecr_repository_name }} | ||
| IMAGE_TAG: "v${{ steps.version.outputs.VERSION }}-${{ env.image_tag }}" |
Issue #, if available:
Description of changes: Create emulator image from the python testing library. For each release, we should update the version in the pyproject.poml file in the emulator folder. The image tag will be the aws-durable-sdk-python-testing version with v prefixing it, e.g. v1.1.1.
Dependencies
If this PR requires testing against a specific branch of the Python Language SDK (e.g., for unreleased changes), uncomment and specify the branch below. Otherwise, leave commented to use the main branch.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.