aws ec2 上的 Gitlab runner:让一个 ec2 启动多个并发作业
Gitlab runner on aws ec2 : Have one ec2 launching multiple concurrent jobs
我遵循了这个教程:https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/
而且效果很好!我只将跑步者放在一个分支中进行测试但在我们的管道中,一个阶段有 15 个工作,但我的配置只启动 2 台 ec2 机器,所以一次只接受 2 个工作,但我希望一台机器接受 4 个同时-5个职位
我的同台工作:https://imgur.com/a/s2HjGML
这是我的config.toml
concurrent = 8
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "gitlab-runner-xxxxx-dev"
url = "https://gitlab.com/"
token = "xxxxxxxxx"
executor = "docker+machine"
limit = 2
request_concurrency = 3
[runners.docker]
image = "alpine"
privileged = true
disable_cache = true
[runners.cache]
Type = "s3"
Shared = true
[runners.cache.s3]
ServerAddress = "s3.amazonaws.com"
AccessKey = "xxxxxxxx"
SecretKey = "xxxxx"
BucketName = "gitlab-runner-xxx-bucket"
BucketLocation = "eu-west-3"
[runners.machine]
IdleCount = 0
IdleTime = 1800
MaxBuilds = 10
MachineDriver = "amazonec2"
MachineName = "gitlab-docker-machine-%s"
MachineOptions = [
"amazonec2-access-key=xxxxxx",
"amazonec2-secret-key=xxxxxxx",
"amazonec2-region=eu-west-3",
"amazonec2-vpc-id=vpc-xxxx",
"amazonec2-subnet-id=subnet-xxxxx",
"amazonec2-use-private-address=true",
"amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true",
"amazonec2-security-group=xxxxx",
"amazonec2-instance-type=m5.large",
]
[[runners.machine.autoscaling]]
Periods = ["* * 9-18 * * mon-fri *"]
IdleCount = 2
IdleTime = 3600
Timezone = "UTC"
[[runners.machine.autoscaling]]
Periods = ["* * * * * sat,sun *"]
IdleCount = 1
IdleTime = 60
Timezone = "UTC"
是我的配置不适合我想要的还是我想要的不可能?
谢谢大家!
您已在配置中设置 limit = 2
。这会将此配置文件中定义的所有 运行 人员处理的作业总数限制为 2。
将此限制设置为更高的数字以允许更多作业同时 运行。
我遵循了这个教程:https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/
而且效果很好!我只将跑步者放在一个分支中进行测试但在我们的管道中,一个阶段有 15 个工作,但我的配置只启动 2 台 ec2 机器,所以一次只接受 2 个工作,但我希望一台机器接受 4 个同时-5个职位
我的同台工作:https://imgur.com/a/s2HjGML
这是我的config.toml
concurrent = 8
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "gitlab-runner-xxxxx-dev"
url = "https://gitlab.com/"
token = "xxxxxxxxx"
executor = "docker+machine"
limit = 2
request_concurrency = 3
[runners.docker]
image = "alpine"
privileged = true
disable_cache = true
[runners.cache]
Type = "s3"
Shared = true
[runners.cache.s3]
ServerAddress = "s3.amazonaws.com"
AccessKey = "xxxxxxxx"
SecretKey = "xxxxx"
BucketName = "gitlab-runner-xxx-bucket"
BucketLocation = "eu-west-3"
[runners.machine]
IdleCount = 0
IdleTime = 1800
MaxBuilds = 10
MachineDriver = "amazonec2"
MachineName = "gitlab-docker-machine-%s"
MachineOptions = [
"amazonec2-access-key=xxxxxx",
"amazonec2-secret-key=xxxxxxx",
"amazonec2-region=eu-west-3",
"amazonec2-vpc-id=vpc-xxxx",
"amazonec2-subnet-id=subnet-xxxxx",
"amazonec2-use-private-address=true",
"amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true",
"amazonec2-security-group=xxxxx",
"amazonec2-instance-type=m5.large",
]
[[runners.machine.autoscaling]]
Periods = ["* * 9-18 * * mon-fri *"]
IdleCount = 2
IdleTime = 3600
Timezone = "UTC"
[[runners.machine.autoscaling]]
Periods = ["* * * * * sat,sun *"]
IdleCount = 1
IdleTime = 60
Timezone = "UTC"
是我的配置不适合我想要的还是我想要的不可能? 谢谢大家!
您已在配置中设置 limit = 2
。这会将此配置文件中定义的所有 运行 人员处理的作业总数限制为 2。
将此限制设置为更高的数字以允许更多作业同时 运行。