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

Enable CI for Santis using cscs-ci #1047

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pipeline {
source $WORKSPACE/etc/profile.d/uenv.sh
source ./setup-env.sh /user-environment
source .venv/bin/activate
uenv run mch/v8:rc4 -- pytest -v -n auto test/system_test.py
uenv run mch/v8:rc4 -- pytest -v -n auto test/common_system_test.py test/balfrin_system_test.py
"""
}
}
Expand Down
75 changes: 75 additions & 0 deletions cscs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'

variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive


.setup_python:
script:
- python3 -m venv .venv
- source .venv/bin/activate
- pip install -r requirements.txt
- source .venv/bin/activate

.bootstrap_spack:
script:
- source ./setup-env.sh
- spack spec gnuconfig

.setup_spack:
script:
- source ./setup-env.sh /user-environment

.setup_uenv:
script:
- uenv image pull ${UENV}


Unit Test:
extends: .baremetal-runner-santis-gh200
script:
- !reference [.setup_python, script]
- python3 test/unit_test.py

.test_common:
extends: .baremetal-runner-santis-gh200
variables:
UENV: 'icon/25.2:v1'
script:
- !reference [.setup_python, script]
- !reference [.setup_uenv, script]
- !reference [.bootstrap_spack, script]
- !reference [.setup_spack, script]
- uenv run ${UENV} -- pytest -v -n auto ${TEST}
artifacts:
paths:
- log/**/*
when: always

Integration Test:
extends: .test_common
variables:
TEST: test/integration_test.py

System Test:
extends: .test_common
variables:
TEST: test/common_system_test.py test/santis_system_test.py

Summarize Logs:
extends: .container-runner-lightweight-zen2
image: python:3.9
script:
- !reference [.setup_python, script]
- mkdir -p log
- python3 tools/summarize_logs.py || true
when: always
needs:
- Integration Test
- System Test
artifacts:
paths:
- log/**/*
when: always
5 changes: 4 additions & 1 deletion docs/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ This is a common way to do it.
Pull Request Testing for spack-c2sm on GitHub
---------------------------------------------

To test a PR, create a comment ``launch jenkins``.
To test a PR, create a comment ``launch jenkins``. This will trigger a Jenkins job that will test the PR.
To test on Alps (Santis) create an additional comment ``cscs-ci run santis``.


Supported machines:

* balfrin
* santis

Jenkins test with uenv
----------------------
Expand Down
74 changes: 6 additions & 68 deletions test/system_test.py → test/balfrin_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,6 @@
from spack_commands import spack_install


def test_install_clang_format():
spack_install('clang-format')


def test_install_cosmo_eccodes_definitions():
spack_install('cosmo-eccodes-definitions')


def test_install_ecbuild():
# Tests are disabled because they fail with:
# The following tests FAILED:
# 1 - ECBUILD-359 (Failed)
# 2 - ECBUILD-401 (Failed)
# 8 - ECBUILD-511 (Failed)
# 11 - bundle-subdir-std (Failed)
# 12 - bundle-subdir-ecbfind (Failed)
# 17 - test_ecbuild_find_package (Failed)
spack_install('ecbuild @3.7.2', test_root=False)


def test_install_flexpart_cosmo():
spack_install('flexpart-cosmo')


def test_install_flexpart_ifs():
spack_install('flexpart-ifs')


@pytest.mark.parametrize('version',
['2024.01-1', '2.6.6-mch2a', '2.6.6-mch2b'])
def test_install_icon(version):
Expand Down Expand Up @@ -62,28 +34,6 @@ def test_install_libgrib1_nvhpc():
spack_install('libgrib1 %nvhpc')


def test_install_makedepf90():
# Tests are disabled because they fail with:
# test1.sh: No such file or directory
spack_install('makedepf90', test_root=False)


def test_install_py_cytoolz():
spack_install('py-cytoolz')


def test_install_py_devtools():
spack_install('py-devtools')


def test_install_py_factory_boy():
spack_install('py-factory-boy')


def test_install_py_gridtools_cpp():
spack_install('py-gridtools-cpp')


@pytest.mark.parametrize("version", ['1.0.3.9'])
def test_install_py_gt4py_for_version(version):
spack_install(f'py-gt4py @{version}')
Expand All @@ -104,25 +54,13 @@ def test_install_py_icon4py(version, gt4py_version):
spack_install(f'py-icon4py@{version} ^py-gt4py@{gt4py_version}')


def test_install_py_hatchling():
spack_install('py-hatchling')


def test_install_py_inflection():
spack_install('py-inflection')


def test_install_py_pytest_factoryboy():
spack_install('py-pytest-factoryboy')


def test_install_py_tabulate():
spack_install('py-tabulate')
def test_install_yaxt():
spack_install('yaxt')


def test_install_py_typing_extensions():
spack_install('py-typing-extensions')
def test_install_flexpart_cosmo():
spack_install('flexpart-cosmo')


def test_install_yaxt():
spack_install('yaxt')
def test_install_flexpart_ifs():
spack_install('flexpart-ifs')
64 changes: 64 additions & 0 deletions test/common_system_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import pytest
from spack_commands import spack_install


def test_install_clang_format():
spack_install('clang-format')


def test_install_cosmo_eccodes_definitions():
spack_install('cosmo-eccodes-definitions')


def test_install_ecbuild():
# Tests are disabled because they fail with:
# The following tests FAILED:
# 1 - ECBUILD-359 (Failed)
# 2 - ECBUILD-401 (Failed)
# 8 - ECBUILD-511 (Failed)
# 11 - bundle-subdir-std (Failed)
# 12 - bundle-subdir-ecbfind (Failed)
# 17 - test_ecbuild_find_package (Failed)
spack_install('ecbuild @3.7.2', test_root=False)


def test_install_makedepf90():
# Tests are disabled because they fail with:
# test1.sh: No such file or directory
spack_install('makedepf90', test_root=False)


def test_install_py_cytoolz():
spack_install('py-cytoolz')


def test_install_py_devtools():
spack_install('py-devtools')


def test_install_py_factory_boy():
spack_install('py-factory-boy')


def test_install_py_gridtools_cpp():
spack_install('py-gridtools-cpp')


def test_install_py_hatchling():
spack_install('py-hatchling')


def test_install_py_inflection():
spack_install('py-inflection')


def test_install_py_pytest_factoryboy():
spack_install('py-pytest-factoryboy')


def test_install_py_tabulate():
spack_install('py-tabulate')


def test_install_py_typing_extensions():
spack_install('py-typing-extensions')
6 changes: 6 additions & 0 deletions test/santis_system_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest
from spack_commands import spack_install


def test_install_py_tabulate_0_8_10():
spack_install('[email protected]')