Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert previous network tol patch and try with conda config #4209

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions buildscripts/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
@rem first configure conda to have more tolerance of network problems, these
@rem numbers are not scientifically chosen, just merely larger than defaults
set CONDA_CONFIG=cmd /C conda config
%CONDA_CONFIG% --write-default
%CONDA_CONFIG% --set remote_connect_timeout_secs 30.15
%CONDA_CONFIG% --set remote_max_retries 10
%CONDA_CONFIG% --set remote_read_timeout_secs 120.2
cmd /C conda info
%CONDA_CONFIG% --show

@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
@rem script in non-root environments.
set CONDA_INSTALL=cmd /C conda install -q -y
Expand Down
39 changes: 11 additions & 28 deletions buildscripts/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,16 @@

set -v -e

network_tolerant_conda() {
local cmd=$1
shift
local attempts=$1
shift
for i in `seq $(($attempts + 1))`; do
conda $cmd -q -y $*
if [ $? == 0 ]; then
break;
else
if [ $i != $(($attempts + 1)) ]; then
echo "Connection/conda problem... retrying (attempt $i/$attempts)"
else
msg="Unresolved connection/conda problem...
exiting after $attempts additional attempts"
echo $msg
exit 1
fi
fi
done
}
# first configure conda to have more tolerance of network problems, these
# numbers are not scientifically chosen, just merely larger than defaults
conda config --write-default
conda config --set remote_connect_timeout_secs 30.15
conda config --set remote_max_retries 10
conda config --set remote_read_timeout_secs 120.2
conda info
conda config --show

CONDA_INSTALL="network_tolerant_conda install 3"
CONDA_CREATE="network_tolerant_conda create 3"
CONDA_REMOVE="network_tolerant_conda remove 3"
CONDA_EXPORT="network_tolerant_conda export 3"
CONDA_INSTALL="conda install -q -y"
PIP_INSTALL="pip install -q"


Expand All @@ -39,20 +23,19 @@ fi

# Deactivate any environment
source deactivate

# Display root environment (for debugging)
conda list
# Clean up any left-over from a previous build
# (note workaround for https://github.com/conda/conda/issues/2679:
# `conda env remove` issue)
$CONDA_REMOVE --all -n $CONDA_ENV
conda remove --all -q -y -n $CONDA_ENV

# If VANILLA_INSTALL is yes, then only Python, NumPy and pip are installed, this
# is to catch tests/code paths that require an optional package and are not
# guarding against the possibility that it does not exist in the environment.
# Create a base env first and then add to it...

$CONDA_CREATE -n $CONDA_ENV ${EXTRA_CHANNELS} python=$PYTHON numpy=$NUMPY pip
conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON numpy=$NUMPY pip

# Activate first
set +v
Expand Down