You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

1. How to use Gateway runner?

1.1. 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
  5. Prepare content for CI / CD purposes - you can use simple example below as a template

    .gitlab-ci.yml
    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`

    There is a hack to allow installing imasdb in custom folder (non ~/public):
     - imasdb `pwd`/test-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 

      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

1.2. How to check my CI/CD tasks?

  1. On the top bar, select Menu > Projects and find your project
  2. On the left sidebar, select CI/CD > Pipelines

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

  4. Check pipline details - press title of test 
  5. You can examine step by step your CI/CD task and in case of failure you can learn why it did fail
  • No labels