From d70a8933256f6c9f10b62c1610cea0897b3d4f99 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Thu, 23 Aug 2018 15:35:32 +0200 Subject: [PATCH] add refdata to caching --- .travis.yml | 34 ++++++++++-------------------- ci-helpers/fetch_reference_data.sh | 16 ++++++++++++++ tardis_env27.yml | 3 ++- 3 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 ci-helpers/fetch_reference_data.sh diff --git a/.travis.yml b/.travis.yml index d865ccd1be2..5136b0b014e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,6 @@ python: virtualenv: system_site_packages: true -cache: - apt: true - directories: - - $HOME/miniconda addons: apt: packages: @@ -27,23 +23,24 @@ env: - ASTROPY_USE_SYSTEM_PYTEST=1 - SETUP_CMD='test' - TEST_MODE='normal' - - TARDIS_REF_DATA_URL='https://github.com/tardis-sn/tardis-refdata.git' + - REF_DATA_HOME=$HOME/tardis-refdata - MINICONDA_URL='http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh' - SAVE_COVERAGE=false + - GIT_LFS_SKIP_SMUDGE=1 matrix: include: - python: 2.7 env: - COMPILER=gcc - - SETUP_CMD='test --coverage --args="--tardis-refdata=$HOME/tardis-refdata/"' + - SETUP_CMD='test --coverage --args="--tardis-refdata=$REF_DATA_HOME"' - TEST_MODE='spectrum' - SAVE_COVERAGE=true - python: 2.7 env: - COMPILER=clang - - SETUP_CMD='test --args="--tardis-refdata=$HOME/tardis-refdata/"' + - SETUP_CMD='test --args="--tardis-refdata=$REF_DATA_HOME"' - TEST_MODE='spectrum' #trouble with osx building due to segfault at cython (https://github.com/cython/cython/issues/2199) @@ -51,32 +48,23 @@ matrix: language: generic env: - COMPILER=clang - - SETUP_CMD='test --args="--tardis-refdata=$HOME/tardis-refdata/"' + - SETUP_CMD='test --args="--tardis-refdata=$REF_DATA_HOME"' - TEST_MODE='spectrum' - MINICONDA_URL='http://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh' - python: 2.7 env: SETUP_CMD='test' +cache: + apt: true + directories: + - $HOME/miniconda + - $REF_DATA_HOME + before_install: # We do this to make sure we get the dependencies so pip works below - source ci-helpers/install_miniconda.sh - - if [[ $TEST_MODE == 'spectrum' ]]; then conda install -c conda-forge git-lfs=2.2.1 -y; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git lfs install --skip-smudge; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git clone $TARDIS_REF_DATA_URL $HOME/tardis-refdata; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then cd $HOME/tardis-refdata; fi - # Use the following to get the ref-data from the master; - - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout origin/master; fi - # Use the following to get the ref-data from a specific pull request; - # - if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/11/head:thomson-ref; fi - # - if [[ $TEST_MODE == 'spectrum' ]]; then git checkout thomson-ref; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/chianti_He.h5" origin; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="plasma_reference/" origin; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="unit_test_data.h5" origin; fi - - if [[ $TEST_MODE == 'spectrum' ]]; then cd $TRAVIS_BUILD_DIR; fi install: diff --git a/ci-helpers/fetch_reference_data.sh b/ci-helpers/fetch_reference_data.sh new file mode 100644 index 00000000000..41cf39d09a7 --- /dev/null +++ b/ci-helpers/fetch_reference_data.sh @@ -0,0 +1,16 @@ +git lfs install + +if test -e $REF_DATA_HOME; then + git clone https://github.com/tardis-sn/tardis-refdata.git $REF_DATA_HOME +else + cd $REF_DATA_HOME + # Use the following to get the ref-data from the master; + git fetch origin + checkout origin/master + # Use the following to get the ref-data from a specific pull request + #git fetch origin pull/11/head:thomson-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 + cd $TRAVIS_BUILD_DIR diff --git a/tardis_env27.yml b/tardis_env27.yml index 314bf1b122f..de11427d97e 100644 --- a/tardis_env27.yml +++ b/tardis_env27.yml @@ -35,7 +35,8 @@ dependencies: - docopt=0.6.2 - pytest-cov=2.2.1 - codecov - +#testing requirements +- git-lfs=2.4 - pip: - sphinx_bootstrap_theme - sphinxcontrib-bibtex