GitLab Runner 15.7 home dir changed to /home/gitlab-runner/.gitlab-runner/
Summary
Podman Runner deployed with image ubi-fips-v15.7.1
and the command
podman run -d --privileged --security-opt label=disable --name ubi-fips --restart always -v /run/podman/podman.sock:/run/podman/podman.sock -v /srv/gitlab-runner/config/config.toml/:/etc/gitlab-runner/config.toml gitlab/gitlab-runner:ubi-fips-v15.7.1
returns error in the container logs:
ERROR: Failed to load config stat /home/gitlab-runner/.gitlab-runner/config.toml: no such file or directory builds=0
In version 15.6.1 this is different and the runner is using /etc/gitlab-runner/config.toml
for the configuration.
Steps to reproduce
-
Run 15.6.1 with the following command and observe that the runner is looking for
/etc/gitlab-runner/config.toml
configpodman run -d --privileged --security-opt label=disable --name ubi-fips --restart always -v /run/podman/podman.sock:/run/podman/podman.sock -v /srv/gitlab-runner/config/config.toml/:/etc/gitlab-runner/config.toml gitlab/gitlab-runner:ubi-fips-v15.6.1
-
Run 15.7.1 with the following command and observe that the runner is looking for
/home/gitlab-runner/.gitlab-runner/config.toml
configpodman run -d --privileged --security-opt label=disable --name ubi-fips --restart always -v /run/podman/podman.sock:/run/podman/podman.sock -v /srv/gitlab-runner/config/config.toml/:/etc/gitlab-runner/config.toml gitlab/gitlab-runner:ubi-fips-v15.7.1
Ticket Id
https://gitlab.zendesk.com/agent/tickets/361386 (internal) https://gitlab-federal-support.zendesk.com/agent/tickets/4725 (internal)
Configuration used
Podman 3.4.2
Current behaviour
Runner 15.7.1 is checking /home/gitlab-runner/.gitlab-runner/config.toml
dir for the configuration
Expected behaviour
Runner to use /etc/gitlab-runner/config.toml
for the configuration
Versions
15.7.1
Relevant logs
root@u-server:~# podman logs runner-fips
Runtime platform arch=arm64 os=linux pid=2 revision=6d480948 version=15.7.1
Starting multi-runner from /home/gitlab-runner/.gitlab-runner/config.toml... builds=0
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
Created missing unique system ID system_id=r_MbGx1rgBioJL
Configuration loaded builds=0
listen_address not defined, metrics & debug endpoints disabled builds=0
[session_server].listen_address not defined, session endpoints disabled builds=0
Initializing executor providers builds=0
ERROR: Failed to load config stat /home/gitlab-runner/.gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /home/gitlab-runner/.gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /home/gitlab-runner/.gitlab-runner/config.toml: no such file or directory builds=0
Workaround
Providing env to the container deployment adjusts the home dir to the correct value:
\-e "CONFIG_FILE=/etc/gitlab-runner/config.toml"
for example:
`podman run --rm --privileged --security-opt label=disable --name ubi-fips -e "CONFIG_FILE=/etc/gitlab-runner/config.toml" -v /PATH/TO/config.toml:/etc/gitlab-runner/config.toml gitlab/gitlab-runner:ubi-fips-v15.7.1`
cc @ratchade