Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add retry for pulling fluentd image from ECR Public #76

Merged
merged 1 commit into from
Sep 25, 2023
Merged
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ jobs:
FLUENTD_LOG_DIR=${GITHUB_WORKSPACE}/fluentd-logs
FLUENTD_PORT=24224
FLUENTD_IMAGE=public.ecr.aws/docker/library/fluentd:v1.16-debian-1
: # ECR Public anonymous pull rate quota is 1 per sec. https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html.
: # Running multiple jobs at the same time may exceed rate limit. Retry 3 times to prevent flaky behavior.
count=0
until [ $count -ge 3 ]
do
docker pull $FLUENTD_IMAGE && break
count=$((count+1))
[ $count -eq 3 ] && echo "Pull command failed after 3 attempts" && exit 1
sleep 3
done
: # Fluentd container is not using root user so need 777 to make it writable. https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#docker-container-filesystem
sudo mkdir -m 777 $FLUENTD_LOG_DIR
docker run -d -p $FLUENTD_PORT:24224 -p $FLUENTD_PORT:24224/udp -v $FLUENTD_LOG_DIR:/fluentd/log $FLUENTD_IMAGE
Expand Down