Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
801f6ac4
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
801f6ac4
编写于
11月 13, 2017
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Runner registration info
上级
2343d3a5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
89 addition
and
5 deletion
+89
-5
doc/articles/runner_autoscale_aws/index.md
doc/articles/runner_autoscale_aws/index.md
+89
-5
未找到文件。
doc/articles/runner_autoscale_aws/index.md
浏览文件 @
801f6ac4
...
...
@@ -39,14 +39,26 @@ Install the prerequisites:
1.
[
Install Docker
](
https://docs.docker.com/engine/installation/#server
)
1.
[
Install Docker Machine
](
https://docs.docker.com/machine/install-machine/
)
Before configuring the GitLab Runner, you need to first register it, so that
it connects with your GitLab instance:
1.
[
Obtain a Runner token
](
../../ci/runners/README.md
)
1.
[
Register the Runner
](
https://docs.gitlab.com/runner/register/index.html#gnu-linux
)
1.
When asked the executor type, enter
`docker+machine`
TIP:
**Tip:**
If you want every user in your instance to be able to use the autoscaled Runners,
register the Runner as a shared one.
You can now move on to the most important part, configuring GitLab Runner.
## Configuring GitLab Runner to use the AWS machine driver
Before configuring the GitLab Runner, you need to first register it, so that
it connects with your GitLab instance
.
Now that the Runner is registered, you need to edit its configuration file and
add the required options for the AWS machine driver
.
Edit
`/etc/gitlab-runner/config.toml`
:
Here's a full example of
`/etc/gitlab-runner/config.toml`
. Open it with your
editor and edit as you see fit:
```
toml
concurrent
=
3
...
...
@@ -97,8 +109,80 @@ check_interval = 0
]
```
Under
`MachineOptions`
you can add anything that the
[
AWS Docker Machine driver
supports
](
https://docs.docker.com/machine/drivers/aws/#options
)
.
Let's break it down to pieces.
-
Global section
```toml
concurrent = 3
check_interval = 0
```
-
`[[runners]]`
```toml
[[runners]]
name = "gitlab-aws-autoscaler"
url = "<url to your GitLab CI host>"
token = "<registration token>"
executor = "docker+machine"
limit = 4
```
-
`[runners.docker]`
```toml
[runners.docker]
image = "alpine"
privileged = true
disable_cache = false
volumes = ["/cache"]
```
-
`[runners.cache]`
```toml
[runners.cache]
Type = "s3"
ServerAddress = "s3.amazonaws.com"
AccessKey = "<your AWS Access Key ID>"
SecretKey = "<your AWS Secret Access Key>"
BucketName = "<the bucket where your cache should be kept>"
BucketLocation = "us-east-1"
Shared = true
```
-
`[runners.machine]`
```toml
[runners.machine]
IdleCount = 1
IdleTime = 1800
MaxBuilds = 100
MachineDriver = "amazonec2"
MachineName = "gitlab-docker-machine-%s"
OffPeakPeriods = ["* * 0-7,19-23 * * mon-fri *", "* * * * * sat,sun *"]
OffPeakIdleCount = 0
OffPeakIdleTime = 1200
MachineOptions = [
"amazonec2-access-key=XXXX",
"amazonec2-secret-key=XXXX",
"amazonec2-region=us-east-1",
"amazonec2-vpc-id=vpc-xxxxx",
"amazonec2-subnet-id=subnet-xxxxx",
"amazonec2-use-private-address=true",
"amazonec2-tags=Name,gitlab-runner-autoscale",
"amazonec2-security-group=docker-machine-scaler",
"amazonec2-instance-type=m4.2xlarge",
"amazonec2-ssh-user=ubuntu",
"amazonec2-ssh-keypath=/etc/gitlab-runner/certs/gitlab-aws-autoscaler",
"amazonec2-zone=a",
"amazonec2-root-size=32",
]
```
Under `MachineOptions` you can add anything that the [AWS Docker Machine driver
supports](https://docs.docker.com/machine/drivers/aws/#options).
## Cutting down costs with Amazon EC2 Spot instances
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录