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

caching setup env to speed up things #606

Merged
merged 2 commits into from
May 30, 2019
Merged
Changes from 1 commit
Commits
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
Next Next commit
caching setup env to speed up things
  • Loading branch information
doutriaux1 committed May 30, 2019
commit 6355ea9f35d0875ecdcf54559b4bc3ce51ab7a45
75 changes: 52 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,62 @@ aliases:
PKGS: "vcs vcsaddons mesalib matplotlib scipy cia testsrunner 'proj4<5' 'vtk-cdat>8.1' libnetcdf=4.6.2"
CHANNELS: "-c cdat/label/v81 -c conda-forge -c pcmdi"
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda update -y -q conda
conda config --set anaconda_upload no
if [[ $PY_VER = "py2" ]]; then
conda create -q -n $PY_VER $CHANNELS "python<3" $PKGS $FFMPEG
else
conda create -q -n $PY_VER $CHANNELS "python=3.6" $PKGS $FFMPEG $COVERAGE_PKGS
fi
if [ -d ${HOME}/miniconda ]; then
export PATH=$HOME/miniconda/bin:$PATH
echo "Found miniconda directory"
else
mkdir -p workspace
git clone -b validateNightly [email protected]:CDAT/cdat workspace/cdat --depth=1
python workspace/cdat/scripts/install_miniconda.py -w ${HOME} -p 'py3.7'
echo "miniconda directory not found, installing conda"
export PATH=${HOME}/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda update -y -q conda
conda config --set anaconda_upload no
if [[ $PY_VER = "py2" ]]; then
conda create -q -n cdat $CHANNELS "python<3" $PKGS $FFMPEG
else
conda create -q -n cdat $CHANNELS "python=3.7" $PKGS $FFMPEG $COVERAGE_PKGS
fi
fi

- &setup_pmp
name: setup_pmp
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
source activate $PY_VER
export PATH=${HOME}/miniconda/bin:$PATH
source activate cdat
python setup.py install

- &run_pmp_tests
name: run_pmp_tests
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
export PATH=${HOME}/miniconda/bin:$PATH
export CDAT_ANONYMOUS_LOG=False
export CDAT_SETUP_PATH=${HOME}
source activate $PY_VER
source activate cdat
python run_tests.py -H -v2 $COVERAGE
RESULT=$?
echo "*** $PY_VER test result: "${RESULT}
echo "*** $PY_VER test result: ${RESULT}"

- &run_coveralls
name: run_coveralls
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
source activate $PY_VER
export PATH=${HOME}/miniconda/bin:$PATH
source activate cdat
coveralls
source deactivate

- &conda_upload
name: conda_upload
environment:
CHANNELS: "-c cdat-forge -c conda-forge -c cdat -c pcmdi"
CHANNELS: "-c cdat-forge -c conda-forge -c cdat/label/v81 -c pcmdi"
PKG_NAME: "pcmdi_metrics"
LABEL: "nightly"
command: |
if [[ $CIRCLE_BRANCH != 'master' ]]; then
exit 0
fi
export PATH=${HOME}/project/$WORKDIR/miniconda/bin:$PATH
export PATH=${HOME}/miniconda/bin:$PATH
mkdir conda-bld
cd conda-bld
conda install conda-build anaconda-client
Expand All @@ -77,7 +86,7 @@ aliases:
rm -rf cdp
cp -r ../../recipes/pcmdi_metrics .
python ./prep_for_build.py -l 1.2
conda build $PKG_NAME $CHANNELS --python=36
conda build $PKG_NAME $CHANNELS --python=37
conda build $PKG_NAME $CHANNELS --python=27
anaconda -t $CONDA_UPLOAD_TOKEN upload -u pcmdi -l $LABEL $CONDA_BLD_PATH/noarch/$PKG_NAME-*tar.bz2 --force

Expand All @@ -93,8 +102,13 @@ jobs:
FFMPEG: "'ffmpeg>4' 'libpng>1.6.34'"
steps:
- checkout
- run: *setup_miniconda
- restore_cache:
keys:
- macos_py2
- run: *create_conda_env
- save_cache:
key: macos_py2
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- store_artifacts:
Expand All @@ -116,8 +130,13 @@ jobs:
COVERAGE_PKGS: "coverage coveralls"
steps:
- checkout
- run: *setup_miniconda
- restore_cache:
keys:
- macos_py3
- run: *create_conda_env
- save_cache:
key: macos_py3
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- run: *run_coveralls
Expand All @@ -138,8 +157,13 @@ jobs:
FFMPEG: "ffmpeg"
steps:
- checkout
- run: *setup_miniconda
- restore_cache:
keys:
- macos_py3
- run: *create_conda_env
- save_cache:
key: macos_py3
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- store_artifacts:
Expand All @@ -161,8 +185,13 @@ jobs:
COVERAGE_PKGS: "coverage coveralls"
steps:
- checkout
- run: *setup_miniconda
- restore_cache:
keys:
- macos_py3
- run: *create_conda_env
- save_cache:
key: macos_py3
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- run: *conda_upload
Expand Down