-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
caching setup env to speed up things (#606)
* caching setup env to speed up things * using nightly so we can have py37
- Loading branch information
1 parent
ef54524
commit c74a639
Showing
1 changed file
with
53 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,55 +17,64 @@ aliases: | |
name: create_conda_env | ||
environment: | ||
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" | ||
CHANNELS: "-c cdat/label/nightly -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/label/nightly -c conda-forge -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 | ||
|
@@ -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 | ||
|
@@ -93,8 +102,13 @@ jobs: | |
FFMPEG: "'ffmpeg>4' 'libpng>1.6.34'" | ||
steps: | ||
- checkout | ||
- run: *setup_miniconda | ||
- restore_cache: | ||
keys: | ||
- macos_py2_2019-05-30 | ||
- run: *create_conda_env | ||
- save_cache: | ||
key: macos_py2_2019-05-30 | ||
paths: /Users/distiller/miniconda | ||
- run: *setup_pmp | ||
- run: *run_pmp_tests | ||
- store_artifacts: | ||
|
@@ -116,8 +130,13 @@ jobs: | |
COVERAGE_PKGS: "coverage coveralls" | ||
steps: | ||
- checkout | ||
- run: *setup_miniconda | ||
- restore_cache: | ||
keys: | ||
- macos_py3_2019-05-30 | ||
- run: *create_conda_env | ||
- save_cache: | ||
key: macos_py3_2019-05-30 | ||
paths: /Users/distiller/miniconda | ||
- run: *setup_pmp | ||
- run: *run_pmp_tests | ||
- run: *run_coveralls | ||
|
@@ -138,8 +157,13 @@ jobs: | |
FFMPEG: "ffmpeg" | ||
steps: | ||
- checkout | ||
- run: *setup_miniconda | ||
- restore_cache: | ||
keys: | ||
- linux_py2_2019-05-30 | ||
- run: *create_conda_env | ||
- save_cache: | ||
key: linux_py2_2019-05-30 | ||
paths: /Users/distiller/miniconda | ||
- run: *setup_pmp | ||
- run: *run_pmp_tests | ||
- store_artifacts: | ||
|
@@ -161,8 +185,13 @@ jobs: | |
COVERAGE_PKGS: "coverage coveralls" | ||
steps: | ||
- checkout | ||
- run: *setup_miniconda | ||
- restore_cache: | ||
keys: | ||
- linux_py3_2019-05-30 | ||
- run: *create_conda_env | ||
- save_cache: | ||
key: linux_py3_2019-05-30 | ||
paths: /Users/distiller/miniconda | ||
- run: *setup_pmp | ||
- run: *run_pmp_tests | ||
- run: *conda_upload | ||
|