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

Add makefile #446

Merged
merged 37 commits into from
Jul 4, 2020
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6e55488
adding Jason Boutte's Makefile and README.md
LinaMuryanto Jun 1, 2020
7348995
Fixes makefile to search /opt and /home/titters for conda binary
jasonb5 Jun 1, 2020
2511245
Updates makefile to continue using conda-recipes to build package
jasonb5 Jun 3, 2020
17acf83
Removes dependencies for run-tests to facilitate ci task structure.
jasonb5 Jun 3, 2020
76cf8e7
Updates Makefile
jasonb5 Jun 3, 2020
5f4ce9e
Updates circleci to use makefile
jasonb5 Jun 3, 2020
dd674a9
Fixes passing conda binary path to makefile
jasonb5 Jun 3, 2020
961a952
Fixes passing conda activate script to conda-recipes
jasonb5 Jun 3, 2020
c052916
Fixes passing workdir when copying output package
jasonb5 Jun 3, 2020
7f3c4e2
Fixes output conda package
jasonb5 Jun 3, 2020
5adf880
Fixes creating artifact dir
jasonb5 Jun 3, 2020
3898b01
Fixes spelling error
jasonb5 Jun 3, 2020
99492f0
Fixes quoting packages to handle versioning
jasonb5 Jun 3, 2020
9d5eca1
Fixes storing package artifacts
jasonb5 Jun 3, 2020
7cd33cd
updated git_url in recipe/meta.yaml.in to use https://
LinaMuryanto Jun 4, 2020
9295661
remplaced git://github.com/CDAT/uvcdat-testdata with https://github.c…
LinaMuryanto Jun 4, 2020
ad74301
Updates conda-build target to use --loca_repo flag
jasonb5 Jun 5, 2020
4b0c58e
Fixes always copying build output to artifact directory
jasonb5 Jun 15, 2020
d230df4
Adds debug for conda_upload
jasonb5 Jun 15, 2020
3174579
Fixes conda-upload to upload everything in the artifact directory
jasonb5 Jun 15, 2020
17d6c2d
use circleci 2.1 matrix
LinaMuryanto Jun 24, 2020
fa76740
use circleci 2.1 matrix
LinaMuryanto Jun 24, 2020
d9dbb48
use TAB in Makefile
LinaMuryanto Jun 24, 2020
02bcbe6
debug Makefile
LinaMuryanto Jun 24, 2020
d4377ce
debug Makefile
LinaMuryanto Jun 24, 2020
9244a72
skip mpich as it leads to cdms2.open() segfault
LinaMuryanto Jun 24, 2020
46692f2
temporarily run just one tests -- debug upload
LinaMuryanto Jun 24, 2020
ce8777a
fixed worflow name
LinaMuryanto Jun 24, 2020
3ef8dea
removed installing anaconda-client
LinaMuryanto Jun 24, 2020
68347d9
removed installing anaconda-client
LinaMuryanto Jun 24, 2020
bc73c7b
debug upload
LinaMuryanto Jun 25, 2020
27ec60c
updated docs/rtd_environment.yml -- will need to update when we relea…
LinaMuryanto Jun 29, 2020
24505d5
rerun all configs --
LinaMuryanto Jun 29, 2020
9d2805e
skip running tests with libnetcdf mpi_mpich variant -- cdms2.open() s…
LinaMuryanto Jun 30, 2020
62d71b1
upload only from 'master' branch and use 'master' branch of conda-rec…
LinaMuryanto Jul 1, 2020
2b36593
use 'master' branch of cdat/cdat as 'validateNightlyNew' branch has b…
LinaMuryanto Jul 3, 2020
4d6db55
skip running with libnetcdf mpi_mpich -- causing segfault in cdms2.op…
LinaMuryanto Jul 3, 2020
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
105 changes: 65 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,18 @@ aliases:
- &conda_rerender
name: conda_rerender
command: |
git clone https://github.com/CDAT/conda-recipes.git $WORKDIR/conda-recipes
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
conda config --set anaconda_upload no
BUILD_SCRIPT="$WORKDIR/conda-recipes/build_tools/conda_build.py"
python $BUILD_SCRIPT -w $WORKDIR -l $LAST_STABLE -B 0 -p $PKG_NAME -b $CIRCLE_BRANCH --do_rerender

make conda-rerender conda=$WORKDIR/miniconda/bin/conda workdir=$WORKDIR last_stable=$LAST_STABLE branch=$CIRCLE_BRANCH

- &conda_build
name: conda_build
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
conda config --add channels conda-forge --force
conda config --add channels cdat/label/nightly --force
conda config --set channel_priority strict
BUILD_SCRIPT="$WORKDIR/conda-recipes/build_tools/conda_build.py"
python $BUILD_SCRIPT -w $WORKDIR -p $PKG_NAME --build_version $BUILD_VARIANT_VER --do_build

make conda-build conda=$WORKDIR/miniconda/bin/conda workdir=$WORKDIR artifcat_dir=$PWD/artifacts copy_conda_package=1
muryanto1 marked this conversation as resolved.
Show resolved Hide resolved

- &setup_run_tests
name: setup_run_tests
Expand All @@ -41,40 +36,31 @@ aliases:
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
if [[ `uname` == "Linux" ]]; then
MESA="mesalib=18.3.1"
else
MESA="mesalib=17.3.9"
fi
echo "conda create -y -n $ENV_NAME --use-local $CHANNELS \"$CONDA_PY_VER\" $PKG_NAME $MESA $PKGS $DOC_PKGS $COVERAGE_PKGS \"$LIBNETCDF\""
conda create -y -n $ENV_NAME --use-local $CHANNELS "$CONDA_PY_VER" $PKG_NAME $MESA $PKGS $DOC_PKGS $COVERAGE_PKGS "$LIBNETCDF"
conda activate $ENV_NAME
conda config --set always_yes yes
conda install -c conda-forge nb_conda nb_conda_kernels
conda list

make setup-tests conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME extra_pkgs="$CONDA_PY_VER $LIBNETCDF"

make conda-dump-env conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME artifcat_dir=$PWD/artifacts conda_env_name=$CIRCLE_JOB
muryanto1 marked this conversation as resolved.
Show resolved Hide resolved

- &get_testdata
name: get_testdata
command: |
git clone git://github.com/cdat/uvcdat-testdata
make get-testdata conda=$WORKDIR/miniconda/bin/conda

- &run_tests
name: run_tests
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate $ENV_NAME
python run_tests.py -n 4 -H -v2 --timeout=100000 --checkout-baseline --no-vtk-ui $COVERAGE
RESULT=$?
conda deactivate
exit $RESULT
conda activate base

make run-tests conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME

- &conda_env_export
name: conda_env_expprt
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate $ENV_NAME
conda env export > $WORKDIR/env.yml
cat $WORKDIR/env.yml
conda activate base

make conda-list conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME
muryanto1 marked this conversation as resolved.
Show resolved Hide resolved

- &conda_upload
name: conda_upload
Expand All @@ -84,27 +70,24 @@ aliases:
fi
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
UPLOAD_OPTIONS="-t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL"
anaconda $UPLOAD_OPTIONS $WORKDIR/miniconda/conda-bld/noarch/$PKG_NAME-$VERSION.`date +%Y*`0.tar.bz2 --force

make conda-upload conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME conda_upload_token=$CONDA_UPLOAD_TOKEN user=$USER label=$LABEL

- &run_coveralls
name: run_coveralls
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate $ENV_NAME
coveralls
conda deactivate
conda activate base

make run-coveralls conda=$WORKDIR/miniconda/bin/conda

- &make_doc_test
name: make_doc_test
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate $ENV_NAME
cd docs
make doctest
DOC_RESULT=$?
echo "*** $PY_VER doc test result: "${DOC_RESULT}
exit $DOC_RESULT
conda activate base

make run-doc-test conda=$WORKDIR/miniconda/bin/conda conda_env=$ENV_NAME
no_output_timeout: 20m


Expand All @@ -123,6 +106,8 @@ jobs:
- run: *setup_miniconda
- run: *conda_rerender
- run: *conda_build
- store_artifacts:
path: artifacts
- persist_to_workspace:
root: .
paths:
Expand All @@ -142,6 +127,8 @@ jobs:
- run: *setup_miniconda
- run: *conda_rerender
- run: *conda_build
- store_artifacts:
path: artifacts
- persist_to_workspace:
root: .
paths:
Expand All @@ -164,6 +151,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *get_testdata
- run: *run_tests
- store_artifacts:
Expand All @@ -187,6 +176,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *get_testdata
- run: *run_tests
- store_artifacts:
Expand All @@ -210,6 +201,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *get_testdata
- run: *run_tests
- store_artifacts:
Expand All @@ -233,6 +226,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -259,6 +254,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -285,6 +282,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand Down Expand Up @@ -312,6 +311,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -336,6 +337,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -360,6 +363,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -384,6 +389,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -408,6 +415,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -433,6 +442,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand Down Expand Up @@ -460,6 +471,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -484,6 +497,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -508,6 +523,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -532,6 +549,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -556,6 +575,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand All @@ -581,6 +602,8 @@ jobs:
- attach_workspace:
at: .
- run: *setup_run_tests
- store_artifacts:
path: artifacts
- run: *conda_env_export
- run: *get_testdata
- run: *run_tests
Expand Down Expand Up @@ -621,6 +644,8 @@ jobs:
- run: *conda_upload

workflows:
# Might be work looking into matrix to simplify, if we can use version 2.1.
# https://circleci.com/docs/2.0/configuration-reference/#matrix-requires-version-21
version: 2
vcs:
jobs:
Expand Down
93 changes: 93 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
.PHONY: conda-info conda-list setup-build setup-tests conda-rerender \
conda-build conda-upload conda-dump-env conda-cp-output get_testdata \
run-tests run-doc-tests run-coveralls

SHELL = /bin/bash

os = $(shell uname)
pkg_name = vcs
build_script = conda-recipes/build_tools/conda_build.py

test_pkgs = udunits2 testsrunner matplotlib image-compare nbformat ipywidgets \
nb_conda nb_conda_kernels coverage coveralls
docs_pkgs = sphinxcontrib-websupport nbsphinx jupyter_client jupyterlab vcsaddons
ifeq ($(os),Linux)
pkgs = "mesalib=18.3.1"
else
pkgs = "mesalib=17.3.9"
endif

conda_env ?= base
workdir ?= $(PWD)/workspace
last_stable ?= 8.2
branch ?= $(shell git rev-parse --abbrev-ref HEAD)
extra_channels ?= cdat/label/nightly conda-forge
conda ?= $(or $(CONDA_EXE),$(shell find /opt/*conda*/bin $(HOME)/*conda* -type f -iname conda))
artifact_dir ?= $(PWD)/artifacts
conda_env_filename ?= spec-file
# TODO change back to master
conda_recipes_branch ?= build_tool_update

conda_base = $(patsubst %/bin/conda,%,$(conda))
conda_activate = $(conda_base)/bin/activate

ifneq ($(copy_conda_package),)
conda_build_extra = --copy_conda_package $(artifact_dir)/
endif

conda-info:
source $(conda_activate) $(conda_env); conda info

conda-list:
source $(conda_activate) $(conda_env); conda list

setup-build:
ifeq ($(wildcard $(workdir)/conda-recipes),)
git clone -b $(conda_recipes_branch) https://github.com/CDAT/conda-recipes $(workdir)/conda-recipes
else
cd $(workdir)/conda-recipes; git pull
endif

setup-tests:
source $(conda_activate) base; conda create -y -n $(conda_env) --use-local \
$(foreach x,$(extra_channels),-c $(x)) $(pkg_name) $(foreach x,$(test_pkgs),"$(x)") \
$(foreach x,$(docs_pkgs),"$(x)") $(foreach x,$(pkgs),"$(x)") $(foreach x,$(extra_pkgs),"$(x)")

conda-rerender: setup-build
python $(workdir)/$(build_script) -w $(workdir) -l $(last_stable) -B 0 -p $(pkg_name) \
-b $(branch) --do_rerender --conda_env $(conda_env) --ignore_conda_missmatch \
--conda_activate $(conda_activate)

conda-build:
mkdir -p $(artifact_dir)

python $(workdir)/$(build_script) -w $(workdir) -p $(pkg_name) --build_version noarch \
--do_build --conda_env $(conda_env) --extra_channels $(extra_channels) \
--conda_activate $(conda_activate) $(conda_build_extra)

conda-upload:
source $(conda_activate) $(conda_env); \
output=$$(conda build --output $(workdir)/vcs); \
anaconda -t $(conda_upload_token) upload -u $(user) -l $(label) $${output} --force

conda-dump-env:
mkdir -p $(artifact_dir)

source $(conda_activate) $(conda_env); conda list --explicit > $(artifact_dir)/$(conda_env_filename).txt

get-testdata:
ifeq ($(wildcard uvcdat-testdata),)
git clone https://github.com/CDAT/uvcdat-testdata
else
cd uvcdat-testdata; git pull
endif

run-tests:
Copy link
Member

Choose a reason for hiding this comment

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

is it possible for 'make run-tests' to return the value returned my "python run_tests.py..."? In circleci, when I run the workflow, if any test failed, I want to exit the circleci workflow.
In nightly test runs though (another circleci workflow), I ran test suites of all projects, if any test suite fail, I want to keep on running the project's test suite. I.e. in this case I will just ignore the exit value of 'make run-tests'.

source $(conda_activate) $(conda_env); python run_tests.py -n 4 -H -v2 --timeout=100000 \
--checkout-baseline --no-vtk-ui

run-doc-test:
source $(conda_activate) $(conda_env); cd docs; make doctest;

run-coveralls:
source $(conda_activate) $(conda_env); coveralls;
Loading