Skip to content

Commit ac4f66c

Browse files
pjh5facebook-github-bot
authored andcommitted
Fix Anaconda logins on binary builds
Summary: Pull Request resolved: pytorch#16848 Differential Revision: D13993614 Pulled By: pjh5 fbshipit-source-id: 16854b06d01460b78d9dbe7bd0341b7332984795
1 parent 4193f7a commit ac4f66c

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

.circleci/config.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -797,22 +797,23 @@ binary_linux_upload: &binary_linux_upload
797797
source /home/circleci/project/env
798798
declare -x "AWS_ACCESS_KEY_ID=${PYTORCH_BINARY_AWS_ACCESS_KEY_ID}"
799799
declare -x "AWS_SECRET_ACCESS_KEY=${PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY}"
800-
declare -x "CONDA_USERNAME=${PYTORCH_BINARY_PJH5_CONDA_USERNAME}"
801-
declare -x "CONDA_PASSWORD=${PYTORCH_BINARY_PJH5_CONDA_PASSWORD}"
800+
cat >/home/circleci/project/login_to_anaconda.sh <<EOL
801+
set +x
802+
echo "Trying to login to Anaconda"
803+
yes | anaconda login \
804+
--username "$PYTORCH_BINARY_PJH5_CONDA_USERNAME" \
805+
--password "$PYTORCH_BINARY_PJH5_CONDA_PASSWORD"
806+
set -x
807+
EOL
808+
chmod +x /home/circleci/project/login_to_anaconda.sh
802809
set -ex
803810
export PATH="$MINICONDA_ROOT/bin:$PATH"
804811
805812
# Upload the package to the final location
806813
pushd /home/circleci/project/final_pkgs
807814
if [[ "$PACKAGE_TYPE" == conda ]]; then
808815
retry conda install -yq anaconda-client
809-
set +x
810-
echo 'If there is no more output then logging into Anaconda failed'
811-
retry timeout 120 \
812-
yes | anaconda login \
813-
--username "$CONDA_USERNAME" \
814-
--password "$CONDA_PASSWORD"
815-
set -x
816+
retry timeout 30 /home/circleci/project/login_to_anaconda.sh
816817
anaconda upload "$(ls)" -u pytorch --label main --no-progress --force
817818
elif [[ "$PACKAGE_TYPE" == libtorch ]]; then
818819
retry pip install -q awscli
@@ -925,21 +926,23 @@ binary_mac_upload: &binary_mac_upload
925926
command: |
926927
export AWS_ACCESS_KEY_ID="${PYTORCH_BINARY_AWS_ACCESS_KEY_ID}"
927928
export AWS_SECRET_ACCESS_KEY="${PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY}"
928-
export CONDA_USERNAME="${PYTORCH_BINARY_PJH5_CONDA_USERNAME}"
929-
export CONDA_PASSWORD="${PYTORCH_BINARY_PJH5_CONDA_PASSWORD}"
929+
cat >/Users/distiller/project/login_to_anaconda.sh <<EOL
930+
set +x
931+
echo "Trying to login to Anaconda"
932+
yes | anaconda login \
933+
--username "$PYTORCH_BINARY_PJH5_CONDA_USERNAME" \
934+
--password "$PYTORCH_BINARY_PJH5_CONDA_PASSWORD"
935+
set -x
936+
EOL
937+
chmod +x /Users/distiller/project/login_to_anaconda.sh
930938
set -ex
931939
source "/Users/distiller/project/env"
932940
export "PATH=$workdir/miniconda/bin:$PATH"
933941
934942
pushd "$workdir/final_pkgs"
935943
if [[ "$PACKAGE_TYPE" == conda ]]; then
936944
retry conda install -yq anaconda-client
937-
set +x
938-
echo 'If there is no more output then logging into Anaconda failed'
939-
retry yes | anaconda login \
940-
--username "$CONDA_USERNAME" \
941-
--password "$CONDA_PASSWORD"
942-
set -x
945+
retry /Users/distiller/project/login_to_anaconda.sh
943946
retry anaconda upload "$(ls)" -u pytorch --label main --no-progress --force
944947
elif [[ "$PACKAGE_TYPE" == libtorch ]]; then
945948
retry pip install -q awscli

0 commit comments

Comments
 (0)