* Move the fast jobs with no dependencies to the first stage.
* Remove the global KTH-specific job runner tag from jobs in the pre-build stage.
* Use the `pre-build` stage as the dependency for all later stages, rather than the `simple-build` job, specifically.
* Convert rule sets to new *rules* syntax.
* Use '$CI_PROJECT_NAMESPACE == "gromacs"' to distinguish jobs created with access to GROMACS GitLab infrastructure.
Fixes #3458
- .docs:configure
- .rules:nightly-not-for-release
stage: nightly-configure
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
variables:
BUILD_DIR: build-package
CMAKE_SIMD_OPTIONS: -DGMX_SIMD=None
- .rules:nightly-not-for-release
stage: nightly-build
needs:
- - job: simple-build
- artifacts: false
- job: archive:configure:nightly
artifacts: true
variables:
- .rules:nightly-not-for-release
stage: nightly-deploy
needs:
- - job: simple-build
- artifacts: false
- job: linkchecker
artifacts: false
- job: webpage:build
extends:
- .docs:configure
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
variables:
BUILD_DIR: build-docs
CMAKE_EXTRA_OPTIONS: -DGMX_BUILD_HELP=on -DGMX_BUILD_MANUAL=on
- .rules:not-for-release
stage: documentation
needs:
- - job: simple-build
- artifacts: false
- job: docs:configure
artifacts: true
variables:
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
+# Jobs that run for merge requests and schedules, but not when GROMACS_RELEASE
+# is set. Includes non-gromacs projects. Note that jobs using this rule are
+# eligible to run on non-gromacs project infrastructure, and should therefore
+# override the default *tag* parameter to exclude tags specific to the GROMACS
+# GitLab Runner infrastructure. I.e. in the job definition, set `tags: []`
+.rules:basic:
+ rules:
+ - if: '$GROMACS_RELEASE'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "web"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "push"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: always
+
+# Jobs that run for merge requests and schedules, but not when GROMACS_RELEASE
+# is set. Excludes non-gromacs projects.
+.rules:not-for-release:
+ rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
+ - if: '$GROMACS_RELEASE'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "web"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "push"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: always
+
# Rule to run a job only in nightly release-preparation pipelines.
# Checks if the GROMACS_RELEASE variable was set (typically through the GitLab web interface).
-# Excludes merge_requests
+# Excludes merge_requests and non-gromacs projects.
# TODO: Update to *rules* syntax.
.rules:nightly-only-for-release:
- only:
- refs:
- - web
- - schedules
- variables:
- - $GROMACS_RELEASE
+ rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
+ - if: '$GROMACS_RELEASE && $CI_PIPELINE_SOURCE == "web"'
+ when: always
+ - if: '$GROMACS_RELEASE && $CI_PIPELINE_SOURCE == "schedule"'
+ when: always
# Jobs that run on schedules, but not for merge requests or when GROMACS_RELEASE
-# is set.
+# is set. Excludes non-gromacs projects.
.rules:nightly-not-for-release:
- only:
- - web
- - schedules
- except:
- variables:
- - $GROMACS_RELEASE
-
-# Jobs that run for merge requests and schedules, but not when GROMACS_RELEASE
-# is set.
-.rules:not-for-release:
- only:
- refs:
- - web
- - pushes
- - schedules
- - merge_requests
- except:
- variables:
- - $GROMACS_RELEASE
+ rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
+ - if: '$GROMACS_RELEASE'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule"'
+ when: always
# Behavioral templates
- .use-ccache
- .variables:default
- .use-gcc7
- - .rules:not-for-release
+ - .rules:basic
stage: pre-build
+ tags: []
variables:
KUBERNETES_CPU_LIMIT: 8
KUBERNETES_CPU_REQUEST: 4
- .gromacs:base:configure
- .use-gcc7
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
gromacs:gcc-7:release:configure:
extends:
- .gromacs:base:configure
- .use-gcc7
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
variables:
CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=SSE4.1"
- .gromacs:base:configure
- .use-gcc7
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
variables:
CMAKE_PRECISION_OPTIONS: -DGMX_DOUBLE=ON
- .gromacs:base:configure
- .use-gcc8
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
gromacs:gcc-8:release:configure:
extends:
variables:
CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
# TODO: Enable GMX_PYTHON_PACKAGE when dependencies are in Docker image.
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
# For version of clang before 7, we need to always provide the full version
# Use something like this instead in the download script:
- .gromacs:base:configure
- .use-clang6
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
variables:
COMPILER_MAJOR_VERSION: "6.0"
CMAKE_MPI_OPTIONS: -DGMX_OPENMP=OFF
- .gromacs:base:configure
- .use-clang7
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
gromacs:clang-7:release:configure:
extends:
- .gromacs:base:configure
- .use-clang8
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
gromacs:clang-8:release:configure:
extends:
- .use-gcc7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7:configure
artifacts: true
- .use-gcc7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7-simd-sse41:configure
artifacts: true
- .use-gcc7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7-double:configure
artifacts: true
- .use-gcc8
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-8:configure
artifacts: true
CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
# TODO: Enable GMX_PYTHON_PACKAGE when dependencies are in Docker image.
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-8-cuda-10.2:configure
artifacts: true
- .use-clang6
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-6:configure
artifacts: true
- .use-clang7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-7:configure
artifacts: true
- .use-clang8
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-8:configure
artifacts: true
- .use-gcc7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7:build
- job: regressiontests:prepare
- .use-gcc7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7-simd-sse41:build
- job: regressiontests:prepare
variables:
REGRESSIONTEST_DOUBLE: "-double"
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-7-double:build
- job: regressiontests:prepare
- .use-gcc8
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-8:build
- job: regressiontests:prepare
CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
# TODO: Enable GMX_PYTHON_PACKAGE when dependencies are in Docker image.
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:gcc-8-cuda-10.2:build
- job: regressiontests:prepare
variables:
REGRESSIONTEST_OMP_RANK_NUMBER: 0
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-6:build
- job: regressiontests:prepare
- .use-clang7
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-7:build
- job: regressiontests:prepare
- .use-clang8
- .rules:not-for-release
needs:
- - job: simple-build
- artifacts: false
- job: gromacs:clang-8:build
- job: regressiontests:prepare
- .gromacs:base:configure
- .use-clang7
- .rules:not-for-release
- needs:
- - job: simple-build
- artifacts: false
+ dependencies: []
variables:
BUILD_DIR: build-clang-tidy
CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON
- .rules:not-for-release
stage: source-check
needs:
- - job: simple-build
- artifacts: false
- job: clang-tidy:configure
artifacts: true
variables:
clang-format:
extends:
- - .gromacs:base:build
- .variables:default
- .use-clang7
- - .rules:not-for-release
+ - .rules:basic
cache: {}
- stage: source-check
- when: always
- needs:
- - job: simple-build
- artifacts: false
+ stage: pre-build
+ tags: []
variables:
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
copyright-check:
extends:
- - .gromacs:base:build
- .variables:default
- .use-clang7
- - .rules:not-for-release
+ - .rules:basic
cache: {}
- stage: source-check
- when: always
- needs:
- - job: simple-build
- artifacts: false
+ stage: pre-build
+ tags: []
variables:
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
cache: {}
stage: source-check
needs:
- - job: simple-build
- artifacts: false
- job: docs:build
artifacts: true
variables:
extends:
- .gmxapi-0.1:clang-8
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_1'
when: always
extends:
- .gmxapi-0.1:clang-8
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_1'
when: always
extends:
- .gmxapi-0.1:clang-8
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_1'
when: always
extends:
- .gmxapi-0.1:clang-8
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_1'
when: always
- .variables:default
- .use-clang8
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .gmxapi-0.2:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .gmxapi-0.2:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .gmxapi-0.2:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
- .sample_restraint:clang-8:gmx2020
# Run only for changes affecting the python_packaging subdirectory of the release-2020 branch.
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
- .sample_restraint:clang-8:gmx2020
# Run only for changes affecting the python_packaging subdirectory of the release-2020 branch.
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
- .sample_restraint:clang-8:gmx2020
# Run only for changes affecting the python_packaging subdirectory of the release-2020 branch.
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
- .sample_restraint:clang-8:gmx2020
# Run only for changes affecting the python_packaging subdirectory of the release-2020 branch.
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .sample_restraint:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .sample_restraint:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
extends:
- .sample_restraint:clang-8:gmx2021
rules:
+ - if: '$CI_PROJECT_NAMESPACE != "gromacs"'
+ when: never
# Allow explicit trigger through web interface.
- if: '$GMX_GMXAPI_0_2'
when: always
GitLab
======
-|Gromacs| is transitioning to GitLab for source code management, issue tracking,
-and integrated automation for testing and documentation.
-
The repository contains DockerFiles and GitLab Runner configuration
files to support automated testing and documentation builds.
General information on configuring GitLab CI pipelines can be found
:file:`admin/ci-templates/` directory.
Docker images used by GitLab Runner are available on `Docker Hub <https://hub.docker.com/u/gromacs>`__.
-Images are (re)built manually from DockerFiles in :file:`admin/dockerfiles`.
+Images are (re)built manually using details in :file:`admin/containers`.
This documentation is incomplete, pending resolution of :issue:`3275`.
.. todo:: Comment on the number of pipelines that can be or which are likely to be running at the same time.
+.. note::
+
+ Full automated testing is only available for merge requests originating from
+ branches of the main https://gitlab.com/gromacs/gromacs repository.
+ GitLab CI pipelines created for forked repositories will include fewer jobs
+ in the testing pipeline. Non-trivial merge requests may need to be issued
+ from a branch in the ``gromacs`` project namespace in order to receive
+ sufficient testing before acceptance.
+
Configuration files
~~~~~~~~~~~~~~~~~~~
To reduce errors and unexpected behavior, restrict usage of these controls
to regular job definitions (don't use in "hidden" or parent jobs).
+ tags
+ By `default <https://docs.gitlab.com/ee/ci/yaml/#setting-default-parameters>`__,
+ 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.
+
variables
Many job definitions will add or override keys in *variables*.
Refer to `GitLab <https://docs.gitlab.com/ee/ci/yaml/#variables>`__
Other important variable keys are as follows.
.. glossary::
+ CI_PROJECT_NAMESPACE
+ Distinguishes pipelines created for repositories in the ``gromacs``
+ GitLab project space. May be used to pre-screen jobs to determine
+ whether |Gromacs| GitLab infrastructure is available to the pipeline
+ before the job is created.
+
COMPILER_MAJOR_VERSION
Integer version number provided by toolchain mix-in for convenience and
internal use.