Skip to content

Add ubt cluster to your ci pipeline

In case you want to check if your project could build or used with the tools our clusters provide follow these instructions.

Currently for festus only!

Adding Group runner

Because we don’t provide individual runner-nodes (virtual) for every single Project of your group we recommend to setup a runner for your group.

First head to group you want to add a runner to:

Bildschirmfoto_login_gitlab.png

Choose the group; in this example “Keylab HPC”:

Bildschirmfoto gruppenwahl

On NavBar choose “Build”->”Runners” :

Bildschirmfoto_runnerwahl_gitlab.png

Then add new runner by click “New group runner”: runner neu

Add a suitable Tag to identify cluster-specific ci jobs and click “Create runner”: Bildschirmfoto_runnersetup_gitlab.png

After you created the runner please pass the generated token to hpc staff: Bildschirmfoto_runner_token_gitlab.png

We will then setup a virtual node and register the runner.

Adding cluster to pipeline

When a runner is registered on our cluster you could add it to your pipeline.

Lets go trough an simple example step by step.

In the following example we will build a pipeline to check if your code works with your “favourite” gnu-compiler and or intel-module.

Lets start with this simple C Code four our example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#include <stdio.h>

int main() {
#ifdef __INTEL_LLVM_COMPILER
    printf("Intel llvm compiler used...\n");
#elif defined(__GNUC__) 
    printf("Gnu compiler used...\n");
#endif
    return 0;
}
In our sample-project this is placed in src/compiler_check.c .

If you haven’t already add a “.gitlab-ci.yml” to your project. First job we will add to this is the jobs that uses the intel or gnu module (on festus) to compile our simple code.

build-job-intel:
  stage: build
  tags:
    - festus_keylab_tests
  script:
    - module load OneAPI_2024.2.1
    - icx src/compiler_check.c -o compiler_check.icx
  artifacts:
    paths:
      - compiler_check.icx
build-job-gnu:
  stage: build
  tags:
    - festus_keylab_tests
  script:
    - module load gnu/14.1
    - gcc src/compiler_check.c -o compiler_check.gcc    
  artifacts:
    paths:
      - compiler_check.gcc

Important is that you use the right tag to ensure the wanted runner is used. Then we just pass script commands to build our simple code. The artifacts:-part ensures that the newly build executable stays available for the next stage.

For the test-stage we only try to run the executables:

test-gnu:
  stage: test
  tags:
    - festus_keylab_tests
  script:
    - module load gnu/14.1
    - ./compiler_check.gcc
test-icx:
  stage: test
  tags:
    - festus_keylab_tests
  script:
    - module load OneAPI_2024.2.1
    - ./compiler_check.icx

When your next commit is done your project runs trough the pipeline stages:

Bildschirmfoto_ci_pipeline.png

Bildschirmfoto_ci_pipeline_exec.png