From ce4df379d646ba379b8b5dcb0b663a75b17a3b16 Mon Sep 17 00:00:00 2001 From: Raymond Wang Date: Wed, 4 Aug 2021 06:02:43 +0000 Subject: [PATCH] fix: add dockerhub default login server, improve logs to check docker pull limitation --- appveyor.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ed730e0a24f..d5e990f5219 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -170,12 +170,21 @@ for: # Runs only in Linux, logging docker hub when running canary and docker cred is available - sh: " if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]]; - then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin registry-1.docker.io; + then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin registry-1.docker.io; + fi" + - sh: " + if [[ -n $BY_CANARY ]] && [[ -n $DOCKER_USER ]] && [[ -n $DOCKER_PASS ]]; + then echo Logging in Docker Hub; echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin; fi" - sh: " if [[ -n $BY_CANARY ]]; then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws; fi" + + # Check dockerhub anonymous pull limitation before integration tests, verify if it's related to toomanyrequest failures + - sh: "sudo apt-get -y install jq" + - sh: "TOKEN=$(curl \"https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull\" | jq -r .token); curl --head -H \"Authorization: Bearer $TOKEN\" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" + - sh: "pytest -vv tests/integration" - sh: "pytest -vv tests/regression" - sh: "black --check setup.py tests samcli" @@ -187,3 +196,6 @@ for: # Smoke tests run in parallel - it runs on both Linux & Windows # Presence of the RUN_SMOKE envvar will run the smoke tests - ps: "If ($env:RUN_SMOKE) {pytest -n 4 -vv tests/smoke}" + + # Check dockerhub anonymous pull limitation after integration tests, verify if it's related to toomanyrequest failures + - sh: "TOKEN=$(curl \"https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull\" | jq -r .token); curl --head -H \"Authorization: Bearer $TOKEN\" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest"