How to I use TRExFitter image in Gitlab CI?

When I try to use the trexfitter image in gitlab CI/CD, the CI job always fails with the error

sh: 3: set: Illegal option -o pipefail

The full output from the CI job is here:

I think this may have to do with this image using the dash shell instead of bash, but I don’t know how to fix it in a CI job


@jhaley The GitLab repository is private and so not viewable (I’m getting a 404). Can you share the contents of the .gitlab-ci.yml or at least the relevant sections of it?

Ah, sorry about that. Here is the current version of.gitlab-ci

 GIT_SUBMODULE_STRATEGY: recursive # Now TRExFitter and its submodules will be cloned in the CI job

  - greeting
  - dockerimage
  - prepare_trex_input
  - run_trex
hello world:
  stage: greeting
    - echo "Hello World"
    - find . -path ./.git -prune -o -print

make docker image:
  stage: dockerimage
    entrypoint: [""]
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context "${CI_PROJECT_DIR}"
                       --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
                       --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"
prepare input for trex:
  stage: prepare_trex_input
  image: atlas/analysisbase:21.2.186 #ATLAS analysisbase image
    - echo $SERVICE_PASS | kinit $CERN_USER
    - . /
    - echo $PWD
    - python ci_test_input.txt 10 a 50
    - ls -l Fit

run trex:
  stage: run_trex
  allow_failure: true
    - echo $PWD
    - cd /
    - echo $PWD
    - trex-fitter h /workdir/analysis/Fit/TRexConfig.rex
    - trex-fitter d /workdir/analysis/Fit/TRexConfig.rex
    - trex-fitter w /workdir/analysis/Fit/TRexConfig.rex
    - ls -l BoostedAllhadronicVLQAnalysisRECASTFit

And here is the full ci output from the run_tex stage:

[1]Running with gitlab-runner 14.4.0 (4b9e985a)

[2]( on default-runner-58cd994587-rzw5x SPD8yozD


[4]( secrets00:00

[6]( the "docker" executor00:20

[7]( Docker executor with image ...

[8]( with credentials from job payload (GitLab Registry)

[9]( docker image ...

[10]( docker image sha256:524facfb322c0ca67385aa9d46958434326f3c546736c74cd7ba734684e25cd5 for with digest ...

[11]( using umask - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR is set!

[13]( environment00:03

[14]( on runner-spd8yozd-project-116797-concurrent-0 via default-runner-58cd994587-rzw5x...

[16]( source from Git repository00:04

[17]( changes with git depth set to 50...

[18]( empty Git repository in /builds/sasingh/all-hadronic-vlq-t_ht/.git/

[19]( fresh repository.

[20]( out 719be236 as RECAST-docker...

[21]( submodules recursively with git depth set to 50...

[23]( "step_script" stage of the job script00:01

[24]( docker image sha256:524facfb322c0ca67385aa9d46958434326f3c546736c74cd7ba734684e25cd5 for with digest ...

[25]( 3: set: Illegal option -o pipefail

[27]( up project directory and file based variables00:01

[29]( Job failed: exit code 2

This is a known GitLab bug, that they don’t treat as such. (c.f. Run your CI/CD jobs in Docker containers | GitLab).

The fix is just to override entrypoint everywhere you use a custom image with [""]. e.g.:

    entrypoint: [""]

That did it. Thank you!