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

[MRG] Using Mamba in Pipelines #1210

Merged
merged 21 commits into from
Jul 19, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 35 additions & 12 deletions azure-pipelines/simple_test_framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,56 @@ jobs:

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
echo "##vso[task.setvariable variable=shellopts]errexit"
displayName: "Force exit on error (bash) "

epassaro marked this conversation as resolved.
Show resolved Hide resolved
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: |
sudo chown -R $USER $CONDA
# conda update -y conda
sudo chown -R $USER $CONDA
Copy link
Member

@epassaro epassaro Jul 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split this step in two steps. The first one does the chown thing and must run exclusive for macOS. The second one does the update, but comment it out because we don't use that unless is necessary.

# conda update -y conda
displayName: updating conda and activating

- bash: |
sh ci-helpers/install_tardis_env.sh
conda install mamba=0.4.0 -c conda-forge -y
displayName: "Install mamba"

- bash: |
mamba env create -f tardis_env3.yml
displayName: "Install TARDIS env"

- bash: |
sh ci-helpers/fetch_reference_data.sh
# sh ci-helpers/fetch_reference_data.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all the comments and the last cd line.

echo git clone $(ref.data.github.url) $(ref.data.home)
git clone $(ref.data.github.url) $(ref.data.home)
cd $(ref.data.home)
# Use the following to get the ref-data from the master;
git fetch origin
git checkout origin/master
# Use the following to get the ref-data from a specific pull request
#git fetch origin pull/20/head:update-ref
#git checkout update-ref
git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin
git lfs pull --include="atom_data/chianti_He.h5" origin
git lfs pull --include="plasma_reference/" origin
git lfs pull --include="unit_test_data.h5" origin
epassaro marked this conversation as resolved.
Show resolved Hide resolved
echo MD5 `md5sum unit_test_data.h5`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a colon after MD5

cd $(tardis.build.dir)
displayName: "Fetch Reference Data"

- bash: |
source activate tardis
python setup.py build_ext --inplace
source activate tardis
python setup.py build_ext --inplace
displayName: "TARDIS build"

- bash: |
source activate tardis
pip install pytest-azurepipelines
pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html

source activate tardis
pip install pytest-azurepipelines
pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html
displayName: "TARDIS test"

- script: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use bash instead of script.

bash <(curl -s https://codecov.io/bash)
bash <(curl -s https://codecov.io/bash)
displayName: "Upload to codecov.io"
2 changes: 2 additions & 0 deletions ci-helpers/install_miniconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if test -e $HOME/miniconda/bin; then
hash -r
#conda update --yes conda


else
wget $MINICONDA_URL -O miniconda.sh
chmod +x miniconda.sh
Expand All @@ -15,6 +16,7 @@ else
export PATH=$HOME/miniconda/bin:$PATH
hash -r
conda update --yes conda

fi

source $HOME/miniconda/etc/profile.d/conda.sh
15 changes: 14 additions & 1 deletion ci-helpers/install_tardis_env.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
#!/usr/bin/env bash
cd $TARDIS_BUILD_DIR

# install mamba
if test -e $HOME/miniconda/bin/mamba; then
echo "Mamba installed Succesfuly"

else
echo "Mamba not installed"
conda install mamba=0.4.0 -c conda-forge -y
echo "Installed Mamba to correct location"
fi

if test -e $HOME/miniconda/envs/tardis; then
echo "TARDIS env already installed.";
# Also check for tardis_env3.yml change
else
conda env create -f tardis_env3.yml
# conda env create -f tardis_env3.yml
echo "Creating TARDIS environment using Mamba"
mamba env create -f tardis_env3.yml
#trouble with building due to segfault at cython (https://github.com/cython/cython/issues/2199)
#remove if we can get normal cython through conda
fi