Skip to content

Commit 91971df

Browse files
malfetfacebook-github-bot
authored andcommitted
[BE] [GHA] Use aws ecr get-login-password (pytorch#67709)
Summary: Replacing `aws ecr get-login` with `awc ecr get-login-password`, per https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-ecr-get-login Follow up after the similar change in CircleCI: pytorch#58308 Pull Request resolved: pytorch#67709 Reviewed By: seemethere, janeyx99 Differential Revision: D32119319 Pulled By: malfet fbshipit-source-id: 0cd0d8f4d81e9981a5f8fbf9b812a9167fd48135
1 parent 16ee640 commit 91971df

24 files changed

+113
-243
lines changed

.github/templates/common.yml.j2

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ concurrency:
6767
AWS_RETRY_MODE: standard
6868
AWS_MAX_ATTEMPTS: 5
6969
run: |
70-
aws ecr get-login --no-include-email --region us-east-1 > /tmp/ecr-login.sh
71-
bash /tmp/ecr-login.sh
72-
rm /tmp/ecr-login.sh
70+
AWS_ACCOUNT_ID=$(aws sts get-caller-identity|grep Account|cut -f4 -d\")
71+
aws ecr get-login-password --region "$AWS_DEFAULT_REGION" | docker login --username AWS \
72+
--password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"
7373
- name: Chown workspace
74-
env:
75-
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine"
7674
run: |
7775
!{{ pull_docker("${ALPINE_IMAGE}") }}
7876
# Ensure the working directory gets chowned back to the current user
@@ -97,8 +95,6 @@ concurrency:
9795
run: .github/scripts/wait_for_ssh_to_drain.sh
9896
- name: Chown workspace
9997
if: always()
100-
env:
101-
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine"
10298
run: |
10399
# Ensure the working directory gets chowned back to the current user
104100
docker run --rm -v "$(pwd)":/v -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .

.github/templates/docker_builds_ci_workflow.yml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
{%- endif %}
2020
!{{ common.concurrency(build_environment) }}
2121

22+
env:
23+
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine"
24+
AWS_DEFAULT_REGION: us-east-1
25+
2226
jobs:
2327
{% block docker_build +%}
2428
docker-build:

.github/workflows/generated-caffe2-linux-xenial-py3.6-gcc5.4.yml

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-docker-builds.yml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-linux-bionic-py3.6-clang9.yml

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-linux-vulkan-bionic-py3.6-clang9.yml

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)