Jacamar CI Runners
Jacamar CI is an open source project designed to be a bridge between traditional GitLab CI pipelines and HPC resources. More information about jacamar can be found in:
Getting Access
To utilize GitLab runners on JSC HPC systems, it’s necessary to have access to JSC GitLab. Within JSC GitLab, Jacamar CI runners are set up as shared runners, accessible from any project created on JSC GitLab. Additionally, employing the Jacamar runners necessitates acess to the HPC systems where the CI jobs are intended to execute.
Jacamar employs an authentication mechanism that relies on the alignment of usernames between GitLab and HPC systems. Consequently, only JSC GitLab is suitable for initiating CI Jobs on JSC systems. Also, any endeavors to execute CI jobs on systems that users lack access to will be unsuccessful.
Jacamar Example .gitlab-ci.yml
File
To use Jacamar runners, the CI piplines should be defined in a .gitlab-ci.yml
file in a Gitlab project. The following is a simple example for a .gitlab-ci.yml
file:
variables: SCHEDULER_PARAMETERS: '-Aslurm_account -N2 --cpus-per-task 1' CUSTOM_CI_BUILDS_DIR: /path/to/preferred/dir stages: - build - execute job_jusuf_login: stage: build tags: - jusuf - jacamar - login - shell script: - echo $SYSTEMNAME after_script: - hostname - id job_jusuf_compute: stage: execute tags: - jusuf - jacamar - compute - slurm artifacts: paths: - test.file script: - echo $SYSTEMNAME - touch test.file after_script: - hostname - id
Note
The example above showcases the use of both types of Jacamar runners in two separate stages. This example is meant to cover a range of scenarios, however different use cases would require different setups.
The following table contains description for some of the keys used in the previous example:
Key |
description |
---|---|
SCHEDULER_PARAMETERS |
SCHEDULER_PARAMETERS maps to sbatch / salloc command linearguments, more details about slurm options can be found in
Summary of sbatch and srun Options. When using Jacamar Slurm runners,
SCHEDULER_PARAMETERS should be defined under the variables section to set job parameters.
--account or -A parameters mustbe set so the slurm job submitted through the CI Job would use
the correct Slurm account.
|
CUSTOM_CI_BUILDS_DIR |
By default, the output files from the jobs executed by Jacamar runners
would be placed in the home directory, which has limited space available
To select a different path to store the output files,
CUSTOM_CI_BUILDS_DIR key can be defined under the variables section to define a preferred path.
|
script |
script is the key where the commands to be executed in a Jacamar CIjob are defined. This applies to both Jacamar Slurm and Shell CI jobs.
|
after_script |
after_script key can be used to define some actions to be done afterall the commands defined in the
script section are executed. It isnoteworthy to mention that the steps defined in the
after_script runon the login nodes, even if slurm runners are being used. This can be
used to clean up directories, or move files after the job is done.
|
Further information on how to write a .gitlab-ci.yml
script can be found in the GitLab CI/CD documentation.