Skip to content

Commit

Permalink
switch to built-in conda retry logic
Browse files Browse the repository at this point in the history
conda config --set remote_max_retries 6
  • Loading branch information
tomkinsc committed Feb 13, 2019
1 parent a458646 commit c54c10b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion travis/install-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ else # if it does not exist, we need to install miniconda
export PATH="$MINICONDA_DIR/bin:$PATH"
fi
hash -r
conda config --set always_yes yes --set changeps1 no
conda config --set always_yes yes --set changeps1 no --set remote_max_retries 6
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
Expand Down
30 changes: 19 additions & 11 deletions travis/install-tools.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#set -e -o pipefail
set -e -o pipefail #exit on error or within pipes

CONDA_CHANNEL_STRING="--override-channels -c broad-viral -c conda-forge -c bioconda -c defaults"
CONDA_ENV="$(pwd)/tools/conda-tools/default"
Expand All @@ -16,20 +16,28 @@ if [ ! -d $CONDA_ENV ]; then
conda create -y -m --quiet -p $CONDA_ENV python="$TRAVIS_PYTHON_VERSION" || exit $?
fi

RETRIES=0
RETRY_LIMIT=3
until conda install -y --quiet \
# commented out custom retry logic for now
# until we establish the built-in conda retry logic
# works as intended when we retry more than the default
# 3 times
# remote_max_retries is set in install-conda.sh
#set +e # disable exit on error
#RETRIES=0
#RETRY_LIMIT=3
#until #conda...
conda install -y --quiet \
$CONDA_CHANNEL_STRING \
--file requirements-conda.txt \
--file requirements-conda-tests.txt \
--file requirements-py$PYVER.txt \
-p $CONDA_ENV; do
let RETRIES++
if [ "$RETRIES" -gt "$RETRY_LIMIT" ]; then
break
fi
echo "Conda install failed, likely due to transient server errors. Retrying (${RETRIES}/${RETRY_LIMIT})..."
done
-p $CONDA_ENV #; do
# let RETRIES++
# if [ "$RETRIES" -gt "$RETRY_LIMIT" ]; then
# break
# fi
# echo "Conda install failed, likely due to transient server errors. Retrying (${RETRIES}/${RETRY_LIMIT})..."
#done
#set -e #(re)enable exit on error

conda clean --all --yes # clean temp/cache files to reduce Travis cache size

Expand Down

0 comments on commit c54c10b

Please sign in to comment.