Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Log in to one of the cluster frontends and create a new folder for the CI (preferably on the parallel file system). Change into the created directory. This folder will - at the end of this guide - contain all required configuration files.

A good location is a subdirectory in the directory project path assigned to your project in /scratch/.... For example:

Path

Comment

/scratch/.../ci

CI Configuration files

/scratch/.../ci/data

CI Data files

1. Setup Environment with Modules

...

Code Block
/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin/jacamar

2.

...

We need to create a configuration for Jacamar CI. Create a new file named jacamar-config.toml and insert the following content

Code Block
[general]
executor = "slurm"
data_dir = "/scratch/PATH/TO/WORK/DIR/.../data"

You may adjust the path to the data directory accordingly. Note, that this data will only be temporal for the execution of a job. However, keep in mind the specified path should be accessible from all compute nodes.

...

Registration of GitLab Runner

Now we need to setup CI/CD in your Gitlab project. Go to the settings of your project on Gitlab and enable the feature CI/CD in the General section under Visibility, project features, permissions.
In the now appearing CI/CD section (under Settings), go to Runners. There you will find a two step setup guide to connect a new runner to your project under the Specific Runner headingproject by clicking on New project runner.

To execute these two steps run register the new runner and generate a new configuration file execute the Gitlab runner on Noctua inside your CI Configuration directory:

Code Block
gitlab-runner register --config=jacamar-config.toml

Follow the steps. Enter the instance URL and registration token from the GitLab page. If you are asked for the executor type, choose custom.

Afterwards, the file jacamar-config.toml was created.

...

3. Make GitLab Runner use Jacamar CI

Now we need to configure the GitLab runner to use our custom executor jacamar we configured in step 2.

Therefore, edit the configuration file gcijacamar-config.toml.

Below First add the following lines to the top of the file:

Code Block
[general]
executor = "slurm"
data_dir = "/scratch/PATH/TO/WORK/DIR/.../data"

You may adjust the path to the data directory accordingly. Note, that this data will only be temporal for the execution of a job. However, keep in mind the specified path should be accessible from all compute nodes.

Inside your runners definition, add the two following lines

Code Block
pre_get_clonesources_script="module reset"

This will load the default modules of Noctua including Slurm, which is required for the custom executor.

...

Code Block
[runners.custom]
config_exec_timeout = 3600 
config_exec = "/opt/software/pc2/EB-SW/software/jacamar/latest/bin/jacamar"
config_args = ["--no-auth", "config", "--configuration", "/scratch/PATH/TO/WORK/DIR/jacamar-config.toml"]
prepare_exec = "/opt/software/pc2/EB-SW/software/jacamar/latest/bin/jacamar"
prepare_args = ["--no-auth", "prepare"]
run_exec = "/opt/software/pc2/EB-SW/software/jacamar/latest/bin/jacamar"
run_args = ["run", "--no-auth", "run"]
cleanup_exec = "/opt/software/pc2/EB-SW/software/jacamar/latest/bin/jacamar"
cleanup_args = ["--no-auth", "cleanup", "--configuration", "/scratch/PATH/TO/WORK/DIR/jacamar-config.toml"]

...

Code Block
[general]
executor = "slurm"
data_dir = "/scratch/PATH/TO/WORK/DIR/.../data"

concurrent = 1
check_interval = 0
shutdown_timeout = 0

[session_server]
session_timeout = 1800

[[runners]]
name = "Jacamar Test Runner"
url = "https://git.uni-paderborn.de/"
token = "TOKEN"
executor = "custom"
environment = ["PATH=/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin:/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"]
pre_get_clonesources_script="module reset"
[runners.custom_build_dircache]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]  MaxUploadedArchiveSize = 0
[runners.custom]
config_exec_timeout = 3600 
config_exec = "/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin/jacamar"
config_args = ["config","--no-auth", "--configuration", "/scratch/PATH/TO/WORK/DIR/jacamar-config.toml"]
prepare_exec = "/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin/jacamar"
prepare_args = ["prepare", "--no-auth"]
run_exec = "/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin/jacamar"
run_args = ["--no-auth", "run"]
cleanup_exec = "/opt/software/pc2/EB-SW/software/gitlab-runner/latest/bin/jacamar"
cleanup_args = ["cleanup", "--no-auth", "--configuration", "/scratch/PATH/TO/WORK/DIR/jacamar-config.toml"]

You may want to increase the value of concurrent to allow the GitLab runner to schedule multiple jobs at once. That's it. Now

To test the GitLab runner, execute it with the jacamar configuration:

Code Block
languagebash
gitlab-runner run --config=jacamar-config.toml

In the runners list of your repository (Settings -> CI/CD -> Runners) you will find the status of your runner under Assigned project runners.

As long as your GitLab runner is executed on Noctua, it will process the CI jobs from your project.

4. Add CI file to repository

To run a CI job, you only need to create a .gitlab-ci.yml file in your project and commit it to GitLab. GitLab will use your new runner for the jobs.

...