Skip to content

Commit

Permalink
Azure pipeline for TARDIS (#894)
Browse files Browse the repository at this point in the history
* enable pull request

* add display variable step

* add a few more variables

* set build directory variable

* set variable

* add tardis home

* try second url variable

* switching out build_dir definitions

* change https to http

* add install conda env script

* add reference data fetcher

* fix env creator

* fix variable hell

* fix source activate

* fix source problems

* add ref-data test

* add moria to pool

* add mac build

* remove task

* remove activation of conda activate

* make conda variable
  • Loading branch information
wkerzendorf authored Mar 9, 2019
1 parent 1127c22 commit 908c8c0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 32 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ env:
- SETUP_CMD='test'
- TEST_MODE='normal'
- REF_DATA_HOME=$HOME/tardis-refdata
- REF_DATA_GITHUBURL='https://github.com/tardis-sn/tardis-refdata.git'
- REF_DATA_GITHUB_URL='https://github.com/tardis-sn/tardis-refdata.git'
- MINICONDA_URL='http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh'
- SAVE_COVERAGE=false
- GIT_LFS_SKIP_SMUDGE=1
- TARDIS_BUILD_DIR=$TRAVIS_BUILD_DIR
# Doctr deploy key for tardis-sn/tardis
- secure: "LrhEnB3RgZ/ZA4PruYSF7pkzlY+LrfF1GKpeU+wcG5v/BMIsoTGySO9C1T7XJfsCFMaKMiJoa7ZhJEXPlss9i9PzxFsvbBrBfwb5lPurTbQwqBN4qW/+u2V1kSLAwtVJIHzenVB25PevjkCz8TeAv6DWyHgBWBmImJaTC3d+1/Q="

Expand All @@ -45,6 +46,7 @@ before_install:

install:
- source ci-helpers/install_tardis_env.sh
- source activate tardis
- source ci-helpers/fetch_reference_data.sh

script:
Expand Down
44 changes: 20 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,50 @@ trigger:
- master

variables:
System.Debug: 'true'
ref_data_home: '$(home)/tardis-refdata'
ref_data_githuburl: 'https://github.com/tardis-sn/tardis-refdata.git'
system.debug: 'true'
ref.data.home: '$(Agent.BuildDirectory)/tardis-refdata'

ref.data.github.url: 'https://github.com/tardis-sn/tardis-refdata.git'
tardis.build.dir: $(Build.Repository.LocalPath)



jobs:

- job: 'Test'
pool:
vmImage: 'Ubuntu-16.04'
vmImage: $[variables.vm_Image]

strategy:
matrix:
Python36:
python.version: '3.6'

linux:
vm_Image: 'Ubuntu-16.04'
conda: '/usr/share/miniconda'
mac:
vm_Image: 'macOS-10.13'
miniconda.url: 'http://repo.continuum.io/miniconda/Miniconda2-latest-mac-x86_64.sh'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- bash: |
echo "##vso[task.prependpath]/usr/share/miniconda/bin"
echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: |
pwd
echo $AGENT_BUILDIRECTORY
sudo chown -R $USER /usr/share/miniconda
sudo chown -R $USER $CONDA
conda update -y conda
. /usr/share/miniconda/etc/profile.d/conda.sh
displayName: updating conda and activating
- bash: |
conda env create -f tardis_env3.yml
sh ci-helpers/install_tardis_env.sh
displayName: 'Install TARDIS env'
- bash: |
echo $HOME
echo $AGENT_BUILD_DIRECTORY
echo $REF_DATA_HOME
echo $REF_DATA_GITHUBURL
displayName: 'fetching reference data'
sh ci-helpers/fetch_reference_data.sh
displayName: 'Fetch Reference Data'
- bash: |
source activate tardis
python setup.py test
python setup.py test --coverage --args="--tardis-refdata=$(ref.data.home)"
displayName: 'TARDIS test'
6 changes: 3 additions & 3 deletions ci-helpers/fetch_reference_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ git lfs install --skip-smudge
if test -e $REF_DATA_HOME; then
echo "Ref data available"
else
echo git clone $REF_DATA_GITHUBURL $REF_DATA_HOME
git clone $REF_DATA_GITHUBURL $REF_DATA_HOME
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;
Expand All @@ -18,4 +18,4 @@ 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
echo MD5 `md5sum unit_test_data.h5`; fi
cd $TRAVIS_BUILD_DIR
cd $TARDIS_BUILD_DIR
5 changes: 1 addition & 4 deletions ci-helpers/install_tardis_env.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env bash
cd $TRAVIS_BUILD_DIR
cd $TARDIS_BUILD_DIR
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
#trouble with building due to segfault at cython (https://github.com/cython/cython/issues/2199)
#remove if we can get normal cython through conda
conda activate tardis
fi

conda activate tardis

0 comments on commit 908c8c0

Please sign in to comment.