From beaf7d5660dac96989200d361ee190478129a852 Mon Sep 17 00:00:00 2001 From: "M. Eric Irrgang" Date: Tue, 12 May 2020 14:20:41 +0000 Subject: [PATCH] Refine usage of *job:tags* parameter. Try to prevent jobs from getting stuck when they should be runnable in GitLab forks or in the Gromacs CI environment when the Shared Runners are turned off. --- .gitlab-ci.yml | 4 -- admin/gitlab-ci/archive.gitlab-ci.yml | 4 -- admin/gitlab-ci/documentation.gitlab-ci.yml | 11 ++-- admin/gitlab-ci/gromacs.gitlab-ci.yml | 52 ++++++++++++++++--- admin/gitlab-ci/lint.gitlab-ci.yml | 6 --- admin/gitlab-ci/python-gmxapi.gitlab-ci.yml | 6 +++ .../sample_restraint-regression.gitlab-ci.yml | 3 ++ .../gitlab-ci/sample_restraint.gitlab-ci.yml | 3 ++ docs/dev-manual/gitlab.rst | 15 ++++-- 9 files changed, 73 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60dd3c5c6a..99f0d28057 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,10 +37,6 @@ stages: # Deploy stage for release builds - release-deploy -default: - tags: - - k8s-scilifelab - include: # Mix-in helper job definitions of general utility. - local: '/admin/gitlab-ci/global.gitlab-ci.yml' diff --git a/admin/gitlab-ci/archive.gitlab-ci.yml b/admin/gitlab-ci/archive.gitlab-ci.yml index 4c69403641..cac89d8b98 100644 --- a/admin/gitlab-ci/archive.gitlab-ci.yml +++ b/admin/gitlab-ci/archive.gitlab-ci.yml @@ -9,14 +9,12 @@ prepare-release-version: # TODO: Get DockerFile for admin/dockerfiles image: biophysics/gcc-gromacs stage: configure-build - variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi script: - cmake -P cmake/gmxVersionInfo.cmake &> version.json - artifacts: paths: - version.json @@ -31,7 +29,6 @@ regressiontests:prepare: cache: {} image: biophysics/gcc-gromacs stage: configure-build - variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 @@ -67,7 +64,6 @@ regressiontests:package: # TODO: Get DockerFile for admin/dockerfiles image: biophysics/gcc-gromacs stage: release-package - variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 diff --git a/admin/gitlab-ci/documentation.gitlab-ci.yml b/admin/gitlab-ci/documentation.gitlab-ci.yml index 2a2e5bf369..35a8235b56 100644 --- a/admin/gitlab-ci/documentation.gitlab-ci.yml +++ b/admin/gitlab-ci/documentation.gitlab-ci.yml @@ -178,7 +178,6 @@ docs:configure: extends: - .docs:configure - .rules:basic-push - tags: [] variables: BUILD_DIR: build-docs CMAKE_EXTRA_OPTIONS: -DGMX_BUILD_HELP=on -DGMX_BUILD_MANUAL=on @@ -206,7 +205,6 @@ docs:build: - .before_script:default - .rules:basic-push stage: documentation - tags: [] needs: - job: docs:configure variables: @@ -263,7 +261,6 @@ webpage:build: - .webpage:build - .rules:basic-push stage: post-test - tags: [] needs: - job: docs:build - job: check-source @@ -276,6 +273,8 @@ webpage:configure: - .docs:configure:release - .rules:nightly-only-for-release cache: {} + tags: + - k8s-scilifelab dependencies: - archive:package - regressiontests:package @@ -293,6 +292,8 @@ webpage:dependencies: - .before_script:default - .rules:nightly-only-for-release stage: release-build + tags: + - k8s-scilifelab needs: - job: webpage:configure variables: @@ -302,9 +303,11 @@ webpage:build:release: extends: - .webpage:build - .rules:nightly-only-for-release + stage: release-prepare-deploy + tags: + - k8s-scilifelab dependencies: - webpage:dependencies - webpage:configure - stage: release-prepare-deploy variables: BUILD_DIR: release-doc-builds diff --git a/admin/gitlab-ci/gromacs.gitlab-ci.yml b/admin/gitlab-ci/gromacs.gitlab-ci.yml index 5e919e1738..baf9fc3dc9 100644 --- a/admin/gitlab-ci/gromacs.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.gitlab-ci.yml @@ -9,7 +9,6 @@ simple-build: - .rules:basic-push stage: pre-build image: gromacs/cmake-3.15.7-llvm-9-openmpi:master - tags: [] variables: KUBERNETES_CPU_LIMIT: 8 KUBERNETES_CPU_REQUEST: 4 @@ -259,7 +258,7 @@ gromacs:clang-8:configure: variables: COMPILER_MAJOR_VERSION: 8 -gromacs:clang-9:configure: +gromacs:clang-9-mpi:configure: extends: - .gromacs:base:configure - .use-clang:base @@ -431,6 +430,8 @@ gromacs:clang-ASAN:build: - .use-ccache - .rules:merge-requests image: gromacs/cmake-3.13.0-llvm-8-tsan:master + tags: + - k8s-scilifelab needs: - job: gromacs:clang-ASAN:configure @@ -442,6 +443,8 @@ gromacs:clang-static-analyzer:build: - .use-ccache - .rules:merge-requests image: gromacs/cmake-3.13.0-llvm-8-tsan:master + tags: + - k8s-scilifelab needs: - job: gromacs:clang-static-analyzer:configure @@ -456,7 +459,7 @@ gromacs:clang-8:build: needs: - job: gromacs:clang-8:configure -gromacs:clang-9:build: +gromacs:clang-9-mpi:build: extends: - .variables:default - .gromacs:base:build @@ -465,7 +468,7 @@ gromacs:clang-9:build: - .rules:merge-requests image: gromacs/cmake-3.15.7-llvm-9-openmpi:master needs: - - job: gromacs:clang-9:configure + - job: gromacs:clang-9-mpi:configure gromacs:gcc-8-cuda-10.1:release:build: extends: @@ -595,6 +598,8 @@ gromacs:gcc-7:test: variables: KUBERNETES_EXTENDED_RESOURCE_NAME: "amd.com/gpu" KUBERNETES_EXTENDED_RESOURCE_LIMIT: 1 + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-7:build @@ -606,6 +611,8 @@ gromacs:gcc-8-cuda-10.1:test: variables: KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu" KUBERNETES_EXTENDED_RESOURCE_LIMIT: 1 + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-8-cuda-10.1:build @@ -633,16 +640,20 @@ gromacs:clang-ASAN:test: image: gromacs/cmake-3.13.0-llvm-8-tsan:master variables: CTEST_RUN_MODE: "ExperimentalMemCheck" + tags: + - k8s-scilifelab needs: - job: gromacs:clang-ASAN:build -gromacs:clang-9:test: +gromacs:clang-9-mpi:test: extends: - .gromacs:base:test - .rules:merge-requests image: gromacs/cmake-3.15.7-llvm-9-openmpi:master + tags: + - k8s-scilifelab needs: - - job: gromacs:clang-9:build + - job: gromacs:clang-9-mpi:build gromacs:gcc-7:regressiontest: extends: @@ -655,6 +666,8 @@ gromacs:gcc-7:regressiontest: REGRESSIONTEST_PME_RANK_NUMBER: 0 REGRESSIONTEST_TOTAL_RANK_NUMBER: 2 REGRESSIONTEST_OMP_RANK_NUMBER: 1 + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-7:build - job: regressiontests:prepare @@ -670,6 +683,8 @@ gromacs:gcc-8-cuda-10.1:regressiontest: REGRESSIONTEST_PME_RANK_NUMBER: 0 REGRESSIONTEST_TOTAL_RANK_NUMBER: 2 REGRESSIONTEST_OMP_RANK_NUMBER: 1 + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-8-cuda-10.1:build - job: regressiontests:prepare @@ -679,6 +694,8 @@ gromacs:clang-8:regressiontest: - .gromacs:base:regressiontest - .rules:merge-requests image: gromacs/cmake-3.15.7-llvm-8-intelopencl-openmpi:2020 + tags: + - k8s-scilifelab needs: - job: gromacs:clang-8:build - job: regressiontests:prepare @@ -688,6 +705,8 @@ gromacs:clang-TSAN:regressiontest: - .gromacs:base:regressiontest - .rules:merge-requests image: gromacs/cmake-3.13.0-llvm-8-tsan:master + tags: + - k8s-scilifelab needs: - job: gromacs:clang-TSAN:build - job: regressiontests:prepare @@ -698,6 +717,8 @@ gromacs:clang-ASAN:regressiontest: - .use-clang:base - .rules:merge-requests image: gromacs/cmake-3.13.0-llvm-8-tsan:master + tags: + - k8s-scilifelab needs: - job: gromacs:clang-ASAN:build - job: regressiontests:prepare @@ -710,8 +731,10 @@ gromacs:clang-9:regressiontest: variables: REGRESSIONTEST_DOUBLE: "-double" REGRESSIONTEST_PARALLEL: "-np" + tags: + - k8s-scilifelab needs: - - job: gromacs:clang-9:build + - job: gromacs:clang-9-mpi:build - job: regressiontests:prepare gromacs:gcc-8-cuda-10.1:release:test: @@ -721,7 +744,11 @@ gromacs:gcc-8-cuda-10.1:release:test: stage: release-tests image: gromacs/cmake-3.15.7-gcc-8-cuda-10.1-nvidiaopencl-clfft-openmpi:master variables: + KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu" + KUBERNETES_EXTENDED_RESOURCE_LIMIT: 1 BUILD_DIR: release-builds-gcc + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-8-cuda-10.1:release:configure - job: gromacs:gcc-8-cuda-10.1:release:build @@ -757,7 +784,11 @@ gromacs:clang-8-cuda-10.1:release:test: stage: release-tests image: gromacs/cmake-3.15.7-llvm-8-cuda-10.1-openmpi:master variables: + KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu" + KUBERNETES_EXTENDED_RESOURCE_LIMIT: 1 BUILD_DIR: release-builds-clang + tags: + - k8s-scilifelab needs: - job: gromacs:clang-8-cuda-10.1:release:configure - job: gromacs:clang-8-cuda-10.1:release:build @@ -770,6 +801,8 @@ gromacs:gcc-7:release:regressiontest: image: gromacs/cmake-3.13.0-gcc-7-amdopencl-clfft-openmpi:master variables: BUILD_DIR: release-builds-gcc + tags: + - k8s-scilifelab needs: - job: gromacs:gcc-7:release:build - job: regressiontests:package @@ -784,6 +817,8 @@ gromacs:clang-9:release:regressiontest: BUILD_DIR: release-builds-clang REGRESSIONTEST_DOUBLE: "-double" REGRESSIONTEST_PARALLEL: "-np" + tags: + - k8s-scilifelab needs: - job: gromacs:clang-9:release:build - job: regressiontests:package @@ -801,7 +836,8 @@ gromacs:clang-8-cuda-10.1:release:regressiontest: REGRESSIONTEST_PME_RANK_NUMBER: 0 REGRESSIONTEST_TOTAL_RANK_NUMBER: 2 REGRESSIONTEST_OMP_RANK_NUMBER: 1 - + tags: + - k8s-scilifelab needs: - job: gromacs:clang-8-cuda-10.1:release:build - job: regressiontests:package diff --git a/admin/gitlab-ci/lint.gitlab-ci.yml b/admin/gitlab-ci/lint.gitlab-ci.yml index 2d56adecc3..b0a7be87b6 100644 --- a/admin/gitlab-ci/lint.gitlab-ci.yml +++ b/admin/gitlab-ci/lint.gitlab-ci.yml @@ -6,7 +6,6 @@ clang-tidy:configure-push: - .use-clang:base - .rules:basic-push image: gromacs/cmake-3.15.7-llvm-9-openmpi:master - tags: [] variables: COMPILER_MAJOR_VERSION: 9 BUILD_DIR: build-clang-tidy @@ -18,7 +17,6 @@ clang-tidy:configure-schedule: - .use-clang:base - .rules:nightly-not-for-release image: gromacs/cmake-3.15.7-llvm-9-openmpi:master - tags: [] variables: COMPILER_MAJOR_VERSION: 9 BUILD_DIR: build-clang-tidy @@ -44,7 +42,6 @@ clang-tidy:test: - .rules:basic-push stage: source-check image: gromacs/cmake-3.15.7-llvm-9-openmpi:master - tags: [] needs: - job: clang-tidy:configure-push variables: @@ -79,7 +76,6 @@ clang-format: cache: {} stage: pre-build image: gromacs/ci-docs-llvm:master - tags: [] variables: COMPILER_MAJOR_VERSION: 7 KUBERNETES_CPU_LIMIT: 1 @@ -111,7 +107,6 @@ copyright-check: cache: {} stage: pre-build image: gromacs/ci-docs-llvm:master - tags: [] variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 @@ -147,7 +142,6 @@ check-source: - .rules:basic-push cache: {} stage: source-check - tags: [] needs: - job: docs:build artifacts: true diff --git a/admin/gitlab-ci/python-gmxapi.gitlab-ci.yml b/admin/gitlab-ci/python-gmxapi.gitlab-ci.yml index 4d51fe5935..c0467fe6d9 100644 --- a/admin/gitlab-ci/python-gmxapi.gitlab-ci.yml +++ b/admin/gitlab-ci/python-gmxapi.gitlab-ci.yml @@ -27,6 +27,9 @@ - $PY_MPI_ACCEPTANCE_TEST_XML when: always expire_in: 1 week + tags: + - k8s-scilifelab + # The dependency means we need to use the same tag restriction as upstream. needs: - job: gromacs:clang-8:build artifacts: true @@ -79,6 +82,9 @@ gmxapi-0.1:clang-8:py-3.8.2: - $PY_MPI_ACCEPTANCE_TEST_XML when: always expire_in: 1 week + tags: + - k8s-scilifelab + # The dependency means we need to use the same tag restriction as upstream. needs: - job: gromacs:clang-8:build artifacts: true diff --git a/admin/gitlab-ci/sample_restraint-regression.gitlab-ci.yml b/admin/gitlab-ci/sample_restraint-regression.gitlab-ci.yml index 2b6885eb4d..c1727331ef 100644 --- a/admin/gitlab-ci/sample_restraint-regression.gitlab-ci.yml +++ b/admin/gitlab-ci/sample_restraint-regression.gitlab-ci.yml @@ -21,6 +21,9 @@ - $PLUGIN_MPI_TEST_XML when: always expire_in: 1 week + tags: + - k8s-scilifelab + # The dependency means we need to use the same tag restriction as upstream. needs: # Note: if we want to run regression tests using artifacts from the `release-2020` # pipelines, we could specify *project* and *ref*, but initially we are only diff --git a/admin/gitlab-ci/sample_restraint.gitlab-ci.yml b/admin/gitlab-ci/sample_restraint.gitlab-ci.yml index f4909bc61d..94bae22feb 100644 --- a/admin/gitlab-ci/sample_restraint.gitlab-ci.yml +++ b/admin/gitlab-ci/sample_restraint.gitlab-ci.yml @@ -19,6 +19,9 @@ - $PLUGIN_MPI_TEST_XML when: always expire_in: 1 week + tags: + - k8s-scilifelab + # The dependency means we need to use the same tag restriction as upstream. needs: - job: gromacs:clang-8:build artifacts: true diff --git a/docs/dev-manual/gitlab.rst b/docs/dev-manual/gitlab.rst index 8964a4b81c..51852c3f4f 100644 --- a/docs/dev-manual/gitlab.rst +++ b/docs/dev-manual/gitlab.rst @@ -91,11 +91,16 @@ GitLab CI job parameters, but note the following GROMACS-specific conventions. to regular job definitions (don't use in "hidden" or parent jobs). tags - By `default `__, - jobs require the ``k8s-scilifelab`` tag, which identifies Runners in the - |Gromacs| infrastructure. A small number of jobs in the first pipeline - stage override the default with an empty tag list so that all GitLab - users can run basic tests in their forked project. + Jobs that can only run in the |Gromacs| GitLab CI Runner infrastructure + should require the ``k8s-scilifelab`` tag. + These include jobs that specify Kubernetes configuration variables or + require special facilities, such as GPUs or MPI. + Note that the *tag* controls which Runners are eligible to take a job. + It does not affect whether the job is eligible for addition to a particular pipeline. + Additional *rules* logic should be used to make sure that jobs with the + ``k8s-scilifelab`` do not become eligible for pipelines launched outside + of the |Gromacs| project environment. + See, for instance, :term:`CI_PROJECT_NAMESPACE` variables Many job definitions will add or override keys in *variables*. -- 2.22.0