Skip to content

Commit

Permalink
Merge pull request e-mission#739 from shankari/setup_fixes
Browse files Browse the repository at this point in the history
Add scripts to setup and teardown the miniconda version
  • Loading branch information
shankari committed Apr 16, 2020
2 parents fc5c0b3 + f6b85a5 commit a76dd0b
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-with-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '5 4 * * 0'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ language: generic
install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
- wget https://repo.continuum.io/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- hash -r
- conda config --set always_yes yes --set changeps1 no
# Useful for debugging any issues with conda
- conda info -a
- source setup/setup_conda.sh
services:
- mongodb
script:
Expand Down
10 changes: 10 additions & 0 deletions setup/checks/check_for_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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 setup/setup_conda.sh to get the correct version"
exit 1
fi

3 changes: 2 additions & 1 deletion setup/setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

# If the conda binary is not found, specify the full path to it
# you can find it by searching for "conda" under the miniconda3 directory
# typical paths are:
# - on linux: /home/<user>/miniconda3/bin/conda
# - on OSX: /Users/<user>/miniconda3/bin/conda
# - on Windows: C:/Users/<user>/Miniconda3/Scripts/conda

source setup/checks/check_for_conda.sh

echo "Setting up blank environment"
conda create --name emission python=3.6
source activate emission
Expand Down
9 changes: 9 additions & 0 deletions setup/setup_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
EXP_CONDA_VER=4.5.12

wget https://repo.continuum.io/miniconda/Miniconda3-$EXP_CONDA_VER-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
# Useful for debugging any issues with conda
conda info -a
2 changes: 2 additions & 0 deletions setup/setup_nomkl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# - on OSX: /Users/<user>/miniconda3/bin/conda
# - on Windows: C:/Users/<user>/Miniconda3/Scripts/conda

source setup/checks/check_for_conda.sh

echo "Setting up blank environment"
conda create --name emission python=3.6
conda activate emission
Expand Down
2 changes: 2 additions & 0 deletions setup/setup_notebook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# - on OSX: /Users/<user>/miniconda3/bin/conda
# - on Windows: C:/Users/<user>/Miniconda3/Scripts/conda

source setup/checks/check_for_conda.sh

echo "Setting up blank environment"
conda create --name emission python=3.6
conda activate emission
Expand Down
2 changes: 2 additions & 0 deletions setup/setup_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

source setup/checks/check_for_conda.sh

echo "Setting up blank environment"
conda create --name emissiontest python=3.6
if [ ${CI} == "true" ] ; then
Expand Down
1 change: 1 addition & 0 deletions setup/teardown_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -rf $HOME/miniconda

0 comments on commit a76dd0b

Please sign in to comment.