Skip to content

Commit

Permalink
Fixing upload_binary_htmls again
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#20736

Differential Revision: D15433417

Pulled By: pjh5

fbshipit-source-id: 58964a341226b536be899855058422cb82aa054b
  • Loading branch information
pjh5 authored and facebook-github-bot committed May 21, 2019
1 parent fac307a commit e3970d6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .circleci/scripts/binary_install_miniconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@ set -eux -o pipefail

# This step runs on multiple executors with different envfile locations
if [[ "$(uname)" == Darwin ]]; then
source "/Users/distiller/project/env"
envfile="/Users/distiller/project/env"
elif [[ -d "/home/circleci/project" ]]; then
# machine executor (binary tests)
source "/home/circleci/project/env"
envfile="/home/circleci/project/env"
else
# docker executor (binary builds)
source "/env"
envfile="/env"
fi

# MINICONDA_ROOT is populated in binary_populate_env.sh , but update_htmls does
# not source that script since it does not have a BUILD_ENVIRONMENT. It could
# make a fake BUILD_ENVIRONMENT and call that script anyway, but that seems
# more hacky than this
if [[ -z "${MINICONDA_ROOT:-}" ]]; then
# TODO get rid of this. Might need to separate binary_populate_env into two
# steps, one for every job and one for build jobs
# TODO this is super hacky and ugly. Basically, the binary_update_html job does
# not have an env file, since it does not call binary_populate_env.sh, since it
# does not have a BUILD_ENVIRONMENT. So for this one case, which we detect by a
# lack of an env file, we manually export the environment variables that we
# need to install miniconda
if [[ ! -f "$envfile" ]]; then
MINICONDA_ROOT="/home/circleci/project/miniconda"
workdir="/home/circleci/project"
retry () {
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}
export -f retry
else
source "$envfile"
fi

conda_sh="$workdir/install_miniconda.sh"
Expand Down

0 comments on commit e3970d6

Please sign in to comment.