Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,25 @@ jobs:

- name: Build
working-directory: examples/${{ matrix.example }}
run: sam build
run: |
# Retry to tolerate transient registry rate limits (toomanyrequests: Rate
# exceeded). public.ecr.aws throttles unauthenticated pulls at ~1 req/s per
# source IP, and the matrix runs many jobs from shared runner IPs, so bursts
# collide. Exponential backoff with random jitter desynchronizes retries
# across jobs to avoid a thundering herd re-colliding on the same boundary.
max_attempts=5
attempt=1
while true; do
if sam build; then exit 0; fi
if [ "$attempt" -ge "$max_attempts" ]; then
echo "sam build failed after ${max_attempts} attempts"
exit 1
fi
delay=$(( 10 * 2 ** (attempt - 1) + RANDOM % 16 )) # ~10/20/40/80s + 0-15s jitter
echo "sam build failed (attempt ${attempt}/${max_attempts}), retrying in ${delay}s..."
sleep "$delay"
attempt=$(( attempt + 1 ))
done

- name: Start local API and verify
working-directory: examples/${{ matrix.example }}
Expand Down Expand Up @@ -201,7 +219,25 @@ jobs:

- name: Build
working-directory: examples/${{ matrix.example }}
run: sam build
run: |
# Retry to tolerate transient registry rate limits (toomanyrequests: Rate
# exceeded). public.ecr.aws throttles unauthenticated pulls at ~1 req/s per
# source IP, and the matrix runs many jobs from shared runner IPs, so bursts
# collide. Exponential backoff with random jitter desynchronizes retries
# across jobs to avoid a thundering herd re-colliding on the same boundary.
max_attempts=5
attempt=1
while true; do
if sam build; then exit 0; fi
if [ "$attempt" -ge "$max_attempts" ]; then
echo "sam build failed after ${max_attempts} attempts"
exit 1
fi
delay=$(( 10 * 2 ** (attempt - 1) + RANDOM % 16 )) # ~10/20/40/80s + 0-15s jitter
echo "sam build failed (attempt ${attempt}/${max_attempts}), retrying in ${delay}s..."
sleep "$delay"
attempt=$(( attempt + 1 ))
done

- name: Inject local layer into build output
working-directory: examples/${{ matrix.example }}
Expand Down
2 changes: 1 addition & 1 deletion examples/fasthtml-zip/app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-fasthtml
python-fasthtml==0.13.4
2 changes: 1 addition & 1 deletion examples/fasthtml/app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-fasthtml
python-fasthtml==0.13.4
2 changes: 1 addition & 1 deletion examples/nextjs-zip/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Resources:
CodeUri: app/
MemorySize: 256
Handler: run.sh
Runtime: nodejs20.x
Runtime: nodejs22.x
Architectures:
- x86_64
Environment:
Expand Down
2 changes: 1 addition & 1 deletion examples/remix-zip/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Resources:
Properties:
CodeUri: .
Handler: run.sh
Runtime: nodejs20.x
Runtime: nodejs22.x
MemorySize: 1024
Architectures:
- x86_64
Expand Down
Loading