Skip to content

Commit b5d6f6b

Browse files
Fix LocalStack startup timing and AWS CLI configuration in CI (#1265)
* Fix LocalStack startup timing and AWS CLI configuration in CI * Pin LocalStack image to stable version to avoid breaking changes from latest * Fix LocalStack image tag (use valid stable version instead of non-existent major tag) * Use LocalStack version 3.0.0 in CI to support S3 checksum headers * Start LocalStack 3.0.0 with robust S3 health check and bucket creation in CI * Upgrade LocalStack to 3.8.1 to fix S3 checksum compatibility with AWSSDK LocalStack 3.0.0 does not support the x-amz-checksum headers that AWSSDK.S3 v3.7.508+ sends by default, causing PutObject to fail with 'NoneType' object has no attribute 'to_bytes'. Also updates the health check endpoint to /_localstack/health for compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 986d214 commit b5d6f6b

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/External-Storage-Tests.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,28 @@ jobs:
3232
- name: Install Docker
3333
uses: docker/setup-buildx-action@v2
3434

35-
- name: Start LocalStack
36-
run: |
37-
docker run -d -p 4566:4566 -p 4572:4572 --name localstack localstack/localstack
38-
sleep 10 # Wait for LocalStack to initialize
3935

40-
- name: Configure AWS CLI for LocalStack
36+
- name: Start LocalStack and create S3 bucket
4137
run: |
42-
aws configure set aws_access_key_id test
43-
aws configure set aws_secret_access_key test
44-
aws configure set default.region us-east-1
45-
aws configure set endpoint_url http://localhost:4566
38+
echo "Starting LocalStack 3.8.1..."
39+
docker run -d -p 4566:4566 --name localstack localstack/localstack:3.8.1
40+
41+
echo "Waiting for LocalStack S3 service to be ready..."
42+
for i in {1..60}; do
43+
if curl -s http://localhost:4566/_localstack/health | grep -q '"s3"'; then
44+
echo "LocalStack S3 is ready!"
45+
break
46+
fi
47+
echo "Still waiting for S3..."
48+
sleep 2
49+
done
50+
51+
echo "LocalStack logs (last 20 lines for debug):"
52+
docker logs --tail 20 localstack
4653
47-
- name: Create S3 Bucket in LocalStack
48-
run: aws s3api create-bucket --bucket test-bucket --endpoint-url http://localhost:4566
54+
echo "Creating test bucket in LocalStack..."
55+
AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=us-east-1 \
56+
aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket
4957
5058
- name: Install .NET 8
5159
uses: actions/setup-dotnet@v3

0 commit comments

Comments
 (0)