Skip to content

Commit

Permalink
Streamline CI (#344)
Browse files Browse the repository at this point in the history
Added default and benchmark CI pipelines.
  • Loading branch information
samkellerhals authored Jan 8, 2024
1 parent d0c6cc3 commit c879a10
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 117 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/mandatory_and_optional_test_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ jobs:
Please make sure you run these tests via comment before you merge!
* `cscs-ci run`
* `cscs-ci run default`
* `launch jenkins spack`
**Optional Tests**
To run benchmarks you can use:
* `cscs-ci run benchmark`
In case your change might affect downstream [icon-exclaim](https://github.com/C2SM/icon-exclaim), please consider running
* `launch jenkins icon`
Expand Down
45 changes: 45 additions & 0 deletions ci/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'

stages:
- build
- test
- benchmark

.py310: &py310
PYVERSION_PREFIX: py310
PYVERSION: 3.10.9

variables:
PYTHON_VERSION: "3.10"
PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/icon4py:$CI_COMMIT_SHORT_SHA

.build_template:
stage: build
extends: .container-builder
variables:
DOCKERFILE: ci/docker/Dockerfile.build
DOCKER_BUILD_ARGS: '["PYVERSION=$PYVERSION"]'
<<: *py310

.test_template:
extends: .container-runner-daint-gpu
timeout: 8h
image: $PERSIST_IMAGE_NAME
before_script:
- apt-get update
- python3 -m pip install --upgrade pip setuptools wheel
- cd /icon4py
- pyversion_no_dot="${PYTHON_VERSION//./}"
- pip install tox clang-format
- python -c "import cupy"
- ls ${TEST_DATA_PATH}
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
SLURM_TIMELIMIT: '06:00:00'
CRAY_CUDA_MPS: 1
NUM_PROCESSES: auto
VIRTUALENV_SYSTEM_SITE_PACKAGES: 1
CSCS_NEEDED_DATA: icon4py
TEST_DATA_PATH: "/apps/daint/UES/jenkssl/ciext/icon4py"
18 changes: 18 additions & 0 deletions ci/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include:
- local: 'ci/base.yml'

variables:
DACE_VERSION: "0.14.4"

build:
extends: .build_template

benchmark_model_icon_grid:
extends: .test_template
stage: benchmark
script:
- if [ "$BACKEND" = "dace_cpu" ] || [ "$BACKEND" = "dace_gpu" ]; then pip install dace==$DACE_VERSION; fi
- tox -r -e run_benchmarks -c model/ -- --backend=$BACKEND --grid=icon_grid --disable-warnings
parallel:
matrix:
- BACKEND: [dace_cpu, gtfn_cpu, gtfn_gpu]
127 changes: 11 additions & 116 deletions ci/default.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,20 @@
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
- local: 'ci/base.yml'

stages:
- build
- test
- benchmark

.py310: &py310
PYVERSION_PREFIX: py310
PYVERSION: 3.10.9

variables:
DACE_VERSION: "0.15.1"
PERSIST_IMAGE_NAME: $CSCS_REGISTRY_PATH/icon4py:$CI_COMMIT_SHORT_SHA
PYTHON_VERSION: "3.10"

.build_template:
stage: build
extends: .container-builder
variables:
DOCKERFILE: ci/docker/Dockerfile.build
DOCKER_BUILD_ARGS: '["PYVERSION=$PYVERSION"]'
<<: *py310

.test_template:
extends: .container-runner-daint-gpu
timeout: 8h
image: $PERSIST_IMAGE_NAME
before_script:
- apt-get update
- python3 -m pip install --upgrade pip setuptools wheel
- cd /icon4py
- pyversion_no_dot="${PYTHON_VERSION//./}"
- pip install tox clang-format
- python -c "import cupy"
- ls ${SERIALIZED_DATA_PATH}
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
SLURM_TIMELIMIT: '06:00:00'
CRAY_CUDA_MPS: 1
NUM_PROCESSES: auto
VIRTUALENV_SYSTEM_SITE_PACKAGES: 1
CSCS_NEEDED_DATA: icon4py
TEST_DATA_PATH: "/apps/daint/UES/jenkssl/ciext/icon4py"

build_job:
build:
extends: .build_template

test_model_job_roundtrip_simple_grid:
extends: .test_template
stage: test
script:
- tox -r -e run_stencil_tests -c model/ --verbose

test_model_job_dace_cpu_simple_grid:
extends: .test_template
stage: test
script:
- pip install dace==$DACE_VERSION
- tox -r -e run_stencil_tests -c model/ --verbose -- --backend=dace_cpu
only:
- main
allow_failure: true

test_model_job_dace_gpu_simple_grid:
extends: .test_template
stage: test
script:
- pip install dace==$DACE_VERSION
- tox -r -e run_stencil_tests -c model/ --verbose -- --backend=dace_gpu
only:
- main
allow_failure: true

test_model_job_gtfn_cpu_simple_grid:
extends: .test_template
stage: test
script:
- tox -r -e run_stencil_tests -c model/ --verbose -- --backend=gtfn_cpu

test_model_job_gtfn_gpu_simple_grid:
extends: .test_template
stage: test
script:
- tox -r -e run_stencil_tests -c model/ --verbose -- --backend=gtfn_gpu
test_model_simple_grid:
extends: .test_template
stage: test
script:
- tox -r -e run_stencil_tests -c model/ --verbose -- --backend=$BACKEND
parallel:
matrix:
- BACKEND: [gtfn_cpu, gtfn_gpu, roundtrip]

test_tools_job:
test_tools:
extends: .test_template
stage: test
script:
- tox -r -c tools/ --verbose

benchmark_model_dace_cpu_icon_grid:
extends: .test_template
stage: benchmark
script:
- pip install dace==$DACE_VERSION
- tox -r -e run_benchmarks -c model/ -- --backend=dace_cpu --grid=icon_grid
only:
- main
when: manual

benchmark_model_dace_gpu_icon_grid:
extends: .test_template
stage: benchmark
script:
- pip install dace==$DACE_VERSION
- tox -r -e run_benchmarks -c model/ -- --backend=dace_gpu --grid=icon_grid
only:
- main
when: manual

benchmark_model_gtfn_cpu_icon_grid:
extends: .test_template
stage: benchmark
script:
- tox -r -e run_benchmarks -c model/ -- --backend=gtfn_cpu --grid=icon_grid

benchmark_model_gtfn_gpu_icon_grid:
extends: .test_template
stage: benchmark
script:
- tox -r -e run_benchmarks -c model/ -- --backend=gtfn_gpu --grid=icon_grid

0 comments on commit c879a10

Please sign in to comment.