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 with write permissions, which is only available for JSC users and partners. 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 access 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_jureca_login:
  id_tokens:
    SITE_ID_TOKEN:
      aud: "https://gitlab.jsc.fz-juelich.de"
  stage: build
  tags:
    - jureca
    - jacamar
    - login
    - shell
  script:
    - echo $SYSTEMNAME
  after_script:
    - hostname
    - id
job_jureca_compute:
  id_tokens:
    SITE_ID_TOKEN:
      aud: "https://gitlab.jsc.fz-juelich.de"
  stage: execute
  tags:
    - jureca
    - 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.
Note
Updating GitLab to version 16.5+, any job run by Jacamar CI will no longer function without the user providing the id_tokens in their respective job. For more information, please check Migrating to new id_tokens from CI_JOB_JWT.
The following table contains description for some of the keys used in the previous example:
| Key | description | 
|---|---|
| SCHEDULER_PARAMETERS | SCHEDULER_PARAMETERSmaps tosbatch / salloccommand linearguments, more details about slurm options can be found in Summary of sbatch and srun Options. When using Jacamar Slurm runners, SCHEDULER_PARAMETERSshould be defined under thevariablessection to set job parameters.  --accountor-Aparameters 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_DIRkey can be defined under thevariablessection to define a preferred path. | 
| script | scriptis 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_scriptkey can be used to define some actions to be done afterall the commands defined in the  scriptsection are executed. It isnoteworthy to mention that the steps defined in the  after_scriptrunon 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.