hannes ach
hannes ach

Reputation: 17763

Gitlab runner doesn't start

On my instance,

enter image description here

I added a runner on a Apple Silicon M1, but this runner doesn't start. That's why I assigned a project to it, with the hope of starting, but I see this

enter image description here

This is what I did.

Create docker runner:

docker stop gitlab-runner && docker rm gitlab-runner

docker run -d --name gitlab-runner --restart always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest

register runner:

docker run --rm -v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
  --non-interactive \
  --executor "docker" \
  --docker-image hannesa2/android-ndk:api28_emu \
  --url "http://latitude:8083/" \
  --registration-token "<TOKEN>" \
  --description "M1 pro Android NDK + Emu" \
  --tag-list "android,android-ndk,android-emu" \
  --run-untagged="true" \
  --locked="false" \
  --access-level="not_protected"

and I see this in docker log

Runtime platform         arch=arm64 os=linux pid=8 revision=4b9e985a version=14.4.0
Starting multi-runner from /etc/gitlab-runner/config.toml...  builds=0
Running in system-mode.                            

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
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
Configuration loaded     builds=0

Host comes with this file /Users/Shared/gitlab-runner/config/config.toml

Docker container comes with it too enter image description here

Thank you

Upvotes: 0

Views: 1311

Answers (1)

vdstw
vdstw

Reputation: 167

You're starting the runner with -v /srv/gitlab-runner/config:/etc/gitlab-runner. But the registration uses a different path for the volume (-v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner).

So the actual runner cannot find the config being written by the registration command. You should use the same hostPath for both invocations.

Upvotes: 2

Related Questions