Я использую gitlab runner для запуска своих тестов на серверах Digital Ocean
После переустановки gitlab runner я начал получать следующие ошибки:
У меня есть следующий конфиг для моего бегуна:
concurrent = 10
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Builds coordinator"
url = "https://gitlab.com/"
token = "<token>"
executor = "docker+machine"
limit = 10
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.machine]
IdleCount = 0
IdleTime = 0
OffPeakTimezone = ""
OffPeakIdleCount = 0
OffPeakIdleTime = 0
MachineDriver = "digitalocean"
MachineName = "gitlab-runner-autoscale-%s"
MachineOptions = [
"digitalocean-image=coreos-stable",
"digitalocean-ssh-user=core",
"digitalocean-access-token=<token>",
"digitalocean-region=lon1",
"digitalocean-size=4gb",
"digitalocean-private-networking"
]
[runners.cache]
Type = "s3"
Path = "cache_for_builds"
Shared = false
[runners.cache.s3]
ServerAddress = "ams3.digitaloceanspaces.com"
AccessKey = "<key>"
SecretKey = "<secret>"
BucketName = "cache-for-builds"
BucketLocation = "ams3"
Insecure = false
Я пытался сделать docker-machine ls
, когда сборка была запущена, и я увидел следующий вывод:
... ERRORS
... Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
или
... ERRORS
... Unable to query docker version: Get https://<ip>:2376/v1.15/version: remote error: tls: bad certificate
Я попытался найти сертификаты на моем сервере с помощью find -name "*cert*"
и нашел их в /root/.docker/machine/certs
. Я добавил путь к сертификатам в раздел [runners.docker]
, как описано в документах , но это не помогло:
[runners.docker]
...
tls_cert_path = "/root/.docker/machine/certs"
Когда я просматриваю логи gitlab runner с journalctl -u gitlab-runner
, я вижу
Jan 13 21:06:59 builds-coordinator gitlab-runner[3360]: ERROR: Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "<ip>:2376": remote error: tls: bad certificate driver=digitalocean name=r
Jan 13 21:06:59 builds-coordinator gitlab-runner[3360]: ERROR: You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'. driver=digitalocean name=runner-gitlab-runner-autoscale-<id> operation=create
Jan 13 21:06:59 builds-coordinator gitlab-runner[3360]: ERROR: Be advised that this will trigger a Docker daemon restart which might stop running containers. driver=digitalocean name=runner-gitlab-runner-autoscale-<id> operation=create
Jan 13 21:06:59 builds-coordinator gitlab-runner[3360]: The default lines below are for a sh/bash shell, you can specify the shell you're using, with the --shell flag. driver=digitalocean name=runner-gitlab-runner-autoscale-<id> operation=create
Jan 13 21:07:00 builds-coordinator gitlab-runner[3360]: WARNING: Machine creation failed, trying to provision error=exit status 1 name=runner-gitlab-runner-autoscale-<id>
Jan 13 21:07:01 builds-coordinator gitlab-runner[3360]: Waiting for SSH to be available... name=runner-gitlab-runner-autoscale-<id> operation=provision
До того, как я использовал gitlab runner version 11.5.1
Как я могу исправить эти ошибки и заставить gitlab runner запускать сборки?