Versions Compared

Key

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


Info
titleShort info

This chapter will show you how you can test the latest version of the codes as if it were run directly on the Gateway using Gateway runner

Table of Contents

How to use Gateway runner?

Set up of simple CI/CD

  1. Log in to gitlab.eufus.psnc.pl
  2. On the top bar, select Menu > Projects and find your project
  3. Press "+" button and select New File
  4. File must be in root of your repository and be called .gitlab-ci.yml (mind the '.' at the beginning of the file name)
  5. Prepare content for CI / CD purposes - you can use simple example below as a template

    Code Block
    title.gitlab-ci.yml
    linenumberstrue
    stages:
      - Test IMAS
    
    Test IMAS environment:
      stage: Test IMAS
      tags:
        - HPC
      before_script:
        - eval `/usr/bin/modulecmd bash load cineca`
        - eval `/usr/bin/modulecmd bash load imasenv`
        - mkdir test-database
        - imasdb `pwd`/test-database
        # a hack to allow installing imasdb in custom folder (non ~/public)
        - export ids_path="`pwd`/test-database;$ids_path"
      script:
        - python3 ids_put.py
        - python3 ids_get.py
      after_script:
        - rm -rf `pwd`/test-database
        - eval `/usr/bin/modulecmd bash purge`


    Tip
    titleSetting custom location of MDSPlus database

    There is a hack to allow installing imasdb in custom folder (non ~/public):

    Code Block
     
    - imasdb `pwd`/test-
    database 
    database




  6. Complete each section. Remember that each project has different requirements, so the commands must be adapted to your code.
    1. tags - The tag indicates whether the task is to be performed by HPC or Docker.
      Use HPC in this example. Using Docker is described here 

      Info

      Our GitLab's CI/CD is using HPC on Gateway. This means that the script commands will be called and run like on Gateway


    2. before_script - is used to define the command that should be run before all builds, including deploy builds
    3. script - defines a shell script which is executed by Runner
    4. after_script is used to define the command that will be run after for builds
  7. At the end press Commit changes
    Image Added

How to check my CI/CD tasks?

...

On the left sidebar, select CI/CD > Pipelines

...

A list of tasks with their statuses will be displayed (passed or failed).
Click on your task status for details
Image Removed

...

Please visit this page