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

updating config.yml #647

Merged
merged 18 commits into from
Oct 31, 2020
Prev Previous commit
Next Next commit
debug upload
  • Loading branch information
Muryanto committed Oct 30, 2020
commit 08e1c5807b3ef7891331a2e8f8fb6c8522466222
52 changes: 21 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
version: 2.1

parameters:
label:
type: string
default: "nightly"

aliases:
- &setup_env
name: setup_env
Expand All @@ -21,7 +16,6 @@ aliases:
name: setup_miniconda
command: |
source $BASH_ENV
mkdir -p $WORKDIR
git clone https://github.com/CDAT/cdat.git $WORKDIR/cdat
# install_miniconda.py installs miniconda3 under $WORKDIR/miniconda
python $WORKDIR/cdat/scripts/install_miniconda.py -w $WORKDIR -p 'py3'
Expand All @@ -32,7 +26,7 @@ aliases:
source $BASH_ENV
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
make conda-rerender workdir=$WORKDIR branch=$CIRCLE_BRANCH
make conda-rerender workdir=$WORKDIR conda_build_env=base branch=$CIRCLE_BRANCH

- &conda_build
name: conda_build
Expand All @@ -42,9 +36,7 @@ aliases:
conda activate base
os=`uname`
artifacts_dir="artifacts/artifacts.${os}.noarch"
make conda-build workdir=$WORKDIR artifact_dir=$PWD/$artifacts_dir
echo "XXX artifacts_dir: $PWD/${artifacts_dir}"
ls -l ${PWD}/${artifacts_dir}
make conda-build workdir=$WORKDIR conda_build_env=base artifact_dir=$PWD/$artifacts_dir

- &setup_run_tests
name: setup_run_tests
Expand All @@ -71,10 +63,7 @@ aliases:
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
UPLOAD_OPTIONS="conda_upload_token=$CONDA_UPLOAD_TOKEN"
echo "XXX artifacts_dir: $PWD/artifacts/*Linux*/"
ls -l $PWD/artifacts/*Linux*/
make conda-upload workdir=$WORKDIR $UPLOAD_OPTIONS artifact_dir="$PWD/artifacts/*Linux*/"
no_output_timeout: 5m

- &run_coveralls
name: run_coveralls
Expand Down Expand Up @@ -129,19 +118,22 @@ jobs:
- run: echo "LIBNETCDF=$LIBNETCDF" >> $BASH_ENV
- run: *setup_env
- run: *setup_run_tests
- run: *get_testdata
- run: *run_tests
- run: *make_doc_test
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png
- store_artifacts:
path: spec_artifacts
destination: spec_artifacts

upload:
machine:
image: circleci/classic:latest
environment:
LABEL: << pipeline.parameters.label >>
steps:
- checkout
- attach_workspace:
Expand All @@ -158,22 +150,20 @@ workflows:
# os: [ linux, macos ]
os: [ linux ]
name: build-<< matrix.os >>
## - test:
## matrix:
## parameters:
## os: [ linux ]
# py_ver: [ "3.6", "3.7", "3.8"]
## py_ver: [ "3.6"]
# libnetcdf: [ "nompi", "mpi_mpich", "mpi_openmpi" ]
## libnetcdf: [ "nompi" ]
## name: test-<< matrix.os >>-<< matrix.py_ver >>-<< matrix.libnetcdf >>
## requires:
## - build-<< matrix.os >>

- test:
matrix:
parameters:
# os: [ linux, macos ]
os: [ linux ]
# py_ver: [ "3.6", "3.7", "3.8" ]
py_ver: [ "3.6" ]
# libnetcdf: [ "nompi", "mpi_openmpi" ]
libnetcdf: [ "nompi" ]
# libnetcdf: [ "nompi", "mpi_mpich", "mpi_openmpi" ]
name: test-<< matrix.os >>-<< matrix.py_ver >>-<< matrix.libnetcdf >>
requires:
- build-<< matrix.os >>
- upload:
requires:
- build
# filters:
# branches:
# only: master
- test

59 changes: 30 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,34 @@ extra_channels ?= pcmdi/label/nightly pcmdi cdat/label/nightly conda-forge
conda ?= $(or $(CONDA_EXE),$(shell find /opt/*conda*/bin $(HOME)/*conda*/bin -type f -iname conda))
conda_env_filename ?= spec-file

ifeq ($(workdir),)
# Only populate if workdir is not defined
ifeq ($(origin workdir),undefined)
# Create .tempdir if it doesn't exist
ifeq ($(wildcard $(PWD)/.tempdir),)
workdir = $(shell mktemp -d -t "build_$(pkg_name).XXXXXXXX")
workdir := $(shell mktemp -d -t "build_$(pkg_name).XXXXXXXX")
$(shell echo $(workdir) > $(PWD)/.tempdir)
endif

# Read tempdir
workdir := $(shell cat $(PWD)/.tempdir)
endif

# Only populate if workdir is not defined
ifeq ($(origin workdir),undefined)
# Create .tempdir if it doesn't exist
ifeq ($(wildcard $(PWD)/.tempdir),)
workdir := $(shell mktemp -d -t "build_$(pkg_name).XXXXXXXX")
$(shell echo $(workdir) > $(PWD)/.tempdir)
endif

# Read tempdir
workdir := $(shell cat $(PWD)/.tempdir)
endif

$(info $(workdir))

artifact_dir ?= $(PWD)/artifacts

ifeq ($(coverage),1)
coverage_opt = -c tests/coverage.json --coverage-from-egg
endif

conda_recipes_branch ?= master

conda_base = $(patsubst %/bin/conda,%,$(conda))
Expand All @@ -60,6 +71,10 @@ ifndef $(local_repo)
local_repo = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
endif

help: ## Prints help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

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

Expand All @@ -73,40 +88,22 @@ else
cd $(workdir)/conda-recipes; git pull
endif

clean:
rm -rf $(shell cat .tempdir)

rm -f .tempdir

setup-tests:
source $(conda_activate) base; conda create -y -n $(conda_test_env) \
$(or $(if $(findstring $(conda_build_env),base),—use-local,),-c file:https://$(conda_base)/envs/$(conda_build_env)/conda-bld) \
source $(conda_activate) base; conda create -y -n $(conda_test_env) --use-local \
$(foreach x,$(extra_channels),-c $(x)) $(pkg_name) $(foreach x,$(test_pkgs),"$(x)") \
$(foreach x,$(extra_pkgs),"$(x)") $(foreach x,$(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_build_env) --ignore_conda_missmatch \
--conda_activate $(conda_activate) --organization $(organization)

conda-local-rerender: setup-build
python $(workdir)/$(build_script) -w $(workdir) -l $(last_stable) -B 0 -p $(pkg_name) \
-b $(branch) --do_rerender --conda_env $(conda_build_env) --ignore_conda_missmatch \
--conda_activate $(conda_activate) --organization $(organization) --local_repo=$(local_repo)
--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_build_env) --extra_channels $(extra_channels) \
--conda_activate $(conda_activate) $(conda_build_extra)

conda-local-build:
mkdir -p $(artifact_dir)

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

conda-upload:
source $(conda_activate) $(conda_build_env); \
Expand All @@ -118,7 +115,11 @@ conda-dump-env:
source $(conda_activate) $(conda_test_env); conda list --explicit > $(artifact_dir)/$(conda_env_filename).txt

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

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

run-coveralls:
source $(conda_activate) $(conda_test_env); coveralls;