Login to Meta's ECR when using non-meta runner (#132870)

The project depends on fetching container images from Meta's ECR repo so when run on non-meta runners we need to ensure that we also login to Meta's ECR too.

Closes pytorch/ci-infra#252.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/132870
Approved by: https://github.com/ZainRizvi
This commit is contained in:
Thanh Ha
2024-08-08 16:34:43 +00:00
committed by PyTorch MergeBot
parent 4a4dc9d6d9
commit dfc5bb0099

View File

@ -59,6 +59,13 @@ runs:
aws ecr get-login-password --region "$AWS_DEFAULT_REGION" | docker login --username AWS \
--password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"
# For LF Runners we need to make sure we also login to Meta's ECR docker registry too.
META_AWS_ACCOUNT_ID=308535385114
if [ "$AWS_ACCOUNT_ID" != "$META_AWS_ACCOUNT_ID" ] ; then
aws ecr get-login-password --region "$AWS_DEFAULT_REGION" | docker login --username AWS \
--password-stdin "$META_AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"
fi
- name: Preserve github env variables for use in docker
shell: bash
run: |