forked from e-mission/e-mission-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade the setup scripts to support multiple instances of miniconda … (
e-mission#756) * Upgrade the setup scripts to support multiple instances of miniconda at the same time * Pull out the version dependency into a separate file Create a new activate script Use the version dependency in both setup and activate * More refactoring of the activation code - There is now a separate conda activation script to be called before we have set anything up - Both the regular and test setup scripts call conda activate - Setup conda is refactored again to read the expected version from the exports file instead having it be passed in. - Having it be passed in would require the version to be read in the workflow file and this seems like a cleaner solution - Fix the check script to account for the changed arguments as well
- Loading branch information
Showing
9 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source setup/activate_conda.sh | ||
conda activate emission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source setup/export_versions.sh | ||
|
||
INSTALL_PREFIX=$HOME/miniconda-$EXP_CONDA_VER | ||
SOURCE_SCRIPT="$HOME/miniconda-$EXP_CONDA_VER/etc/profile.d/conda.sh" | ||
|
||
source $SOURCE_SCRIPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source setup/activate_conda.sh | ||
conda activate emissiontest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
source setup/export_versions.sh | ||
CURR_CONDA_VER=`conda --version | cut -d " " -f 2` | ||
EXP_CONDA_VER=4.5.12 | ||
|
||
if [ $CURR_CONDA_VER == $EXP_CONDA_VER ]; then | ||
echo "For conda, found $CURR_CONDA_VER, expected $EXP_CONDA_VER, all is good!" | ||
else | ||
echo "For conda, found $CURR_CONDA_VER, expected $EXP_CONDA_VER, run 'bash setup/setup_conda.sh' to get the correct version" | ||
echo "For conda, found $CURR_CONDA_VER, expected $EXP_CONDA_VER, run 'bash setup/setup_conda.sh <platform>' to get the correct version" | ||
echo "Or install manually after downloading from https://repo.anaconda.com/miniconda/" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export EXP_CONDA_VER=4.5.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
EXP_CONDA_VER=4.5.12 | ||
source setup/export_versions.sh | ||
|
||
PLATFORM=$1 | ||
echo "Installing for platform $PLATFORM" | ||
echo "Installing for version $EXP_CONDA_VER and platform $PLATFORM" | ||
|
||
if [ -z $PLATFORM ]; then | ||
if [[ -z $EXP_CONDA_VER || -z $PLATFORM ]]; then | ||
echo "Usage: setup_conda.sh <platform>" | ||
echo " Assumes that the EXP_CONDA_VER variable is set" | ||
echo " Platform options are Linux-x86_64, MacOSX-x86_64" | ||
echo " For Windows, manually download and install https://repo.anaconda.com/miniconda/Miniconda3-$EXP_CONDA_VER-Windows-x86_64.exe" | ||
else | ||
INSTALL_PREFIX=$HOME/miniconda-$EXP_CONDA_VER | ||
SOURCE_SCRIPT="$HOME/miniconda-$EXP_CONDA_VER/etc/profile.d/conda.sh" | ||
|
||
curl -o miniconda.sh -L https://repo.continuum.io/miniconda/Miniconda3-$EXP_CONDA_VER-$PLATFORM.sh; | ||
bash miniconda.sh -b -p $HOME/miniconda | ||
source "$HOME/miniconda/etc/profile.d/conda.sh" | ||
bash miniconda.sh -b -p $INSTALL_PREFIX | ||
source $SOURCE_SCRIPT | ||
hash -r | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --set always_yes yes | ||
# Useful for debugging any issues with conda | ||
conda info -a | ||
echo "Successfully installed at $INSTALL_PREFIX. Please activate with 'source setup/activateXXX.sh' in every terminal where you want to use conda" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
rm -rf $HOME/miniconda | ||
EXP_CONDA_VER=$1 | ||
INSTALL_PREFIX=$HOME/miniconda-$EXP_CONDA_VER | ||
|
||
rm -rf $INSTALL_PREFIX |