@cloudsnorkel/cdk-github-runners 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +6 -1
- package/.jsii +1225 -174
- package/API.md +1047 -64
- package/README.md +54 -44
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/lambdas/build-image/index.js +121 -0
- package/lib/lambdas/setup/index.js +2 -2
- package/lib/lambdas/update-lambda/index.js +55 -0
- package/lib/providers/codebuild.d.ts +31 -1
- package/lib/providers/codebuild.js +57 -13
- package/lib/providers/common.d.ts +87 -6
- package/lib/providers/common.js +64 -4
- package/lib/providers/docker-images/codebuild/linux-arm64/Dockerfile +59 -0
- package/lib/providers/docker-images/codebuild/{Dockerfile → linux-x64/Dockerfile} +10 -5
- package/lib/providers/docker-images/fargate/linux-arm64/Dockerfile +41 -0
- package/lib/providers/docker-images/fargate/{runner.sh → linux-arm64/runner.sh} +0 -0
- package/lib/providers/docker-images/fargate/{Dockerfile → linux-x64/Dockerfile} +10 -5
- package/lib/providers/docker-images/fargate/linux-x64/runner.sh +5 -0
- package/lib/providers/docker-images/lambda/linux-arm64/Dockerfile +32 -0
- package/lib/providers/docker-images/lambda/{runner.js → linux-arm64/runner.js} +0 -0
- package/lib/providers/docker-images/lambda/{runner.sh → linux-arm64/runner.sh} +0 -0
- package/lib/providers/docker-images/lambda/linux-x64/Dockerfile +31 -0
- package/lib/providers/docker-images/lambda/linux-x64/runner.js +29 -0
- package/lib/providers/docker-images/lambda/linux-x64/runner.sh +12 -0
- package/lib/providers/fargate.d.ts +33 -1
- package/lib/providers/fargate.js +39 -8
- package/lib/providers/image-builders/codebuild.d.ts +170 -0
- package/lib/providers/image-builders/codebuild.js +340 -0
- package/lib/providers/image-builders/static.d.ts +29 -0
- package/lib/providers/image-builders/static.js +58 -0
- package/lib/providers/lambda.d.ts +27 -1
- package/lib/providers/lambda.js +88 -9
- package/lib/runner.d.ts +2 -2
- package/lib/runner.js +7 -3
- package/lib/secrets.js +1 -1
- package/lib/utils.d.ts +2 -1
- package/lib/utils.js +14 -3
- package/lib/webhook.js +2 -1
- package/package.json +8 -7
- package/lib/providers/docker-images/lambda/Dockerfile +0 -27
package/API.md
CHANGED
|
@@ -2,6 +2,253 @@
|
|
|
2
2
|
|
|
3
3
|
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
4
4
|
|
|
5
|
+
### CodeBuildImageBuilder <a name="CodeBuildImageBuilder" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder"></a>
|
|
6
|
+
|
|
7
|
+
- *Implements:* <a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a>
|
|
8
|
+
|
|
9
|
+
An image builder that uses CodeBuild to build Docker images pre-baked with all the GitHub Actions runner requirements.
|
|
10
|
+
|
|
11
|
+
Builders can be used with runner providers.
|
|
12
|
+
|
|
13
|
+
Each builder re-runs automatically at a set interval to make sure the images contain the latest versions of everything.
|
|
14
|
+
|
|
15
|
+
You can create an instance of this construct to customize the image used to spin-up runners. Each provider has its own requirements for what an image should do. That's why they each provide their own Dockerfile.
|
|
16
|
+
|
|
17
|
+
For example, to set a specific runner version, rebuild the image every 2 weeks, and add a few packages for the Fargate provider, use:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
const builder = new CodeBuildImageBuilder(this, 'Builder', {
|
|
21
|
+
dockerfilePath: FargateProvider.LINUX_X64_DOCKERFILE_PATH,
|
|
22
|
+
runnerVersion: RunnerVersion.specific('2.293.0'),
|
|
23
|
+
rebuildInterval: Duration.days(14),
|
|
24
|
+
});
|
|
25
|
+
builder.setBuildArg('EXTRA_PACKAGES', 'nginx xz-utils');
|
|
26
|
+
new FargateProvider(this, 'Fargate provider', {
|
|
27
|
+
label: 'customized-fargate',
|
|
28
|
+
imageBuilder: builder,
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer"></a>
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { CodeBuildImageBuilder } from '@cloudsnorkel/cdk-github-runners'
|
|
36
|
+
|
|
37
|
+
new CodeBuildImageBuilder(scope: Construct, id: string, props: CodeBuildImageBuilderProps)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| **Name** | **Type** | **Description** |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
43
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
44
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.props">props</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps">CodeBuildImageBuilderProps</a></code> | *No description.* |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.scope"></a>
|
|
49
|
+
|
|
50
|
+
- *Type:* constructs.Construct
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
##### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.id"></a>
|
|
55
|
+
|
|
56
|
+
- *Type:* string
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.Initializer.parameter.props"></a>
|
|
61
|
+
|
|
62
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps">CodeBuildImageBuilderProps</a>
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
67
|
+
|
|
68
|
+
| **Name** | **Description** |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
71
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addFiles">addFiles</a></code> | Uploads a folder to the build server at a given folder name. |
|
|
72
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPolicyStatement">addPolicyStatement</a></code> | Add a policy statement to the builder to access resources required to the image build. |
|
|
73
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPostBuildCommand">addPostBuildCommand</a></code> | Adds a command that runs after `docker build` and `docker push`. |
|
|
74
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPreBuildCommand">addPreBuildCommand</a></code> | Adds a command that runs before `docker build`. |
|
|
75
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.bind">bind</a></code> | Called by IRunnerProvider to finalize settings and create the image builder. |
|
|
76
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.setBuildArg">setBuildArg</a></code> | Adds a build argument for Docker. |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
##### `toString` <a name="toString" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.toString"></a>
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
public toString(): string
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Returns a string representation of this construct.
|
|
87
|
+
|
|
88
|
+
##### `addFiles` <a name="addFiles" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addFiles"></a>
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
public addFiles(sourcePath: string, destName: string): void
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Uploads a folder to the build server at a given folder name.
|
|
95
|
+
|
|
96
|
+
###### `sourcePath`<sup>Required</sup> <a name="sourcePath" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addFiles.parameter.sourcePath"></a>
|
|
97
|
+
|
|
98
|
+
- *Type:* string
|
|
99
|
+
|
|
100
|
+
path to source directory.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
###### `destName`<sup>Required</sup> <a name="destName" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addFiles.parameter.destName"></a>
|
|
105
|
+
|
|
106
|
+
- *Type:* string
|
|
107
|
+
|
|
108
|
+
name of destination folder.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
##### `addPolicyStatement` <a name="addPolicyStatement" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPolicyStatement"></a>
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
public addPolicyStatement(statement: PolicyStatement): void
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Add a policy statement to the builder to access resources required to the image build.
|
|
119
|
+
|
|
120
|
+
###### `statement`<sup>Required</sup> <a name="statement" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPolicyStatement.parameter.statement"></a>
|
|
121
|
+
|
|
122
|
+
- *Type:* aws-cdk-lib.aws_iam.PolicyStatement
|
|
123
|
+
|
|
124
|
+
IAM policy statement.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
##### `addPostBuildCommand` <a name="addPostBuildCommand" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPostBuildCommand"></a>
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
public addPostBuildCommand(command: string): void
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Adds a command that runs after `docker build` and `docker push`.
|
|
135
|
+
|
|
136
|
+
###### `command`<sup>Required</sup> <a name="command" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPostBuildCommand.parameter.command"></a>
|
|
137
|
+
|
|
138
|
+
- *Type:* string
|
|
139
|
+
|
|
140
|
+
command to add.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
##### `addPreBuildCommand` <a name="addPreBuildCommand" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPreBuildCommand"></a>
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
public addPreBuildCommand(command: string): void
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Adds a command that runs before `docker build`.
|
|
151
|
+
|
|
152
|
+
###### `command`<sup>Required</sup> <a name="command" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.addPreBuildCommand.parameter.command"></a>
|
|
153
|
+
|
|
154
|
+
- *Type:* string
|
|
155
|
+
|
|
156
|
+
command to add.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
##### `bind` <a name="bind" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.bind"></a>
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
public bind(): RunnerImage
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Called by IRunnerProvider to finalize settings and create the image builder.
|
|
167
|
+
|
|
168
|
+
##### `setBuildArg` <a name="setBuildArg" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.setBuildArg"></a>
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
public setBuildArg(name: string, value: string): void
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Adds a build argument for Docker.
|
|
175
|
+
|
|
176
|
+
See the documentation for the Dockerfile you're using for a list of supported build arguments.
|
|
177
|
+
|
|
178
|
+
###### `name`<sup>Required</sup> <a name="name" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.setBuildArg.parameter.name"></a>
|
|
179
|
+
|
|
180
|
+
- *Type:* string
|
|
181
|
+
|
|
182
|
+
build argument name.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
###### `value`<sup>Required</sup> <a name="value" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.setBuildArg.parameter.value"></a>
|
|
187
|
+
|
|
188
|
+
- *Type:* string
|
|
189
|
+
|
|
190
|
+
build argument value.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
195
|
+
|
|
196
|
+
| **Name** | **Description** |
|
|
197
|
+
| --- | --- |
|
|
198
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.isConstruct"></a>
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
import { CodeBuildImageBuilder } from '@cloudsnorkel/cdk-github-runners'
|
|
206
|
+
|
|
207
|
+
CodeBuildImageBuilder.isConstruct(x: any)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Checks if `x` is a construct.
|
|
211
|
+
|
|
212
|
+
###### `x`<sup>Required</sup> <a name="x" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.isConstruct.parameter.x"></a>
|
|
213
|
+
|
|
214
|
+
- *Type:* any
|
|
215
|
+
|
|
216
|
+
Any object.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
221
|
+
|
|
222
|
+
| **Name** | **Type** | **Description** |
|
|
223
|
+
| --- | --- | --- |
|
|
224
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
225
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.property.props">props</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps">CodeBuildImageBuilderProps</a></code> | *No description.* |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.property.node"></a>
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
public readonly node: Node;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
- *Type:* constructs.Node
|
|
236
|
+
|
|
237
|
+
The tree node.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder.property.props"></a>
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
public readonly props: CodeBuildImageBuilderProps;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps">CodeBuildImageBuilderProps</a>
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
|
|
5
252
|
### CodeBuildRunner <a name="CodeBuildRunner" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner"></a>
|
|
6
253
|
|
|
7
254
|
- *Implements:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
|
|
@@ -205,6 +452,58 @@ VPC used for hosting the project.
|
|
|
205
452
|
|
|
206
453
|
---
|
|
207
454
|
|
|
455
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
456
|
+
|
|
457
|
+
| **Name** | **Type** | **Description** |
|
|
458
|
+
| --- | --- | --- |
|
|
459
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.LINUX_ARM64_DOCKERFILE_PATH">LINUX_ARM64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux ARM64 with all the requirements for CodeBuild runner. |
|
|
460
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.LINUX_X64_DOCKERFILE_PATH">LINUX_X64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux x64 with all the requirements for CodeBuild runner. |
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
##### `LINUX_ARM64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_ARM64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.LINUX_ARM64_DOCKERFILE_PATH"></a>
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
public readonly LINUX_ARM64_DOCKERFILE_PATH: string;
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
- *Type:* string
|
|
471
|
+
|
|
472
|
+
Path to Dockerfile for Linux ARM64 with all the requirements for CodeBuild runner.
|
|
473
|
+
|
|
474
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
475
|
+
|
|
476
|
+
Available build arguments that can be set in the image builder:
|
|
477
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be an Ubuntu compatible image.
|
|
478
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
479
|
+
* `DOCKER_CHANNEL` overrides the channel from which Docker will be downloaded. Defaults to `"stsable"`.
|
|
480
|
+
* `DIND_COMMIT` overrides the commit where dind is found.
|
|
481
|
+
* `DOCKER_VERSION` overrides the installed Docker version.
|
|
482
|
+
* `DOCKER_COMPOSE_VERSION` overrides the installed docker-compose version.
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
##### `LINUX_X64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_X64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.LINUX_X64_DOCKERFILE_PATH"></a>
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
public readonly LINUX_X64_DOCKERFILE_PATH: string;
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
- *Type:* string
|
|
493
|
+
|
|
494
|
+
Path to Dockerfile for Linux x64 with all the requirements for CodeBuild runner.
|
|
495
|
+
|
|
496
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
497
|
+
|
|
498
|
+
Available build arguments that can be set in the image builder:
|
|
499
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be an Ubuntu compatible image.
|
|
500
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
501
|
+
* `DOCKER_CHANNEL` overrides the channel from which Docker will be downloaded. Defaults to `"stsable"`.
|
|
502
|
+
* `DIND_COMMIT` overrides the commit where dind is found.
|
|
503
|
+
* `DOCKER_VERSION` overrides the installed Docker version.
|
|
504
|
+
* `DOCKER_COMPOSE_VERSION` overrides the installed docker-compose version.
|
|
505
|
+
|
|
506
|
+
---
|
|
208
507
|
|
|
209
508
|
### FargateRunner <a name="FargateRunner" id="@cloudsnorkel/cdk-github-runners.FargateRunner"></a>
|
|
210
509
|
|
|
@@ -461,6 +760,50 @@ VPC used for hosting the task.
|
|
|
461
760
|
|
|
462
761
|
---
|
|
463
762
|
|
|
763
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
764
|
+
|
|
765
|
+
| **Name** | **Type** | **Description** |
|
|
766
|
+
| --- | --- | --- |
|
|
767
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.LINUX_ARM64_DOCKERFILE_PATH">LINUX_ARM64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux ARM64 with all the requirement for Fargate runner. |
|
|
768
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.LINUX_X64_DOCKERFILE_PATH">LINUX_X64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux x64 with all the requirement for Fargate runner. |
|
|
769
|
+
|
|
770
|
+
---
|
|
771
|
+
|
|
772
|
+
##### `LINUX_ARM64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_ARM64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.LINUX_ARM64_DOCKERFILE_PATH"></a>
|
|
773
|
+
|
|
774
|
+
```typescript
|
|
775
|
+
public readonly LINUX_ARM64_DOCKERFILE_PATH: string;
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
- *Type:* string
|
|
779
|
+
|
|
780
|
+
Path to Dockerfile for Linux ARM64 with all the requirement for Fargate runner.
|
|
781
|
+
|
|
782
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
783
|
+
|
|
784
|
+
Available build arguments that can be set in the image builder:
|
|
785
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be an Ubuntu compatible image.
|
|
786
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
787
|
+
|
|
788
|
+
---
|
|
789
|
+
|
|
790
|
+
##### `LINUX_X64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_X64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.LINUX_X64_DOCKERFILE_PATH"></a>
|
|
791
|
+
|
|
792
|
+
```typescript
|
|
793
|
+
public readonly LINUX_X64_DOCKERFILE_PATH: string;
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
- *Type:* string
|
|
797
|
+
|
|
798
|
+
Path to Dockerfile for Linux x64 with all the requirement for Fargate runner.
|
|
799
|
+
|
|
800
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
801
|
+
|
|
802
|
+
Available build arguments that can be set in the image builder:
|
|
803
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be an Ubuntu compatible image.
|
|
804
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
805
|
+
|
|
806
|
+
---
|
|
464
807
|
|
|
465
808
|
### GitHubRunners <a name="GitHubRunners" id="@cloudsnorkel/cdk-github-runners.GitHubRunners"></a>
|
|
466
809
|
|
|
@@ -510,7 +853,7 @@ new GitHubRunners(
|
|
|
510
853
|
```typescript
|
|
511
854
|
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners'
|
|
512
855
|
|
|
513
|
-
new GitHubRunners(scope: Construct, id: string, props
|
|
856
|
+
new GitHubRunners(scope: Construct, id: string, props?: GitHubRunnersProps)
|
|
514
857
|
```
|
|
515
858
|
|
|
516
859
|
| **Name** | **Type** | **Description** |
|
|
@@ -533,7 +876,7 @@ new GitHubRunners(scope: Construct, id: string, props: GitHubRunnersProps)
|
|
|
533
876
|
|
|
534
877
|
---
|
|
535
878
|
|
|
536
|
-
##### `props`<sup>
|
|
879
|
+
##### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.Initializer.parameter.props"></a>
|
|
537
880
|
|
|
538
881
|
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps">GitHubRunnersProps</a>
|
|
539
882
|
|
|
@@ -586,7 +929,6 @@ Any object.
|
|
|
586
929
|
| **Name** | **Type** | **Description** |
|
|
587
930
|
| --- | --- | --- |
|
|
588
931
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
589
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.props">props</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps">GitHubRunnersProps</a></code> | *No description.* |
|
|
590
932
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | Configured runner providers. |
|
|
591
933
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.secrets">secrets</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets">Secrets</a></code> | Secrets for GitHub communication including webhook secret and runner authentication. |
|
|
592
934
|
|
|
@@ -604,16 +946,6 @@ The tree node.
|
|
|
604
946
|
|
|
605
947
|
---
|
|
606
948
|
|
|
607
|
-
##### `props`<sup>Required</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.property.props"></a>
|
|
608
|
-
|
|
609
|
-
```typescript
|
|
610
|
-
public readonly props: GitHubRunnersProps;
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps">GitHubRunnersProps</a>
|
|
614
|
-
|
|
615
|
-
---
|
|
616
|
-
|
|
617
949
|
##### `providers`<sup>Required</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers"></a>
|
|
618
950
|
|
|
619
951
|
```typescript
|
|
@@ -842,6 +1174,50 @@ VPC used for hosting the function.
|
|
|
842
1174
|
|
|
843
1175
|
---
|
|
844
1176
|
|
|
1177
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
1178
|
+
|
|
1179
|
+
| **Name** | **Type** | **Description** |
|
|
1180
|
+
| --- | --- | --- |
|
|
1181
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.LINUX_ARM64_DOCKERFILE_PATH">LINUX_ARM64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux ARM64 with all the requirement for Lambda runner. |
|
|
1182
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.LINUX_X64_DOCKERFILE_PATH">LINUX_X64_DOCKERFILE_PATH</a></code> | <code>string</code> | Path to Dockerfile for Linux x64 with all the requirement for Lambda runner. |
|
|
1183
|
+
|
|
1184
|
+
---
|
|
1185
|
+
|
|
1186
|
+
##### `LINUX_ARM64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_ARM64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.property.LINUX_ARM64_DOCKERFILE_PATH"></a>
|
|
1187
|
+
|
|
1188
|
+
```typescript
|
|
1189
|
+
public readonly LINUX_ARM64_DOCKERFILE_PATH: string;
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
- *Type:* string
|
|
1193
|
+
|
|
1194
|
+
Path to Dockerfile for Linux ARM64 with all the requirement for Lambda runner.
|
|
1195
|
+
|
|
1196
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
1197
|
+
|
|
1198
|
+
Available build arguments that can be set in the image builder:
|
|
1199
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be similar to public.ecr.aws/lambda/nodejs:14.
|
|
1200
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
1201
|
+
|
|
1202
|
+
---
|
|
1203
|
+
|
|
1204
|
+
##### `LINUX_X64_DOCKERFILE_PATH`<sup>Required</sup> <a name="LINUX_X64_DOCKERFILE_PATH" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.property.LINUX_X64_DOCKERFILE_PATH"></a>
|
|
1205
|
+
|
|
1206
|
+
```typescript
|
|
1207
|
+
public readonly LINUX_X64_DOCKERFILE_PATH: string;
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
- *Type:* string
|
|
1211
|
+
|
|
1212
|
+
Path to Dockerfile for Linux x64 with all the requirement for Lambda runner.
|
|
1213
|
+
|
|
1214
|
+
Use this Dockerfile unless you need to customize it further than allowed by hooks.
|
|
1215
|
+
|
|
1216
|
+
Available build arguments that can be set in the image builder:
|
|
1217
|
+
* `BASE_IMAGE` sets the `FROM` line. This should be similar to public.ecr.aws/lambda/nodejs:14.
|
|
1218
|
+
* `EXTRA_PACKAGES` can be used to install additional packages.
|
|
1219
|
+
|
|
1220
|
+
---
|
|
845
1221
|
|
|
846
1222
|
### Secrets <a name="Secrets" id="@cloudsnorkel/cdk-github-runners.Secrets"></a>
|
|
847
1223
|
|
|
@@ -1000,6 +1376,211 @@ Webhook secret used to confirm events are coming from GitHub and nowhere else.
|
|
|
1000
1376
|
|
|
1001
1377
|
## Structs <a name="Structs" id="Structs"></a>
|
|
1002
1378
|
|
|
1379
|
+
### CodeBuildImageBuilderProps <a name="CodeBuildImageBuilderProps" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps"></a>
|
|
1380
|
+
|
|
1381
|
+
Properties for CodeBuildImageBuilder construct.
|
|
1382
|
+
|
|
1383
|
+
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.Initializer"></a>
|
|
1384
|
+
|
|
1385
|
+
```typescript
|
|
1386
|
+
import { CodeBuildImageBuilderProps } from '@cloudsnorkel/cdk-github-runners'
|
|
1387
|
+
|
|
1388
|
+
const codeBuildImageBuilderProps: CodeBuildImageBuilderProps = { ... }
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1392
|
+
|
|
1393
|
+
| **Name** | **Type** | **Description** |
|
|
1394
|
+
| --- | --- | --- |
|
|
1395
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.dockerfilePath">dockerfilePath</a></code> | <code>string</code> | Path to Dockerfile to be built. |
|
|
1396
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.architecture">architecture</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | Image architecture. |
|
|
1397
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.computeType">computeType</a></code> | <code>aws-cdk-lib.aws_codebuild.ComputeType</code> | The type of compute to use for this build. |
|
|
1398
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.logRemovalPolicy">logRemovalPolicy</a></code> | <code>aws-cdk-lib.RemovalPolicy</code> | Removal policy for logs of image builds. |
|
|
1399
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
1400
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.os">os</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a></code> | Image OS. |
|
|
1401
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.rebuildInterval">rebuildInterval</a></code> | <code>aws-cdk-lib.Duration</code> | Schedule the image to be rebuilt every given interval. |
|
|
1402
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.runnerVersion">runnerVersion</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a></code> | Version of GitHub Runners to install. |
|
|
1403
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security Group to assign to this instance. |
|
|
1404
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.subnetSelection">subnetSelection</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | Where to place the network interfaces within the VPC. |
|
|
1405
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.timeout">timeout</a></code> | <code>aws-cdk-lib.Duration</code> | The number of minutes after which AWS CodeBuild stops the build if it's not complete. |
|
|
1406
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC to launch the runners in. |
|
|
1407
|
+
|
|
1408
|
+
---
|
|
1409
|
+
|
|
1410
|
+
##### `dockerfilePath`<sup>Required</sup> <a name="dockerfilePath" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.dockerfilePath"></a>
|
|
1411
|
+
|
|
1412
|
+
```typescript
|
|
1413
|
+
public readonly dockerfilePath: string;
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
- *Type:* string
|
|
1417
|
+
|
|
1418
|
+
Path to Dockerfile to be built.
|
|
1419
|
+
|
|
1420
|
+
It can be a path to a Dockerfile, a folder containing a Dockerfile, or a zip file containing a Dockerfile.
|
|
1421
|
+
|
|
1422
|
+
---
|
|
1423
|
+
|
|
1424
|
+
##### `architecture`<sup>Optional</sup> <a name="architecture" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.architecture"></a>
|
|
1425
|
+
|
|
1426
|
+
```typescript
|
|
1427
|
+
public readonly architecture: Architecture;
|
|
1428
|
+
```
|
|
1429
|
+
|
|
1430
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
1431
|
+
- *Default:* Architecture.X86_64
|
|
1432
|
+
|
|
1433
|
+
Image architecture.
|
|
1434
|
+
|
|
1435
|
+
---
|
|
1436
|
+
|
|
1437
|
+
##### `computeType`<sup>Optional</sup> <a name="computeType" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.computeType"></a>
|
|
1438
|
+
|
|
1439
|
+
```typescript
|
|
1440
|
+
public readonly computeType: ComputeType;
|
|
1441
|
+
```
|
|
1442
|
+
|
|
1443
|
+
- *Type:* aws-cdk-lib.aws_codebuild.ComputeType
|
|
1444
|
+
- *Default:* {@link ComputeType#SMALL}
|
|
1445
|
+
|
|
1446
|
+
The type of compute to use for this build.
|
|
1447
|
+
|
|
1448
|
+
See the {@link ComputeType} enum for the possible values.
|
|
1449
|
+
|
|
1450
|
+
---
|
|
1451
|
+
|
|
1452
|
+
##### `logRemovalPolicy`<sup>Optional</sup> <a name="logRemovalPolicy" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.logRemovalPolicy"></a>
|
|
1453
|
+
|
|
1454
|
+
```typescript
|
|
1455
|
+
public readonly logRemovalPolicy: RemovalPolicy;
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
- *Type:* aws-cdk-lib.RemovalPolicy
|
|
1459
|
+
- *Default:* RemovalPolicy.DESTROY
|
|
1460
|
+
|
|
1461
|
+
Removal policy for logs of image builds.
|
|
1462
|
+
|
|
1463
|
+
If deployment fails on the custom resource, try setting this to `RemovalPolicy.RETAIN`. This way the CodeBuild logs can still be viewed, and you can see why the build failed.
|
|
1464
|
+
|
|
1465
|
+
We try to not leave anything behind when removed. But sometimes a log staying behind is useful.
|
|
1466
|
+
|
|
1467
|
+
---
|
|
1468
|
+
|
|
1469
|
+
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.logRetention"></a>
|
|
1470
|
+
|
|
1471
|
+
```typescript
|
|
1472
|
+
public readonly logRetention: RetentionDays;
|
|
1473
|
+
```
|
|
1474
|
+
|
|
1475
|
+
- *Type:* aws-cdk-lib.aws_logs.RetentionDays
|
|
1476
|
+
- *Default:* logs.RetentionDays.ONE_MONTH
|
|
1477
|
+
|
|
1478
|
+
The number of days log events are kept in CloudWatch Logs.
|
|
1479
|
+
|
|
1480
|
+
When updating
|
|
1481
|
+
this property, unsetting it doesn't remove the log retention policy. To
|
|
1482
|
+
remove the retention policy, set the value to `INFINITE`.
|
|
1483
|
+
|
|
1484
|
+
---
|
|
1485
|
+
|
|
1486
|
+
##### `os`<sup>Optional</sup> <a name="os" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.os"></a>
|
|
1487
|
+
|
|
1488
|
+
```typescript
|
|
1489
|
+
public readonly os: Os;
|
|
1490
|
+
```
|
|
1491
|
+
|
|
1492
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
1493
|
+
- *Default:* OS.LINUX
|
|
1494
|
+
|
|
1495
|
+
Image OS.
|
|
1496
|
+
|
|
1497
|
+
---
|
|
1498
|
+
|
|
1499
|
+
##### `rebuildInterval`<sup>Optional</sup> <a name="rebuildInterval" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.rebuildInterval"></a>
|
|
1500
|
+
|
|
1501
|
+
```typescript
|
|
1502
|
+
public readonly rebuildInterval: Duration;
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
- *Type:* aws-cdk-lib.Duration
|
|
1506
|
+
- *Default:* Duration.days(7)
|
|
1507
|
+
|
|
1508
|
+
Schedule the image to be rebuilt every given interval.
|
|
1509
|
+
|
|
1510
|
+
Useful for keeping the image up-do-date with the latest GitHub runner version and latest OS updates.
|
|
1511
|
+
|
|
1512
|
+
Set to zero to disable.
|
|
1513
|
+
|
|
1514
|
+
---
|
|
1515
|
+
|
|
1516
|
+
##### `runnerVersion`<sup>Optional</sup> <a name="runnerVersion" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.runnerVersion"></a>
|
|
1517
|
+
|
|
1518
|
+
```typescript
|
|
1519
|
+
public readonly runnerVersion: RunnerVersion;
|
|
1520
|
+
```
|
|
1521
|
+
|
|
1522
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a>
|
|
1523
|
+
- *Default:* latest version available
|
|
1524
|
+
|
|
1525
|
+
Version of GitHub Runners to install.
|
|
1526
|
+
|
|
1527
|
+
---
|
|
1528
|
+
|
|
1529
|
+
##### `securityGroup`<sup>Optional</sup> <a name="securityGroup" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.securityGroup"></a>
|
|
1530
|
+
|
|
1531
|
+
```typescript
|
|
1532
|
+
public readonly securityGroup: ISecurityGroup;
|
|
1533
|
+
```
|
|
1534
|
+
|
|
1535
|
+
- *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
|
|
1536
|
+
- *Default:* public project with no security group
|
|
1537
|
+
|
|
1538
|
+
Security Group to assign to this instance.
|
|
1539
|
+
|
|
1540
|
+
---
|
|
1541
|
+
|
|
1542
|
+
##### `subnetSelection`<sup>Optional</sup> <a name="subnetSelection" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.subnetSelection"></a>
|
|
1543
|
+
|
|
1544
|
+
```typescript
|
|
1545
|
+
public readonly subnetSelection: SubnetSelection;
|
|
1546
|
+
```
|
|
1547
|
+
|
|
1548
|
+
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
|
|
1549
|
+
- *Default:* no subnet
|
|
1550
|
+
|
|
1551
|
+
Where to place the network interfaces within the VPC.
|
|
1552
|
+
|
|
1553
|
+
---
|
|
1554
|
+
|
|
1555
|
+
##### `timeout`<sup>Optional</sup> <a name="timeout" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.timeout"></a>
|
|
1556
|
+
|
|
1557
|
+
```typescript
|
|
1558
|
+
public readonly timeout: Duration;
|
|
1559
|
+
```
|
|
1560
|
+
|
|
1561
|
+
- *Type:* aws-cdk-lib.Duration
|
|
1562
|
+
- *Default:* Duration.hours(1)
|
|
1563
|
+
|
|
1564
|
+
The number of minutes after which AWS CodeBuild stops the build if it's not complete.
|
|
1565
|
+
|
|
1566
|
+
For valid values, see the timeoutInMinutes field in the AWS
|
|
1567
|
+
CodeBuild User Guide.
|
|
1568
|
+
|
|
1569
|
+
---
|
|
1570
|
+
|
|
1571
|
+
##### `vpc`<sup>Optional</sup> <a name="vpc" id="@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps.property.vpc"></a>
|
|
1572
|
+
|
|
1573
|
+
```typescript
|
|
1574
|
+
public readonly vpc: IVpc;
|
|
1575
|
+
```
|
|
1576
|
+
|
|
1577
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
1578
|
+
- *Default:* no VPC
|
|
1579
|
+
|
|
1580
|
+
VPC to launch the runners in.
|
|
1581
|
+
|
|
1582
|
+
---
|
|
1583
|
+
|
|
1003
1584
|
### CodeBuildRunnerProps <a name="CodeBuildRunnerProps" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps"></a>
|
|
1004
1585
|
|
|
1005
1586
|
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.Initializer"></a>
|
|
@@ -1015,8 +1596,8 @@ const codeBuildRunnerProps: CodeBuildRunnerProps = { ... }
|
|
|
1015
1596
|
| **Name** | **Type** | **Description** |
|
|
1016
1597
|
| --- | --- | --- |
|
|
1017
1598
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
1018
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.runnerVersion">runnerVersion</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a></code> | Version of GitHub Runners to install. |
|
|
1019
1599
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.computeType">computeType</a></code> | <code>aws-cdk-lib.aws_codebuild.ComputeType</code> | The type of compute to use for this build. |
|
|
1600
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.imageBuilder">imageBuilder</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a></code> | Provider running an image to run inside CodeBuild with GitHub runner pre-configured. |
|
|
1020
1601
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.label">label</a></code> | <code>string</code> | GitHub Actions label used for this provider. |
|
|
1021
1602
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security Group to assign to this instance. |
|
|
1022
1603
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.subnetSelection">subnetSelection</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | Where to place the network interfaces within the VPC. |
|
|
@@ -1042,31 +1623,33 @@ remove the retention policy, set the value to `INFINITE`.
|
|
|
1042
1623
|
|
|
1043
1624
|
---
|
|
1044
1625
|
|
|
1045
|
-
##### `
|
|
1626
|
+
##### `computeType`<sup>Optional</sup> <a name="computeType" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.computeType"></a>
|
|
1046
1627
|
|
|
1047
1628
|
```typescript
|
|
1048
|
-
public readonly
|
|
1629
|
+
public readonly computeType: ComputeType;
|
|
1049
1630
|
```
|
|
1050
1631
|
|
|
1051
|
-
- *Type:*
|
|
1052
|
-
- *Default:*
|
|
1632
|
+
- *Type:* aws-cdk-lib.aws_codebuild.ComputeType
|
|
1633
|
+
- *Default:* {@link ComputeType#SMALL}
|
|
1053
1634
|
|
|
1054
|
-
|
|
1635
|
+
The type of compute to use for this build.
|
|
1636
|
+
|
|
1637
|
+
See the {@link ComputeType} enum for the possible values.
|
|
1055
1638
|
|
|
1056
1639
|
---
|
|
1057
1640
|
|
|
1058
|
-
##### `
|
|
1641
|
+
##### `imageBuilder`<sup>Optional</sup> <a name="imageBuilder" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProps.property.imageBuilder"></a>
|
|
1059
1642
|
|
|
1060
1643
|
```typescript
|
|
1061
|
-
public readonly
|
|
1644
|
+
public readonly imageBuilder: IImageBuilder;
|
|
1062
1645
|
```
|
|
1063
1646
|
|
|
1064
|
-
- *Type:*
|
|
1065
|
-
- *Default:*
|
|
1647
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a>
|
|
1648
|
+
- *Default:* image builder with `CodeBuildRunner.LINUX_X64_DOCKERFILE_PATH` as Dockerfile
|
|
1066
1649
|
|
|
1067
|
-
|
|
1650
|
+
Provider running an image to run inside CodeBuild with GitHub runner pre-configured.
|
|
1068
1651
|
|
|
1069
|
-
|
|
1652
|
+
A user named `runner` is expected to exist with access to Docker-in-Docker.
|
|
1070
1653
|
|
|
1071
1654
|
---
|
|
1072
1655
|
|
|
@@ -1155,11 +1738,11 @@ const fargateRunnerProps: FargateRunnerProps = { ... }
|
|
|
1155
1738
|
| **Name** | **Type** | **Description** |
|
|
1156
1739
|
| --- | --- | --- |
|
|
1157
1740
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
1158
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.runnerVersion">runnerVersion</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a></code> | Version of GitHub Runners to install. |
|
|
1159
1741
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | Assign public IP to the runner task. |
|
|
1160
1742
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.cluster">cluster</a></code> | <code>aws-cdk-lib.aws_ecs.Cluster</code> | Existing Fargate cluster to use. |
|
|
1161
1743
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.cpu">cpu</a></code> | <code>number</code> | The number of cpu units used by the task. |
|
|
1162
1744
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.ephemeralStorageGiB">ephemeralStorageGiB</a></code> | <code>number</code> | The amount (in GiB) of ephemeral storage to be allocated to the task. |
|
|
1745
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.imageBuilder">imageBuilder</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a></code> | Provider running an image to run inside CodeBuild with GitHub runner pre-configured. |
|
|
1163
1746
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.label">label</a></code> | <code>string</code> | GitHub Actions label used for this provider. |
|
|
1164
1747
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.memoryLimitMiB">memoryLimitMiB</a></code> | <code>number</code> | The amount (in MiB) of memory used by the task. |
|
|
1165
1748
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security Group to assign to the task. |
|
|
@@ -1185,19 +1768,6 @@ remove the retention policy, set the value to `INFINITE`.
|
|
|
1185
1768
|
|
|
1186
1769
|
---
|
|
1187
1770
|
|
|
1188
|
-
##### `runnerVersion`<sup>Optional</sup> <a name="runnerVersion" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.runnerVersion"></a>
|
|
1189
|
-
|
|
1190
|
-
```typescript
|
|
1191
|
-
public readonly runnerVersion: RunnerVersion;
|
|
1192
|
-
```
|
|
1193
|
-
|
|
1194
|
-
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a>
|
|
1195
|
-
- *Default:* latest version available
|
|
1196
|
-
|
|
1197
|
-
Version of GitHub Runners to install.
|
|
1198
|
-
|
|
1199
|
-
---
|
|
1200
|
-
|
|
1201
1771
|
##### `assignPublicIp`<sup>Optional</sup> <a name="assignPublicIp" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.assignPublicIp"></a>
|
|
1202
1772
|
|
|
1203
1773
|
```typescript
|
|
@@ -1270,6 +1840,31 @@ NOTE: This parameter is only supported for tasks hosted on AWS Fargate using pla
|
|
|
1270
1840
|
|
|
1271
1841
|
---
|
|
1272
1842
|
|
|
1843
|
+
##### `imageBuilder`<sup>Optional</sup> <a name="imageBuilder" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.imageBuilder"></a>
|
|
1844
|
+
|
|
1845
|
+
```typescript
|
|
1846
|
+
public readonly imageBuilder: IImageBuilder;
|
|
1847
|
+
```
|
|
1848
|
+
|
|
1849
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a>
|
|
1850
|
+
- *Default:* image builder with `FargateRunner.LINUX_X64_DOCKERFILE_PATH` as Dockerfile
|
|
1851
|
+
|
|
1852
|
+
Provider running an image to run inside CodeBuild with GitHub runner pre-configured.
|
|
1853
|
+
|
|
1854
|
+
A user named `runner` is expected to exist.
|
|
1855
|
+
|
|
1856
|
+
The entry point should start GitHub runner. For example:
|
|
1857
|
+
|
|
1858
|
+
```
|
|
1859
|
+
#!/bin/bash
|
|
1860
|
+
set -e -u -o pipefail
|
|
1861
|
+
|
|
1862
|
+
/home/runner/config.sh --unattended --url "https://${GITHUB_DOMAIN}/${OWNER}/${REPO}" --token "${RUNNER_TOKEN}" --ephemeral --work _work --labels "${RUNNER_LABEL}" --disableupdate --name "${RUNNER_NAME}"
|
|
1863
|
+
/home/runner/run.sh
|
|
1864
|
+
```
|
|
1865
|
+
|
|
1866
|
+
---
|
|
1867
|
+
|
|
1273
1868
|
##### `label`<sup>Optional</sup> <a name="label" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.label"></a>
|
|
1274
1869
|
|
|
1275
1870
|
```typescript
|
|
@@ -1401,8 +1996,8 @@ const lambdaRunnerProps: LambdaRunnerProps = { ... }
|
|
|
1401
1996
|
| **Name** | **Type** | **Description** |
|
|
1402
1997
|
| --- | --- | --- |
|
|
1403
1998
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
1404
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.runnerVersion">runnerVersion</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a></code> | Version of GitHub Runners to install. |
|
|
1405
1999
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.ephemeralStorageSize">ephemeralStorageSize</a></code> | <code>aws-cdk-lib.Size</code> | The size of the function’s /tmp directory in MiB. |
|
|
2000
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.imageBuilder">imageBuilder</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a></code> | Provider running an image to run inside CodeBuild with GitHub runner pre-configured. |
|
|
1406
2001
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.label">label</a></code> | <code>string</code> | GitHub Actions label used for this provider. |
|
|
1407
2002
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.memorySize">memorySize</a></code> | <code>number</code> | The amount of memory, in MB, that is allocated to your Lambda function. |
|
|
1408
2003
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security Group to assign to this instance. |
|
|
@@ -1429,29 +2024,33 @@ remove the retention policy, set the value to `INFINITE`.
|
|
|
1429
2024
|
|
|
1430
2025
|
---
|
|
1431
2026
|
|
|
1432
|
-
##### `
|
|
2027
|
+
##### `ephemeralStorageSize`<sup>Optional</sup> <a name="ephemeralStorageSize" id="@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.ephemeralStorageSize"></a>
|
|
1433
2028
|
|
|
1434
2029
|
```typescript
|
|
1435
|
-
public readonly
|
|
2030
|
+
public readonly ephemeralStorageSize: Size;
|
|
1436
2031
|
```
|
|
1437
2032
|
|
|
1438
|
-
- *Type:*
|
|
1439
|
-
- *Default:*
|
|
2033
|
+
- *Type:* aws-cdk-lib.Size
|
|
2034
|
+
- *Default:* 10 GiB
|
|
1440
2035
|
|
|
1441
|
-
|
|
2036
|
+
The size of the function’s /tmp directory in MiB.
|
|
1442
2037
|
|
|
1443
2038
|
---
|
|
1444
2039
|
|
|
1445
|
-
##### `
|
|
2040
|
+
##### `imageBuilder`<sup>Optional</sup> <a name="imageBuilder" id="@cloudsnorkel/cdk-github-runners.LambdaRunnerProps.property.imageBuilder"></a>
|
|
1446
2041
|
|
|
1447
2042
|
```typescript
|
|
1448
|
-
public readonly
|
|
2043
|
+
public readonly imageBuilder: IImageBuilder;
|
|
1449
2044
|
```
|
|
1450
2045
|
|
|
1451
|
-
- *Type:*
|
|
1452
|
-
- *Default:*
|
|
2046
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a>
|
|
2047
|
+
- *Default:* image builder with LambdaRunner.LINUX_X64_DOCKERFILE_PATH as Dockerfile
|
|
1453
2048
|
|
|
1454
|
-
|
|
2049
|
+
Provider running an image to run inside CodeBuild with GitHub runner pre-configured.
|
|
2050
|
+
|
|
2051
|
+
The default command (`CMD`) should be `["runner.handler"]` which points to an included `runner.js` with a function named `handler`. The function should start the GitHub runner.
|
|
2052
|
+
|
|
2053
|
+
> [https://github.com/CloudSnorkel/cdk-github-runners/tree/main/src/providers/docker-images/lambda](https://github.com/CloudSnorkel/cdk-github-runners/tree/main/src/providers/docker-images/lambda)
|
|
1455
2054
|
|
|
1456
2055
|
---
|
|
1457
2056
|
|
|
@@ -1540,6 +2139,90 @@ VPC to launch the runners in.
|
|
|
1540
2139
|
|
|
1541
2140
|
---
|
|
1542
2141
|
|
|
2142
|
+
### RunnerImage <a name="RunnerImage" id="@cloudsnorkel/cdk-github-runners.RunnerImage"></a>
|
|
2143
|
+
|
|
2144
|
+
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.RunnerImage.Initializer"></a>
|
|
2145
|
+
|
|
2146
|
+
```typescript
|
|
2147
|
+
import { RunnerImage } from '@cloudsnorkel/cdk-github-runners'
|
|
2148
|
+
|
|
2149
|
+
const runnerImage: RunnerImage = { ... }
|
|
2150
|
+
```
|
|
2151
|
+
|
|
2152
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2153
|
+
|
|
2154
|
+
| **Name** | **Type** | **Description** |
|
|
2155
|
+
| --- | --- | --- |
|
|
2156
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.architecture">architecture</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | Architecture of the image. |
|
|
2157
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageDigest">imageDigest</a></code> | <code>string</code> | Image digest for providers that need to know the digest like Lambda. |
|
|
2158
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageRepository">imageRepository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | ECR repository containing the image. |
|
|
2159
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageTag">imageTag</a></code> | <code>string</code> | Static image tag where the image will be pushed. |
|
|
2160
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.os">os</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a></code> | OS type of the image. |
|
|
2161
|
+
|
|
2162
|
+
---
|
|
2163
|
+
|
|
2164
|
+
##### `architecture`<sup>Required</sup> <a name="architecture" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.architecture"></a>
|
|
2165
|
+
|
|
2166
|
+
```typescript
|
|
2167
|
+
public readonly architecture: Architecture;
|
|
2168
|
+
```
|
|
2169
|
+
|
|
2170
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2171
|
+
|
|
2172
|
+
Architecture of the image.
|
|
2173
|
+
|
|
2174
|
+
---
|
|
2175
|
+
|
|
2176
|
+
##### `imageDigest`<sup>Required</sup> <a name="imageDigest" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageDigest"></a>
|
|
2177
|
+
|
|
2178
|
+
```typescript
|
|
2179
|
+
public readonly imageDigest: string;
|
|
2180
|
+
```
|
|
2181
|
+
|
|
2182
|
+
- *Type:* string
|
|
2183
|
+
|
|
2184
|
+
Image digest for providers that need to know the digest like Lambda.
|
|
2185
|
+
|
|
2186
|
+
WARNING: the digest might change when the builder automatically rebuilds the image on a schedule. Do not expect for this digest to stay the same between deploys.
|
|
2187
|
+
|
|
2188
|
+
---
|
|
2189
|
+
|
|
2190
|
+
##### `imageRepository`<sup>Required</sup> <a name="imageRepository" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageRepository"></a>
|
|
2191
|
+
|
|
2192
|
+
```typescript
|
|
2193
|
+
public readonly imageRepository: IRepository;
|
|
2194
|
+
```
|
|
2195
|
+
|
|
2196
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
2197
|
+
|
|
2198
|
+
ECR repository containing the image.
|
|
2199
|
+
|
|
2200
|
+
---
|
|
2201
|
+
|
|
2202
|
+
##### `imageTag`<sup>Required</sup> <a name="imageTag" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageTag"></a>
|
|
2203
|
+
|
|
2204
|
+
```typescript
|
|
2205
|
+
public readonly imageTag: string;
|
|
2206
|
+
```
|
|
2207
|
+
|
|
2208
|
+
- *Type:* string
|
|
2209
|
+
|
|
2210
|
+
Static image tag where the image will be pushed.
|
|
2211
|
+
|
|
2212
|
+
---
|
|
2213
|
+
|
|
2214
|
+
##### `os`<sup>Required</sup> <a name="os" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.os"></a>
|
|
2215
|
+
|
|
2216
|
+
```typescript
|
|
2217
|
+
public readonly os: Os;
|
|
2218
|
+
```
|
|
2219
|
+
|
|
2220
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2221
|
+
|
|
2222
|
+
OS type of the image.
|
|
2223
|
+
|
|
2224
|
+
---
|
|
2225
|
+
|
|
1543
2226
|
### RunnerProviderProps <a name="RunnerProviderProps" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps"></a>
|
|
1544
2227
|
|
|
1545
2228
|
Common properties for all runner providers.
|
|
@@ -1557,7 +2240,6 @@ const runnerProviderProps: RunnerProviderProps = { ... }
|
|
|
1557
2240
|
| **Name** | **Type** | **Description** |
|
|
1558
2241
|
| --- | --- | --- |
|
|
1559
2242
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
1560
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.runnerVersion">runnerVersion</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a></code> | Version of GitHub Runners to install. |
|
|
1561
2243
|
|
|
1562
2244
|
---
|
|
1563
2245
|
|
|
@@ -1578,19 +2260,6 @@ remove the retention policy, set the value to `INFINITE`.
|
|
|
1578
2260
|
|
|
1579
2261
|
---
|
|
1580
2262
|
|
|
1581
|
-
##### `runnerVersion`<sup>Optional</sup> <a name="runnerVersion" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.runnerVersion"></a>
|
|
1582
|
-
|
|
1583
|
-
```typescript
|
|
1584
|
-
public readonly runnerVersion: RunnerVersion;
|
|
1585
|
-
```
|
|
1586
|
-
|
|
1587
|
-
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion">RunnerVersion</a>
|
|
1588
|
-
- *Default:* latest version available
|
|
1589
|
-
|
|
1590
|
-
Version of GitHub Runners to install.
|
|
1591
|
-
|
|
1592
|
-
---
|
|
1593
|
-
|
|
1594
2263
|
### RunnerRuntimeParameters <a name="RunnerRuntimeParameters" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters"></a>
|
|
1595
2264
|
|
|
1596
2265
|
Workflow job parameters as parsed from the webhook event. Pass these into your runner executor and run something like:.
|
|
@@ -1687,6 +2356,166 @@ Path to runner token used to register token.
|
|
|
1687
2356
|
|
|
1688
2357
|
## Classes <a name="Classes" id="Classes"></a>
|
|
1689
2358
|
|
|
2359
|
+
### Architecture <a name="Architecture" id="@cloudsnorkel/cdk-github-runners.Architecture"></a>
|
|
2360
|
+
|
|
2361
|
+
CPU architecture enum for an image.
|
|
2362
|
+
|
|
2363
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
2364
|
+
|
|
2365
|
+
| **Name** | **Description** |
|
|
2366
|
+
| --- | --- |
|
|
2367
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture.is">is</a></code> | Checks if the given architecture is the same as this one. |
|
|
2368
|
+
|
|
2369
|
+
---
|
|
2370
|
+
|
|
2371
|
+
##### `is` <a name="is" id="@cloudsnorkel/cdk-github-runners.Architecture.is"></a>
|
|
2372
|
+
|
|
2373
|
+
```typescript
|
|
2374
|
+
public is(arch: Architecture): boolean
|
|
2375
|
+
```
|
|
2376
|
+
|
|
2377
|
+
Checks if the given architecture is the same as this one.
|
|
2378
|
+
|
|
2379
|
+
###### `arch`<sup>Required</sup> <a name="arch" id="@cloudsnorkel/cdk-github-runners.Architecture.is.parameter.arch"></a>
|
|
2380
|
+
|
|
2381
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2382
|
+
|
|
2383
|
+
architecture to compare.
|
|
2384
|
+
|
|
2385
|
+
---
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2389
|
+
|
|
2390
|
+
| **Name** | **Type** | **Description** |
|
|
2391
|
+
| --- | --- | --- |
|
|
2392
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture.property.name">name</a></code> | <code>string</code> | *No description.* |
|
|
2393
|
+
|
|
2394
|
+
---
|
|
2395
|
+
|
|
2396
|
+
##### `name`<sup>Required</sup> <a name="name" id="@cloudsnorkel/cdk-github-runners.Architecture.property.name"></a>
|
|
2397
|
+
|
|
2398
|
+
```typescript
|
|
2399
|
+
public readonly name: string;
|
|
2400
|
+
```
|
|
2401
|
+
|
|
2402
|
+
- *Type:* string
|
|
2403
|
+
|
|
2404
|
+
---
|
|
2405
|
+
|
|
2406
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
2407
|
+
|
|
2408
|
+
| **Name** | **Type** | **Description** |
|
|
2409
|
+
| --- | --- | --- |
|
|
2410
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture.property.ARM64">ARM64</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | ARM64. |
|
|
2411
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture.property.X86_64">X86_64</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | X86_64. |
|
|
2412
|
+
|
|
2413
|
+
---
|
|
2414
|
+
|
|
2415
|
+
##### `ARM64`<sup>Required</sup> <a name="ARM64" id="@cloudsnorkel/cdk-github-runners.Architecture.property.ARM64"></a>
|
|
2416
|
+
|
|
2417
|
+
```typescript
|
|
2418
|
+
public readonly ARM64: Architecture;
|
|
2419
|
+
```
|
|
2420
|
+
|
|
2421
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2422
|
+
|
|
2423
|
+
ARM64.
|
|
2424
|
+
|
|
2425
|
+
---
|
|
2426
|
+
|
|
2427
|
+
##### `X86_64`<sup>Required</sup> <a name="X86_64" id="@cloudsnorkel/cdk-github-runners.Architecture.property.X86_64"></a>
|
|
2428
|
+
|
|
2429
|
+
```typescript
|
|
2430
|
+
public readonly X86_64: Architecture;
|
|
2431
|
+
```
|
|
2432
|
+
|
|
2433
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2434
|
+
|
|
2435
|
+
X86_64.
|
|
2436
|
+
|
|
2437
|
+
---
|
|
2438
|
+
|
|
2439
|
+
### Os <a name="Os" id="@cloudsnorkel/cdk-github-runners.Os"></a>
|
|
2440
|
+
|
|
2441
|
+
OS enum for an image.
|
|
2442
|
+
|
|
2443
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
2444
|
+
|
|
2445
|
+
| **Name** | **Description** |
|
|
2446
|
+
| --- | --- |
|
|
2447
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Os.is">is</a></code> | Checks if the given OS is the same as this one. |
|
|
2448
|
+
|
|
2449
|
+
---
|
|
2450
|
+
|
|
2451
|
+
##### `is` <a name="is" id="@cloudsnorkel/cdk-github-runners.Os.is"></a>
|
|
2452
|
+
|
|
2453
|
+
```typescript
|
|
2454
|
+
public is(os: Os): boolean
|
|
2455
|
+
```
|
|
2456
|
+
|
|
2457
|
+
Checks if the given OS is the same as this one.
|
|
2458
|
+
|
|
2459
|
+
###### `os`<sup>Required</sup> <a name="os" id="@cloudsnorkel/cdk-github-runners.Os.is.parameter.os"></a>
|
|
2460
|
+
|
|
2461
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2462
|
+
|
|
2463
|
+
OS to compare.
|
|
2464
|
+
|
|
2465
|
+
---
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2469
|
+
|
|
2470
|
+
| **Name** | **Type** | **Description** |
|
|
2471
|
+
| --- | --- | --- |
|
|
2472
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Os.property.name">name</a></code> | <code>string</code> | *No description.* |
|
|
2473
|
+
|
|
2474
|
+
---
|
|
2475
|
+
|
|
2476
|
+
##### `name`<sup>Required</sup> <a name="name" id="@cloudsnorkel/cdk-github-runners.Os.property.name"></a>
|
|
2477
|
+
|
|
2478
|
+
```typescript
|
|
2479
|
+
public readonly name: string;
|
|
2480
|
+
```
|
|
2481
|
+
|
|
2482
|
+
- *Type:* string
|
|
2483
|
+
|
|
2484
|
+
---
|
|
2485
|
+
|
|
2486
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
2487
|
+
|
|
2488
|
+
| **Name** | **Type** | **Description** |
|
|
2489
|
+
| --- | --- | --- |
|
|
2490
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Os.property.LINUX">LINUX</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a></code> | Linux. |
|
|
2491
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Os.property.WINDOWS">WINDOWS</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a></code> | Windows. |
|
|
2492
|
+
|
|
2493
|
+
---
|
|
2494
|
+
|
|
2495
|
+
##### `LINUX`<sup>Required</sup> <a name="LINUX" id="@cloudsnorkel/cdk-github-runners.Os.property.LINUX"></a>
|
|
2496
|
+
|
|
2497
|
+
```typescript
|
|
2498
|
+
public readonly LINUX: Os;
|
|
2499
|
+
```
|
|
2500
|
+
|
|
2501
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2502
|
+
|
|
2503
|
+
Linux.
|
|
2504
|
+
|
|
2505
|
+
---
|
|
2506
|
+
|
|
2507
|
+
##### `WINDOWS`<sup>Required</sup> <a name="WINDOWS" id="@cloudsnorkel/cdk-github-runners.Os.property.WINDOWS"></a>
|
|
2508
|
+
|
|
2509
|
+
```typescript
|
|
2510
|
+
public readonly WINDOWS: Os;
|
|
2511
|
+
```
|
|
2512
|
+
|
|
2513
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2514
|
+
|
|
2515
|
+
Windows.
|
|
2516
|
+
|
|
2517
|
+
---
|
|
2518
|
+
|
|
1690
2519
|
### RunnerVersion <a name="RunnerVersion" id="@cloudsnorkel/cdk-github-runners.RunnerVersion"></a>
|
|
1691
2520
|
|
|
1692
2521
|
Defines desired GitHub Actions runner version.
|
|
@@ -1770,8 +2599,162 @@ public readonly version: string;
|
|
|
1770
2599
|
---
|
|
1771
2600
|
|
|
1772
2601
|
|
|
2602
|
+
### StaticRunnerImage <a name="StaticRunnerImage" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage"></a>
|
|
2603
|
+
|
|
2604
|
+
Helper class with methods to use static images that are built outside the context of this project.
|
|
2605
|
+
|
|
2606
|
+
#### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.Initializer"></a>
|
|
2607
|
+
|
|
2608
|
+
```typescript
|
|
2609
|
+
import { StaticRunnerImage } from '@cloudsnorkel/cdk-github-runners'
|
|
2610
|
+
|
|
2611
|
+
new StaticRunnerImage()
|
|
2612
|
+
```
|
|
2613
|
+
|
|
2614
|
+
| **Name** | **Type** | **Description** |
|
|
2615
|
+
| --- | --- | --- |
|
|
2616
|
+
|
|
2617
|
+
---
|
|
2618
|
+
|
|
2619
|
+
|
|
2620
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
2621
|
+
|
|
2622
|
+
| **Name** | **Description** |
|
|
2623
|
+
| --- | --- |
|
|
2624
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub">fromDockerHub</a></code> | Create a builder from an existing Docker Hub image. |
|
|
2625
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository">fromEcrRepository</a></code> | Create a builder (that doesn't actually build anything) from an existing image in an existing repository. |
|
|
2626
|
+
|
|
2627
|
+
---
|
|
2628
|
+
|
|
2629
|
+
##### `fromDockerHub` <a name="fromDockerHub" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub"></a>
|
|
2630
|
+
|
|
2631
|
+
```typescript
|
|
2632
|
+
import { StaticRunnerImage } from '@cloudsnorkel/cdk-github-runners'
|
|
2633
|
+
|
|
2634
|
+
StaticRunnerImage.fromDockerHub(scope: Construct, id: string, image: string, architecture?: Architecture, os?: Os)
|
|
2635
|
+
```
|
|
2636
|
+
|
|
2637
|
+
Create a builder from an existing Docker Hub image.
|
|
2638
|
+
|
|
2639
|
+
The image must already have GitHub Actions runner installed. You are responsible to update it and remove it when done.
|
|
2640
|
+
|
|
2641
|
+
We create a CodeBuild image builder behind the scenes to copy the image over to ECR. This helps avoid Docker Hub rate limits and prevent failures.
|
|
2642
|
+
|
|
2643
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub.parameter.scope"></a>
|
|
2644
|
+
|
|
2645
|
+
- *Type:* constructs.Construct
|
|
2646
|
+
|
|
2647
|
+
---
|
|
2648
|
+
|
|
2649
|
+
###### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub.parameter.id"></a>
|
|
2650
|
+
|
|
2651
|
+
- *Type:* string
|
|
2652
|
+
|
|
2653
|
+
---
|
|
2654
|
+
|
|
2655
|
+
###### `image`<sup>Required</sup> <a name="image" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub.parameter.image"></a>
|
|
2656
|
+
|
|
2657
|
+
- *Type:* string
|
|
2658
|
+
|
|
2659
|
+
Docker Hub image with optional tag.
|
|
2660
|
+
|
|
2661
|
+
---
|
|
2662
|
+
|
|
2663
|
+
###### `architecture`<sup>Optional</sup> <a name="architecture" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub.parameter.architecture"></a>
|
|
2664
|
+
|
|
2665
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2666
|
+
|
|
2667
|
+
image architecture.
|
|
2668
|
+
|
|
2669
|
+
---
|
|
2670
|
+
|
|
2671
|
+
###### `os`<sup>Optional</sup> <a name="os" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromDockerHub.parameter.os"></a>
|
|
2672
|
+
|
|
2673
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2674
|
+
|
|
2675
|
+
image OS.
|
|
2676
|
+
|
|
2677
|
+
---
|
|
2678
|
+
|
|
2679
|
+
##### `fromEcrRepository` <a name="fromEcrRepository" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository"></a>
|
|
2680
|
+
|
|
2681
|
+
```typescript
|
|
2682
|
+
import { StaticRunnerImage } from '@cloudsnorkel/cdk-github-runners'
|
|
2683
|
+
|
|
2684
|
+
StaticRunnerImage.fromEcrRepository(repository: IRepository, tag?: string, architecture?: Architecture, os?: Os)
|
|
2685
|
+
```
|
|
2686
|
+
|
|
2687
|
+
Create a builder (that doesn't actually build anything) from an existing image in an existing repository.
|
|
2688
|
+
|
|
2689
|
+
The image must already have GitHub Actions runner installed. You are responsible to update it and remove it when done.
|
|
2690
|
+
|
|
2691
|
+
###### `repository`<sup>Required</sup> <a name="repository" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository.parameter.repository"></a>
|
|
2692
|
+
|
|
2693
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
2694
|
+
|
|
2695
|
+
ECR repository.
|
|
2696
|
+
|
|
2697
|
+
---
|
|
2698
|
+
|
|
2699
|
+
###### `tag`<sup>Optional</sup> <a name="tag" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository.parameter.tag"></a>
|
|
2700
|
+
|
|
2701
|
+
- *Type:* string
|
|
2702
|
+
|
|
2703
|
+
image tag.
|
|
2704
|
+
|
|
2705
|
+
---
|
|
2706
|
+
|
|
2707
|
+
###### `architecture`<sup>Optional</sup> <a name="architecture" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository.parameter.architecture"></a>
|
|
2708
|
+
|
|
2709
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a>
|
|
2710
|
+
|
|
2711
|
+
image architecture.
|
|
2712
|
+
|
|
2713
|
+
---
|
|
2714
|
+
|
|
2715
|
+
###### `os`<sup>Optional</sup> <a name="os" id="@cloudsnorkel/cdk-github-runners.StaticRunnerImage.fromEcrRepository.parameter.os"></a>
|
|
2716
|
+
|
|
2717
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
2718
|
+
|
|
2719
|
+
image OS.
|
|
2720
|
+
|
|
2721
|
+
---
|
|
2722
|
+
|
|
2723
|
+
|
|
2724
|
+
|
|
1773
2725
|
## Protocols <a name="Protocols" id="Protocols"></a>
|
|
1774
2726
|
|
|
2727
|
+
### IImageBuilder <a name="IImageBuilder" id="@cloudsnorkel/cdk-github-runners.IImageBuilder"></a>
|
|
2728
|
+
|
|
2729
|
+
- *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilder">CodeBuildImageBuilder</a>, <a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder">IImageBuilder</a>
|
|
2730
|
+
|
|
2731
|
+
Interface for constructs that build an image that can be used in {@link IRunnerProvider}.
|
|
2732
|
+
|
|
2733
|
+
Anything that ends up with an ECR repository containing a Docker image that runs GitHub self-hosted runners can be used. A simple implementation could even point to an existing image and nothing else.
|
|
2734
|
+
|
|
2735
|
+
It's important that the specified image tag be available at the time the repository is available. Providers usually assume the image is ready and will fail if it's not.
|
|
2736
|
+
|
|
2737
|
+
The image can be further updated over time manually or using a schedule as long as it is always written to the same tag.
|
|
2738
|
+
|
|
2739
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
2740
|
+
|
|
2741
|
+
| **Name** | **Description** |
|
|
2742
|
+
| --- | --- |
|
|
2743
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.IImageBuilder.bind">bind</a></code> | ECR repository containing the image. |
|
|
2744
|
+
|
|
2745
|
+
---
|
|
2746
|
+
|
|
2747
|
+
##### `bind` <a name="bind" id="@cloudsnorkel/cdk-github-runners.IImageBuilder.bind"></a>
|
|
2748
|
+
|
|
2749
|
+
```typescript
|
|
2750
|
+
public bind(): RunnerImage
|
|
2751
|
+
```
|
|
2752
|
+
|
|
2753
|
+
ECR repository containing the image.
|
|
2754
|
+
|
|
2755
|
+
This method can be called multiple times if the image is bound to multiple providers. Make sure you cache the image when implementing or return an error if this builder doesn't support reusing images.
|
|
2756
|
+
|
|
2757
|
+
|
|
1775
2758
|
### IRunnerProvider <a name="IRunnerProvider" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider"></a>
|
|
1776
2759
|
|
|
1777
2760
|
- *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable
|