variables:
  GIT_SUBMODULE_STRATEGY: recursive


powercap-measurement:
  variables:
    CUSTOM_CI_BUILDS_DIR: /p/scratch/cjsc/badwaik1.exacb/job/$CI_JOB_ID
  id_tokens:
    SITE_ID_TOKEN:
      aud: "https://gitlab.jsc.fz-juelich.de"
  artifacts:
    paths:
      - benchmark.csv
  tags:
    - jedi
    - jacamar
    - login
    - shell
  script:
    - module load JUBE
    - export JUBE_INCLUDE_PATH=$PWD/jube
    - |
      jutil env activate \
        --project cjsc \
        --budget zam 
    - jube-autorun -r "-e --outpath ../outpath" benchmark.yml
    - jube result --style csv ../outpath > benchmark.csv


powercap-plotting:
  image: registry.jsc.fz-juelich.de/exacb/docker/report:latest
  tags:
    - docker
  needs:
    - job: powercap-measurement
      artifacts: true
  artifacts:
    paths:
      - benchmark.pdf
  script:
    - python -m venv venv
    - source venv/bin/activate
    - pip install matplotlib
    - python post/plotting.py --input benchmark.csv --output benchmark.pdf --powercap 300