我希望始终有1个空闲运行器,它将缓存docker图像,以便当其他运行器选择作业时,这些图像 会从闲置的运行程序镜像到新的运行程序,而不会从https://hub.docker.com
下载我有以下gitlab运行程序配置
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 = 1
IdleTime = 0
OffPeakPeriods = [
"* * 0-10,18-23 * * mon-fri *",
"* * * * * sat,sun *"
]
OffPeakTimezone = "Europe/Minsk"
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
当我启动一个包含10个工作的新管道时,将一个接一个地创建新的运行程序。首先,第一个作业由闲置的转轮来接,然后在10秒钟后创建一个新的空闲转轮,然后接第二个作业,依此类推。很慢
我希望当出现10个新工作时,协调员应检查是否有1个空闲转轮。它应该创建10个新运行程序来处理工作,并创建1个空闲运行程序。在我的情况下,它不应创建空闲的运行程序,因为每个令牌的运行程序限制为10
gitlab-runner --version
给了我
Version: 11.5.1
Git revision: 7f00c780
Git branch: 11-5-stable
GO version: go1.8.7
Built: 2018-12-06T13:25:34+0000
OS/Arch: linux/amd64
目前,我通过拥有10个空闲运行程序解决了此问题,但我不想拥有10个空闲运行程序来加快docker映像下载过程。我如何才能只有1个闲置的运行程序,如何让其余的运行程序生成并快速选择新工作(我希望新的运行程序从空闲的运行程序下载docker映像)?