@cloudsnorkel/cdk-github-runners 0.14.14 → 0.14.16
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/.jsii +832 -287
- package/API.md +576 -6
- package/README.md +149 -0
- package/SETUP_GITHUB.md +99 -3
- package/assets/delete-failed-runner.lambda/index.js +40 -31
- package/assets/idle-runner-repear.lambda/index.js +40 -31
- package/assets/providers/lambda-runner.sh +2 -1
- package/assets/setup.lambda/index.html +12 -7
- package/assets/setup.lambda/index.js +26 -26
- package/assets/status.lambda/index.js +40 -31
- package/assets/token-retriever.lambda/index.js +40 -31
- package/assets/webhook-handler.lambda/index.js +110 -43
- package/assets/webhook-redelivery.lambda/index.js +40 -31
- package/lib/access.js +1 -1
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/ami.d.ts +1 -2
- package/lib/image-builders/aws-image-builder/ami.js +6 -13
- package/lib/image-builders/aws-image-builder/builder.d.ts +4 -2
- package/lib/image-builders/aws-image-builder/builder.js +36 -34
- package/lib/image-builders/aws-image-builder/container.d.ts +2 -2
- package/lib/image-builders/aws-image-builder/container.js +7 -12
- package/lib/image-builders/aws-image-builder/deprecated/ami.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/container.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
- package/lib/image-builders/aws-image-builder/index.d.ts +0 -1
- package/lib/image-builders/aws-image-builder/index.js +1 -2
- package/lib/image-builders/aws-image-builder/workflow.d.ts +4 -4
- package/lib/image-builders/aws-image-builder/workflow.js +7 -10
- package/lib/image-builders/codebuild-deprecated.js +1 -1
- package/lib/image-builders/components.js +1 -1
- package/lib/image-builders/static.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/providers/codebuild.d.ts +1 -0
- package/lib/providers/codebuild.js +22 -9
- package/lib/providers/common.d.ts +59 -0
- package/lib/providers/common.js +11 -4
- package/lib/providers/composite.d.ts +61 -0
- package/lib/providers/composite.js +229 -0
- package/lib/providers/ec2.d.ts +1 -0
- package/lib/providers/ec2.js +22 -13
- package/lib/providers/ecs.d.ts +4 -0
- package/lib/providers/ecs.js +16 -6
- package/lib/providers/fargate.d.ts +1 -0
- package/lib/providers/fargate.js +19 -9
- package/lib/providers/index.d.ts +1 -0
- package/lib/providers/index.js +2 -1
- package/lib/providers/lambda.d.ts +1 -0
- package/lib/providers/lambda.js +8 -5
- package/lib/runner.d.ts +29 -5
- package/lib/runner.js +57 -24
- package/lib/secrets.js +1 -1
- package/lib/webhook-handler.lambda.d.ts +11 -0
- package/lib/webhook-handler.lambda.js +81 -14
- package/lib/webhook.d.ts +52 -7
- package/lib/webhook.js +4 -2
- package/package.json +16 -20
- package/assets/image-builders/aws-image-builder/versioner.lambda/index.js +0 -2115
- package/lib/image-builders/aws-image-builder/common.d.ts +0 -10
- package/lib/image-builders/aws-image-builder/common.js +0 -48
- package/lib/image-builders/aws-image-builder/versioner-function.d.ts +0 -13
- package/lib/image-builders/aws-image-builder/versioner-function.js +0 -23
- package/lib/image-builders/aws-image-builder/versioner.lambda.d.ts +0 -7
- package/lib/image-builders/aws-image-builder/versioner.lambda.js +0 -115
package/API.md
CHANGED
|
@@ -3539,7 +3539,7 @@ Any object.
|
|
|
3539
3539
|
| --- | --- | --- |
|
|
3540
3540
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
3541
3541
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | Manage the connections of all management functions. |
|
|
3542
|
-
| <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. |
|
|
3542
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a> \| <a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider">ICompositeProvider</a>[]</code> | Configured runner providers. |
|
|
3543
3543
|
| <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. |
|
|
3544
3544
|
| <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.* |
|
|
3545
3545
|
|
|
@@ -3576,10 +3576,10 @@ This cannot be used to manage connections of the runners. Use the `connections`
|
|
|
3576
3576
|
##### `providers`<sup>Required</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers"></a>
|
|
3577
3577
|
|
|
3578
3578
|
```typescript
|
|
3579
|
-
public readonly providers: IRunnerProvider[];
|
|
3579
|
+
public readonly providers: (IRunnerProvider | ICompositeProvider)[];
|
|
3580
3580
|
```
|
|
3581
3581
|
|
|
3582
|
-
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
|
|
3582
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a> | <a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider">ICompositeProvider</a>[]
|
|
3583
3583
|
|
|
3584
3584
|
Configured runner providers.
|
|
3585
3585
|
|
|
@@ -5694,6 +5694,7 @@ const codeBuildRunnerProviderProps: CodeBuildRunnerProviderProps = { ... }
|
|
|
5694
5694
|
|
|
5695
5695
|
| **Name** | **Type** | **Description** |
|
|
5696
5696
|
| --- | --- | --- |
|
|
5697
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
5697
5698
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
5698
5699
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
5699
5700
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.computeType">computeType</a></code> | <code>aws-cdk-lib.aws_codebuild.ComputeType</code> | The type of compute to use for this build. |
|
|
@@ -5710,6 +5711,21 @@ const codeBuildRunnerProviderProps: CodeBuildRunnerProviderProps = { ... }
|
|
|
5710
5711
|
|
|
5711
5712
|
---
|
|
5712
5713
|
|
|
5714
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.defaultLabels"></a>
|
|
5715
|
+
|
|
5716
|
+
```typescript
|
|
5717
|
+
public readonly defaultLabels: boolean;
|
|
5718
|
+
```
|
|
5719
|
+
|
|
5720
|
+
- *Type:* boolean
|
|
5721
|
+
- *Default:* true
|
|
5722
|
+
|
|
5723
|
+
Add default labels based on OS and architecture of the runner.
|
|
5724
|
+
|
|
5725
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
5726
|
+
|
|
5727
|
+
---
|
|
5728
|
+
|
|
5713
5729
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps.property.logRetention"></a>
|
|
5714
5730
|
|
|
5715
5731
|
```typescript
|
|
@@ -6128,6 +6144,7 @@ const ec2RunnerProviderProps: Ec2RunnerProviderProps = { ... }
|
|
|
6128
6144
|
|
|
6129
6145
|
| **Name** | **Type** | **Description** |
|
|
6130
6146
|
| --- | --- | --- |
|
|
6147
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
6131
6148
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
6132
6149
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
6133
6150
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.amiBuilder">amiBuilder</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageBuilder">IRunnerImageBuilder</a></code> | *No description.* |
|
|
@@ -6147,6 +6164,21 @@ const ec2RunnerProviderProps: Ec2RunnerProviderProps = { ... }
|
|
|
6147
6164
|
|
|
6148
6165
|
---
|
|
6149
6166
|
|
|
6167
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.defaultLabels"></a>
|
|
6168
|
+
|
|
6169
|
+
```typescript
|
|
6170
|
+
public readonly defaultLabels: boolean;
|
|
6171
|
+
```
|
|
6172
|
+
|
|
6173
|
+
- *Type:* boolean
|
|
6174
|
+
- *Default:* true
|
|
6175
|
+
|
|
6176
|
+
Add default labels based on OS and architecture of the runner.
|
|
6177
|
+
|
|
6178
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
6179
|
+
|
|
6180
|
+
---
|
|
6181
|
+
|
|
6150
6182
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.Ec2RunnerProviderProps.property.logRetention"></a>
|
|
6151
6183
|
|
|
6152
6184
|
```typescript
|
|
@@ -6395,6 +6427,7 @@ const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... }
|
|
|
6395
6427
|
|
|
6396
6428
|
| **Name** | **Type** | **Description** |
|
|
6397
6429
|
| --- | --- | --- |
|
|
6430
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
6398
6431
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
6399
6432
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
6400
6433
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | Assign public IP to the runner task. |
|
|
@@ -6422,6 +6455,21 @@ const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... }
|
|
|
6422
6455
|
|
|
6423
6456
|
---
|
|
6424
6457
|
|
|
6458
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.defaultLabels"></a>
|
|
6459
|
+
|
|
6460
|
+
```typescript
|
|
6461
|
+
public readonly defaultLabels: boolean;
|
|
6462
|
+
```
|
|
6463
|
+
|
|
6464
|
+
- *Type:* boolean
|
|
6465
|
+
- *Default:* true
|
|
6466
|
+
|
|
6467
|
+
Add default labels based on OS and architecture of the runner.
|
|
6468
|
+
|
|
6469
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
6470
|
+
|
|
6471
|
+
---
|
|
6472
|
+
|
|
6425
6473
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.logRetention"></a>
|
|
6426
6474
|
|
|
6427
6475
|
```typescript
|
|
@@ -6787,6 +6835,7 @@ const fargateRunnerProviderProps: FargateRunnerProviderProps = { ... }
|
|
|
6787
6835
|
|
|
6788
6836
|
| **Name** | **Type** | **Description** |
|
|
6789
6837
|
| --- | --- | --- |
|
|
6838
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
6790
6839
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
6791
6840
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
6792
6841
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | Assign public IP to the runner task. |
|
|
@@ -6806,6 +6855,21 @@ const fargateRunnerProviderProps: FargateRunnerProviderProps = { ... }
|
|
|
6806
6855
|
|
|
6807
6856
|
---
|
|
6808
6857
|
|
|
6858
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.defaultLabels"></a>
|
|
6859
|
+
|
|
6860
|
+
```typescript
|
|
6861
|
+
public readonly defaultLabels: boolean;
|
|
6862
|
+
```
|
|
6863
|
+
|
|
6864
|
+
- *Type:* boolean
|
|
6865
|
+
- *Default:* true
|
|
6866
|
+
|
|
6867
|
+
Add default labels based on OS and architecture of the runner.
|
|
6868
|
+
|
|
6869
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
6870
|
+
|
|
6871
|
+
---
|
|
6872
|
+
|
|
6809
6873
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps.property.logRetention"></a>
|
|
6810
6874
|
|
|
6811
6875
|
```typescript
|
|
@@ -7157,7 +7221,8 @@ const gitHubRunnersProps: GitHubRunnersProps = { ... }
|
|
|
7157
7221
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.extraCertificates">extraCertificates</a></code> | <code>string</code> | Path to a directory containing a file named certs.pem containing any additional certificates required to trust GitHub Enterprise Server. Use this when GitHub Enterprise Server certificates are self-signed. |
|
|
7158
7222
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.idleTimeout">idleTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | Time to wait before stopping a runner that remains idle. |
|
|
7159
7223
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.logOptions">logOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.LogOptions">LogOptions</a></code> | Logging options for the state machine that manages the runners. |
|
|
7160
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | List of runner providers to use. |
|
|
7224
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a> \| <a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider">ICompositeProvider</a>[]</code> | List of runner providers to use. |
|
|
7225
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providerSelector">providerSelector</a></code> | <code>aws-cdk-lib.aws_lambda.IFunction</code> | Optional Lambda function to customize provider selection logic and label assignment. |
|
|
7161
7226
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.requireSelfHostedLabel">requireSelfHostedLabel</a></code> | <code>boolean</code> | Whether to require the `self-hosted` label. |
|
|
7162
7227
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | Options to retry operation in case of failure like missing capacity, or API quota issues. |
|
|
7163
7228
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group attached to all management functions. |
|
|
@@ -7248,10 +7313,10 @@ Logging options for the state machine that manages the runners.
|
|
|
7248
7313
|
##### `providers`<sup>Optional</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providers"></a>
|
|
7249
7314
|
|
|
7250
7315
|
```typescript
|
|
7251
|
-
public readonly providers: IRunnerProvider[];
|
|
7316
|
+
public readonly providers: (IRunnerProvider | ICompositeProvider)[];
|
|
7252
7317
|
```
|
|
7253
7318
|
|
|
7254
|
-
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
|
|
7319
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a> | <a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider">ICompositeProvider</a>[]
|
|
7255
7320
|
- *Default:* CodeBuild, Lambda and Fargate runners with all the defaults (no VPC or default account VPC)
|
|
7256
7321
|
|
|
7257
7322
|
List of runner providers to use.
|
|
@@ -7260,6 +7325,31 @@ At least one provider is required. Provider will be selected when its label matc
|
|
|
7260
7325
|
|
|
7261
7326
|
---
|
|
7262
7327
|
|
|
7328
|
+
##### `providerSelector`<sup>Optional</sup> <a name="providerSelector" id="@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providerSelector"></a>
|
|
7329
|
+
|
|
7330
|
+
```typescript
|
|
7331
|
+
public readonly providerSelector: IFunction;
|
|
7332
|
+
```
|
|
7333
|
+
|
|
7334
|
+
- *Type:* aws-cdk-lib.aws_lambda.IFunction
|
|
7335
|
+
|
|
7336
|
+
Optional Lambda function to customize provider selection logic and label assignment.
|
|
7337
|
+
|
|
7338
|
+
* The function receives the webhook payload along with default provider and its labels as {@link ProviderSelectorInput }
|
|
7339
|
+
* The function returns a selected provider and its labels as {@link ProviderSelectorResult }
|
|
7340
|
+
* You can decline to provision a runner by returning undefined as the provider selector result
|
|
7341
|
+
* You can fully customize the labels for the about-to-be-provisioned runner (add, remove, modify, dynamic labels, etc.)
|
|
7342
|
+
* Labels don't have to match the labels originally configured for the provider, but see warnings below
|
|
7343
|
+
* This function will be called synchronously during webhook processing, so it should be fast and efficient (webhook limit is 30 seconds total)
|
|
7344
|
+
|
|
7345
|
+
**WARNING: It is your responsibility to ensure the selected provider's labels match the job's required labels. If you return the wrong labels, the runner will be created but GitHub Actions will not assign the job to it.**
|
|
7346
|
+
|
|
7347
|
+
**WARNING: Provider selection is not a guarantee that a specific provider will be assigned for the job. GitHub Actions may assign the job to any runner with matching labels. The provider selector only determines which provider's runner will be *created*, but GitHub Actions may route the job to any available runner with the required labels.**
|
|
7348
|
+
|
|
7349
|
+
**For reliable provider assignment based on job characteristics, consider using repo-level runner registration where you can control which runners are available for specific repositories. See {@link SETUP_GITHUB.md } for more details on the different registration levels. This information is also available while using the setup wizard.
|
|
7350
|
+
|
|
7351
|
+
---
|
|
7352
|
+
|
|
7263
7353
|
##### `requireSelfHostedLabel`<sup>Optional</sup> <a name="requireSelfHostedLabel" id="@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.requireSelfHostedLabel"></a>
|
|
7264
7354
|
|
|
7265
7355
|
```typescript
|
|
@@ -7569,6 +7659,7 @@ const lambdaRunnerProviderProps: LambdaRunnerProviderProps = { ... }
|
|
|
7569
7659
|
|
|
7570
7660
|
| **Name** | **Type** | **Description** |
|
|
7571
7661
|
| --- | --- | --- |
|
|
7662
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
7572
7663
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
7573
7664
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
7574
7665
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.ephemeralStorageSize">ephemeralStorageSize</a></code> | <code>aws-cdk-lib.Size</code> | The size of the function’s /tmp directory in MiB. |
|
|
@@ -7585,6 +7676,21 @@ const lambdaRunnerProviderProps: LambdaRunnerProviderProps = { ... }
|
|
|
7585
7676
|
|
|
7586
7677
|
---
|
|
7587
7678
|
|
|
7679
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.defaultLabels"></a>
|
|
7680
|
+
|
|
7681
|
+
```typescript
|
|
7682
|
+
public readonly defaultLabels: boolean;
|
|
7683
|
+
```
|
|
7684
|
+
|
|
7685
|
+
- *Type:* boolean
|
|
7686
|
+
- *Default:* true
|
|
7687
|
+
|
|
7688
|
+
Add default labels based on OS and architecture of the runner.
|
|
7689
|
+
|
|
7690
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
7691
|
+
|
|
7692
|
+
---
|
|
7693
|
+
|
|
7588
7694
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.LambdaRunnerProviderProps.property.logRetention"></a>
|
|
7589
7695
|
|
|
7590
7696
|
```typescript
|
|
@@ -7942,6 +8048,138 @@ Which failures generate a retry depends on the specific provider.
|
|
|
7942
8048
|
|
|
7943
8049
|
---
|
|
7944
8050
|
|
|
8051
|
+
### ProviderSelectorInput <a name="ProviderSelectorInput" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput"></a>
|
|
8052
|
+
|
|
8053
|
+
Input to the provider selector Lambda function.
|
|
8054
|
+
|
|
8055
|
+
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.Initializer"></a>
|
|
8056
|
+
|
|
8057
|
+
```typescript
|
|
8058
|
+
import { ProviderSelectorInput } from '@cloudsnorkel/cdk-github-runners'
|
|
8059
|
+
|
|
8060
|
+
const providerSelectorInput: ProviderSelectorInput = { ... }
|
|
8061
|
+
```
|
|
8062
|
+
|
|
8063
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
8064
|
+
|
|
8065
|
+
| **Name** | **Type** | **Description** |
|
|
8066
|
+
| --- | --- | --- |
|
|
8067
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.payload">payload</a></code> | <code>any</code> | Full GitHub webhook payload (workflow_job event structure with action="queued"). |
|
|
8068
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.providers">providers</a></code> | <code>{[ key: string ]: string[]}</code> | Map of available provider node paths to their configured labels. |
|
|
8069
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.defaultLabels">defaultLabels</a></code> | <code>string[]</code> | Labels that would have been used by default (the selected provider's labels). |
|
|
8070
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.defaultProvider">defaultProvider</a></code> | <code>string</code> | Provider node path that would have been selected by default label matching. |
|
|
8071
|
+
|
|
8072
|
+
---
|
|
8073
|
+
|
|
8074
|
+
##### `payload`<sup>Required</sup> <a name="payload" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.payload"></a>
|
|
8075
|
+
|
|
8076
|
+
```typescript
|
|
8077
|
+
public readonly payload: any;
|
|
8078
|
+
```
|
|
8079
|
+
|
|
8080
|
+
- *Type:* any
|
|
8081
|
+
|
|
8082
|
+
Full GitHub webhook payload (workflow_job event structure with action="queued").
|
|
8083
|
+
|
|
8084
|
+
* Original labels requested by the workflow job can be found at `payload.workflow_job.labels`.
|
|
8085
|
+
* Repository path (e.g. CloudSnorkel/cdk-github-runners) is at `payload.repository.full_name`.
|
|
8086
|
+
* Commit hash is at `payload.workflow_job.head_sha`.
|
|
8087
|
+
|
|
8088
|
+
> [https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=queued#workflow_job](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=queued#workflow_job)
|
|
8089
|
+
|
|
8090
|
+
---
|
|
8091
|
+
|
|
8092
|
+
##### `providers`<sup>Required</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.providers"></a>
|
|
8093
|
+
|
|
8094
|
+
```typescript
|
|
8095
|
+
public readonly providers: {[ key: string ]: string[]};
|
|
8096
|
+
```
|
|
8097
|
+
|
|
8098
|
+
- *Type:* {[ key: string ]: string[]}
|
|
8099
|
+
|
|
8100
|
+
Map of available provider node paths to their configured labels.
|
|
8101
|
+
|
|
8102
|
+
Example: { "MyStack/Small": ["linux", "small"], "MyStack/Large": ["linux", "large"] }
|
|
8103
|
+
|
|
8104
|
+
---
|
|
8105
|
+
|
|
8106
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.defaultLabels"></a>
|
|
8107
|
+
|
|
8108
|
+
```typescript
|
|
8109
|
+
public readonly defaultLabels: string[];
|
|
8110
|
+
```
|
|
8111
|
+
|
|
8112
|
+
- *Type:* string[]
|
|
8113
|
+
|
|
8114
|
+
Labels that would have been used by default (the selected provider's labels).
|
|
8115
|
+
|
|
8116
|
+
May be undefined if no provider matched by default.
|
|
8117
|
+
|
|
8118
|
+
---
|
|
8119
|
+
|
|
8120
|
+
##### `defaultProvider`<sup>Optional</sup> <a name="defaultProvider" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorInput.property.defaultProvider"></a>
|
|
8121
|
+
|
|
8122
|
+
```typescript
|
|
8123
|
+
public readonly defaultProvider: string;
|
|
8124
|
+
```
|
|
8125
|
+
|
|
8126
|
+
- *Type:* string
|
|
8127
|
+
|
|
8128
|
+
Provider node path that would have been selected by default label matching.
|
|
8129
|
+
|
|
8130
|
+
Use this to easily return the default selection: `{ provider: input.defaultProvider, labels: input.defaultLabels }`
|
|
8131
|
+
May be undefined if no provider matched by default.
|
|
8132
|
+
|
|
8133
|
+
---
|
|
8134
|
+
|
|
8135
|
+
### ProviderSelectorResult <a name="ProviderSelectorResult" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorResult"></a>
|
|
8136
|
+
|
|
8137
|
+
Result from the provider selector Lambda function.
|
|
8138
|
+
|
|
8139
|
+
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorResult.Initializer"></a>
|
|
8140
|
+
|
|
8141
|
+
```typescript
|
|
8142
|
+
import { ProviderSelectorResult } from '@cloudsnorkel/cdk-github-runners'
|
|
8143
|
+
|
|
8144
|
+
const providerSelectorResult: ProviderSelectorResult = { ... }
|
|
8145
|
+
```
|
|
8146
|
+
|
|
8147
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
8148
|
+
|
|
8149
|
+
| **Name** | **Type** | **Description** |
|
|
8150
|
+
| --- | --- | --- |
|
|
8151
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorResult.property.labels">labels</a></code> | <code>string[]</code> | Labels to use when registering the runner. |
|
|
8152
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderSelectorResult.property.provider">provider</a></code> | <code>string</code> | Node path of the provider to use (e.g., "MyStack/MyProvider"). Must match one of the configured provider node paths from the input. If not provided, the job will be skipped (no runner created). |
|
|
8153
|
+
|
|
8154
|
+
---
|
|
8155
|
+
|
|
8156
|
+
##### `labels`<sup>Optional</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorResult.property.labels"></a>
|
|
8157
|
+
|
|
8158
|
+
```typescript
|
|
8159
|
+
public readonly labels: string[];
|
|
8160
|
+
```
|
|
8161
|
+
|
|
8162
|
+
- *Type:* string[]
|
|
8163
|
+
|
|
8164
|
+
Labels to use when registering the runner.
|
|
8165
|
+
|
|
8166
|
+
Must be returned when a provider is selected.
|
|
8167
|
+
Can be used to add, remove, or modify labels.
|
|
8168
|
+
|
|
8169
|
+
---
|
|
8170
|
+
|
|
8171
|
+
##### `provider`<sup>Optional</sup> <a name="provider" id="@cloudsnorkel/cdk-github-runners.ProviderSelectorResult.property.provider"></a>
|
|
8172
|
+
|
|
8173
|
+
```typescript
|
|
8174
|
+
public readonly provider: string;
|
|
8175
|
+
```
|
|
8176
|
+
|
|
8177
|
+
- *Type:* string
|
|
8178
|
+
|
|
8179
|
+
Node path of the provider to use (e.g., "MyStack/MyProvider"). Must match one of the configured provider node paths from the input. If not provided, the job will be skipped (no runner created).
|
|
8180
|
+
|
|
8181
|
+
---
|
|
8182
|
+
|
|
7945
8183
|
### RunnerAmi <a name="RunnerAmi" id="@cloudsnorkel/cdk-github-runners.RunnerAmi"></a>
|
|
7946
8184
|
|
|
7947
8185
|
Description of a AMI built by {@link RunnerImageBuilder }.
|
|
@@ -8543,11 +8781,27 @@ const runnerProviderProps: RunnerProviderProps = { ... }
|
|
|
8543
8781
|
|
|
8544
8782
|
| **Name** | **Type** | **Description** |
|
|
8545
8783
|
| --- | --- | --- |
|
|
8784
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.defaultLabels">defaultLabels</a></code> | <code>boolean</code> | Add default labels based on OS and architecture of the runner. |
|
|
8546
8785
|
| <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. |
|
|
8547
8786
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | *No description.* |
|
|
8548
8787
|
|
|
8549
8788
|
---
|
|
8550
8789
|
|
|
8790
|
+
##### `defaultLabels`<sup>Optional</sup> <a name="defaultLabels" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.defaultLabels"></a>
|
|
8791
|
+
|
|
8792
|
+
```typescript
|
|
8793
|
+
public readonly defaultLabels: boolean;
|
|
8794
|
+
```
|
|
8795
|
+
|
|
8796
|
+
- *Type:* boolean
|
|
8797
|
+
- *Default:* true
|
|
8798
|
+
|
|
8799
|
+
Add default labels based on OS and architecture of the runner.
|
|
8800
|
+
|
|
8801
|
+
This will tell GitHub Runner to add default labels like `self-hosted`, `linux`, `x64`, and `arm64`.
|
|
8802
|
+
|
|
8803
|
+
---
|
|
8804
|
+
|
|
8551
8805
|
##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps.property.logRetention"></a>
|
|
8552
8806
|
|
|
8553
8807
|
```typescript
|
|
@@ -8600,6 +8854,7 @@ const runnerRuntimeParameters: RunnerRuntimeParameters = { ... }
|
|
|
8600
8854
|
| **Name** | **Type** | **Description** |
|
|
8601
8855
|
| --- | --- | --- |
|
|
8602
8856
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.githubDomainPath">githubDomainPath</a></code> | <code>string</code> | Path to GitHub domain. |
|
|
8857
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.labelsPath">labelsPath</a></code> | <code>string</code> | Path to comma-separated labels string to use for runner. |
|
|
8603
8858
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.ownerPath">ownerPath</a></code> | <code>string</code> | Path to repository owner name. |
|
|
8604
8859
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.registrationUrl">registrationUrl</a></code> | <code>string</code> | Repository or organization URL to register runner at. |
|
|
8605
8860
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.repoPath">repoPath</a></code> | <code>string</code> | Path to repository name. |
|
|
@@ -8622,6 +8877,18 @@ Most of the time this will be github.com but for self-hosted GitHub instances, t
|
|
|
8622
8877
|
|
|
8623
8878
|
---
|
|
8624
8879
|
|
|
8880
|
+
##### `labelsPath`<sup>Required</sup> <a name="labelsPath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.labelsPath"></a>
|
|
8881
|
+
|
|
8882
|
+
```typescript
|
|
8883
|
+
public readonly labelsPath: string;
|
|
8884
|
+
```
|
|
8885
|
+
|
|
8886
|
+
- *Type:* string
|
|
8887
|
+
|
|
8888
|
+
Path to comma-separated labels string to use for runner.
|
|
8889
|
+
|
|
8890
|
+
---
|
|
8891
|
+
|
|
8625
8892
|
##### `ownerPath`<sup>Required</sup> <a name="ownerPath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.ownerPath"></a>
|
|
8626
8893
|
|
|
8627
8894
|
```typescript
|
|
@@ -8756,6 +9023,54 @@ The EBS volume type.
|
|
|
8756
9023
|
|
|
8757
9024
|
---
|
|
8758
9025
|
|
|
9026
|
+
### WeightedRunnerProvider <a name="WeightedRunnerProvider" id="@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider"></a>
|
|
9027
|
+
|
|
9028
|
+
Configuration for weighted distribution of runners.
|
|
9029
|
+
|
|
9030
|
+
#### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider.Initializer"></a>
|
|
9031
|
+
|
|
9032
|
+
```typescript
|
|
9033
|
+
import { WeightedRunnerProvider } from '@cloudsnorkel/cdk-github-runners'
|
|
9034
|
+
|
|
9035
|
+
const weightedRunnerProvider: WeightedRunnerProvider = { ... }
|
|
9036
|
+
```
|
|
9037
|
+
|
|
9038
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
9039
|
+
|
|
9040
|
+
| **Name** | **Type** | **Description** |
|
|
9041
|
+
| --- | --- | --- |
|
|
9042
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider.property.provider">provider</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a></code> | The runner provider to use. |
|
|
9043
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider.property.weight">weight</a></code> | <code>number</code> | Weight for this provider. |
|
|
9044
|
+
|
|
9045
|
+
---
|
|
9046
|
+
|
|
9047
|
+
##### `provider`<sup>Required</sup> <a name="provider" id="@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider.property.provider"></a>
|
|
9048
|
+
|
|
9049
|
+
```typescript
|
|
9050
|
+
public readonly provider: IRunnerProvider;
|
|
9051
|
+
```
|
|
9052
|
+
|
|
9053
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
|
|
9054
|
+
|
|
9055
|
+
The runner provider to use.
|
|
9056
|
+
|
|
9057
|
+
---
|
|
9058
|
+
|
|
9059
|
+
##### `weight`<sup>Required</sup> <a name="weight" id="@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider.property.weight"></a>
|
|
9060
|
+
|
|
9061
|
+
```typescript
|
|
9062
|
+
public readonly weight: number;
|
|
9063
|
+
```
|
|
9064
|
+
|
|
9065
|
+
- *Type:* number
|
|
9066
|
+
|
|
9067
|
+
Weight for this provider.
|
|
9068
|
+
|
|
9069
|
+
Higher weights mean higher probability of selection.
|
|
9070
|
+
Must be a positive number.
|
|
9071
|
+
|
|
9072
|
+
---
|
|
9073
|
+
|
|
8759
9074
|
## Classes <a name="Classes" id="Classes"></a>
|
|
8760
9075
|
|
|
8761
9076
|
### Architecture <a name="Architecture" id="@cloudsnorkel/cdk-github-runners.Architecture"></a>
|
|
@@ -8872,6 +9187,120 @@ X86_64.
|
|
|
8872
9187
|
|
|
8873
9188
|
---
|
|
8874
9189
|
|
|
9190
|
+
### CompositeProvider <a name="CompositeProvider" id="@cloudsnorkel/cdk-github-runners.CompositeProvider"></a>
|
|
9191
|
+
|
|
9192
|
+
A composite runner provider that implements fallback and distribution strategies.
|
|
9193
|
+
|
|
9194
|
+
#### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.Initializer"></a>
|
|
9195
|
+
|
|
9196
|
+
```typescript
|
|
9197
|
+
import { CompositeProvider } from '@cloudsnorkel/cdk-github-runners'
|
|
9198
|
+
|
|
9199
|
+
new CompositeProvider()
|
|
9200
|
+
```
|
|
9201
|
+
|
|
9202
|
+
| **Name** | **Type** | **Description** |
|
|
9203
|
+
| --- | --- | --- |
|
|
9204
|
+
|
|
9205
|
+
---
|
|
9206
|
+
|
|
9207
|
+
|
|
9208
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
9209
|
+
|
|
9210
|
+
| **Name** | **Description** |
|
|
9211
|
+
| --- | --- |
|
|
9212
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CompositeProvider.distribute">distribute</a></code> | Creates a weighted distribution runner provider that randomly selects a provider based on weights. |
|
|
9213
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CompositeProvider.fallback">fallback</a></code> | Creates a fallback runner provider that tries each provider in order until one succeeds. |
|
|
9214
|
+
|
|
9215
|
+
---
|
|
9216
|
+
|
|
9217
|
+
##### `distribute` <a name="distribute" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.distribute"></a>
|
|
9218
|
+
|
|
9219
|
+
```typescript
|
|
9220
|
+
import { CompositeProvider } from '@cloudsnorkel/cdk-github-runners'
|
|
9221
|
+
|
|
9222
|
+
CompositeProvider.distribute(scope: Construct, id: string, weightedProviders: WeightedRunnerProvider[])
|
|
9223
|
+
```
|
|
9224
|
+
|
|
9225
|
+
Creates a weighted distribution runner provider that randomly selects a provider based on weights.
|
|
9226
|
+
|
|
9227
|
+
For example, given providers A (weight 10), B (weight 20), C (weight 30):
|
|
9228
|
+
- Total weight = 60
|
|
9229
|
+
- Probability of selecting A = 10/60 = 16.67%
|
|
9230
|
+
- Probability of selecting B = 20/60 = 33.33%
|
|
9231
|
+
- Probability of selecting C = 30/60 = 50%
|
|
9232
|
+
|
|
9233
|
+
You can use this to distribute load across multiple instance types or availability zones.
|
|
9234
|
+
|
|
9235
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.distribute.parameter.scope"></a>
|
|
9236
|
+
|
|
9237
|
+
- *Type:* constructs.Construct
|
|
9238
|
+
|
|
9239
|
+
The scope in which to define this construct.
|
|
9240
|
+
|
|
9241
|
+
---
|
|
9242
|
+
|
|
9243
|
+
###### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.distribute.parameter.id"></a>
|
|
9244
|
+
|
|
9245
|
+
- *Type:* string
|
|
9246
|
+
|
|
9247
|
+
The scoped construct ID.
|
|
9248
|
+
|
|
9249
|
+
---
|
|
9250
|
+
|
|
9251
|
+
###### `weightedProviders`<sup>Required</sup> <a name="weightedProviders" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.distribute.parameter.weightedProviders"></a>
|
|
9252
|
+
|
|
9253
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.WeightedRunnerProvider">WeightedRunnerProvider</a>[]
|
|
9254
|
+
|
|
9255
|
+
List of weighted runner providers.
|
|
9256
|
+
|
|
9257
|
+
---
|
|
9258
|
+
|
|
9259
|
+
##### `fallback` <a name="fallback" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.fallback"></a>
|
|
9260
|
+
|
|
9261
|
+
```typescript
|
|
9262
|
+
import { CompositeProvider } from '@cloudsnorkel/cdk-github-runners'
|
|
9263
|
+
|
|
9264
|
+
CompositeProvider.fallback(scope: Construct, id: string, providers: IRunnerProvider[])
|
|
9265
|
+
```
|
|
9266
|
+
|
|
9267
|
+
Creates a fallback runner provider that tries each provider in order until one succeeds.
|
|
9268
|
+
|
|
9269
|
+
For example, given providers A, B, C:
|
|
9270
|
+
- Try A first
|
|
9271
|
+
- If A fails, try B
|
|
9272
|
+
- If B fails, try C
|
|
9273
|
+
|
|
9274
|
+
You can use this to try spot instance first, and switch to on-demand instances if spot is unavailable.
|
|
9275
|
+
|
|
9276
|
+
Or you can use this to try different instance types in order of preference.
|
|
9277
|
+
|
|
9278
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.fallback.parameter.scope"></a>
|
|
9279
|
+
|
|
9280
|
+
- *Type:* constructs.Construct
|
|
9281
|
+
|
|
9282
|
+
The scope in which to define this construct.
|
|
9283
|
+
|
|
9284
|
+
---
|
|
9285
|
+
|
|
9286
|
+
###### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.fallback.parameter.id"></a>
|
|
9287
|
+
|
|
9288
|
+
- *Type:* string
|
|
9289
|
+
|
|
9290
|
+
The scoped construct ID.
|
|
9291
|
+
|
|
9292
|
+
---
|
|
9293
|
+
|
|
9294
|
+
###### `providers`<sup>Required</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.CompositeProvider.fallback.parameter.providers"></a>
|
|
9295
|
+
|
|
9296
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
|
|
9297
|
+
|
|
9298
|
+
List of runner providers to try in order.
|
|
9299
|
+
|
|
9300
|
+
---
|
|
9301
|
+
|
|
9302
|
+
|
|
9303
|
+
|
|
8875
9304
|
### LambdaAccess <a name="LambdaAccess" id="@cloudsnorkel/cdk-github-runners.LambdaAccess"></a>
|
|
8876
9305
|
|
|
8877
9306
|
Access configuration options for Lambda functions like setup and webhook function. Use this to limit access to these functions.
|
|
@@ -10187,6 +10616,134 @@ WindowsComponents.githubRunner(scope: Construct, id: string, runnerVersion: Runn
|
|
|
10187
10616
|
|
|
10188
10617
|
## Protocols <a name="Protocols" id="Protocols"></a>
|
|
10189
10618
|
|
|
10619
|
+
### ICompositeProvider <a name="ICompositeProvider" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider"></a>
|
|
10620
|
+
|
|
10621
|
+
- *Extends:* constructs.IConstruct
|
|
10622
|
+
|
|
10623
|
+
- *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider">ICompositeProvider</a>
|
|
10624
|
+
|
|
10625
|
+
Interface for composite runner providers that interact with multiple sub-providers.
|
|
10626
|
+
|
|
10627
|
+
Unlike IRunnerProvider, composite providers do not have connections, grant capabilities,
|
|
10628
|
+
log groups, or retryable errors as they delegate to their sub-providers.
|
|
10629
|
+
|
|
10630
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
10631
|
+
|
|
10632
|
+
| **Name** | **Description** |
|
|
10633
|
+
| --- | --- |
|
|
10634
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function tasks that execute the runner. |
|
|
10635
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.grantStateMachine">grantStateMachine</a></code> | An optional method that modifies the role of the state machine after all the tasks have been generated. |
|
|
10636
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.status">status</a></code> | Return statuses of all sub-providers to be used in the main status function. |
|
|
10637
|
+
|
|
10638
|
+
---
|
|
10639
|
+
|
|
10640
|
+
##### `getStepFunctionTask` <a name="getStepFunctionTask" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.getStepFunctionTask"></a>
|
|
10641
|
+
|
|
10642
|
+
```typescript
|
|
10643
|
+
public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
|
|
10644
|
+
```
|
|
10645
|
+
|
|
10646
|
+
Generate step function tasks that execute the runner.
|
|
10647
|
+
|
|
10648
|
+
Called by GithubRunners and shouldn't be called manually.
|
|
10649
|
+
|
|
10650
|
+
###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.getStepFunctionTask.parameter.parameters"></a>
|
|
10651
|
+
|
|
10652
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>
|
|
10653
|
+
|
|
10654
|
+
specific build parameters.
|
|
10655
|
+
|
|
10656
|
+
---
|
|
10657
|
+
|
|
10658
|
+
##### `grantStateMachine` <a name="grantStateMachine" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.grantStateMachine"></a>
|
|
10659
|
+
|
|
10660
|
+
```typescript
|
|
10661
|
+
public grantStateMachine(stateMachineRole: IGrantable): void
|
|
10662
|
+
```
|
|
10663
|
+
|
|
10664
|
+
An optional method that modifies the role of the state machine after all the tasks have been generated.
|
|
10665
|
+
|
|
10666
|
+
This can be used to add additional policy
|
|
10667
|
+
statements to the state machine role that are not automatically added by the task returned from {@link getStepFunctionTask}.
|
|
10668
|
+
|
|
10669
|
+
###### `stateMachineRole`<sup>Required</sup> <a name="stateMachineRole" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.grantStateMachine.parameter.stateMachineRole"></a>
|
|
10670
|
+
|
|
10671
|
+
- *Type:* aws-cdk-lib.aws_iam.IGrantable
|
|
10672
|
+
|
|
10673
|
+
role for the state machine that executes the task returned from {@link getStepFunctionTask}.
|
|
10674
|
+
|
|
10675
|
+
---
|
|
10676
|
+
|
|
10677
|
+
##### `status` <a name="status" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.status"></a>
|
|
10678
|
+
|
|
10679
|
+
```typescript
|
|
10680
|
+
public status(statusFunctionRole: IGrantable): IRunnerProviderStatus[]
|
|
10681
|
+
```
|
|
10682
|
+
|
|
10683
|
+
Return statuses of all sub-providers to be used in the main status function.
|
|
10684
|
+
|
|
10685
|
+
Also gives the status function any needed permissions to query the Docker images or AMIs.
|
|
10686
|
+
|
|
10687
|
+
###### `statusFunctionRole`<sup>Required</sup> <a name="statusFunctionRole" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.status.parameter.statusFunctionRole"></a>
|
|
10688
|
+
|
|
10689
|
+
- *Type:* aws-cdk-lib.aws_iam.IGrantable
|
|
10690
|
+
|
|
10691
|
+
grantable for the status function.
|
|
10692
|
+
|
|
10693
|
+
---
|
|
10694
|
+
|
|
10695
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
10696
|
+
|
|
10697
|
+
| **Name** | **Type** | **Description** |
|
|
10698
|
+
| --- | --- | --- |
|
|
10699
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
10700
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.labels">labels</a></code> | <code>string[]</code> | GitHub Actions labels used for this provider. |
|
|
10701
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | All sub-providers contained in this composite provider. |
|
|
10702
|
+
|
|
10703
|
+
---
|
|
10704
|
+
|
|
10705
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.node"></a>
|
|
10706
|
+
|
|
10707
|
+
```typescript
|
|
10708
|
+
public readonly node: Node;
|
|
10709
|
+
```
|
|
10710
|
+
|
|
10711
|
+
- *Type:* constructs.Node
|
|
10712
|
+
|
|
10713
|
+
The tree node.
|
|
10714
|
+
|
|
10715
|
+
---
|
|
10716
|
+
|
|
10717
|
+
##### `labels`<sup>Required</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.labels"></a>
|
|
10718
|
+
|
|
10719
|
+
```typescript
|
|
10720
|
+
public readonly labels: string[];
|
|
10721
|
+
```
|
|
10722
|
+
|
|
10723
|
+
- *Type:* string[]
|
|
10724
|
+
|
|
10725
|
+
GitHub Actions labels used for this provider.
|
|
10726
|
+
|
|
10727
|
+
These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for
|
|
10728
|
+
based on runs-on. We use match the labels from the webhook with the labels specified here. If all the labels specified here are present in the
|
|
10729
|
+
job's labels, this provider will be chosen and spawn a new runner.
|
|
10730
|
+
|
|
10731
|
+
---
|
|
10732
|
+
|
|
10733
|
+
##### `providers`<sup>Required</sup> <a name="providers" id="@cloudsnorkel/cdk-github-runners.ICompositeProvider.property.providers"></a>
|
|
10734
|
+
|
|
10735
|
+
```typescript
|
|
10736
|
+
public readonly providers: IRunnerProvider[];
|
|
10737
|
+
```
|
|
10738
|
+
|
|
10739
|
+
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
|
|
10740
|
+
|
|
10741
|
+
All sub-providers contained in this composite provider.
|
|
10742
|
+
|
|
10743
|
+
This is used to extract providers for metric filters and other operations.
|
|
10744
|
+
|
|
10745
|
+
---
|
|
10746
|
+
|
|
10190
10747
|
### IConfigurableRunnerImageBuilder <a name="IConfigurableRunnerImageBuilder" id="@cloudsnorkel/cdk-github-runners.IConfigurableRunnerImageBuilder"></a>
|
|
10191
10748
|
|
|
10192
10749
|
- *Extends:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageBuilder">IRunnerImageBuilder</a>, aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable
|
|
@@ -10596,6 +11153,7 @@ Interface for runner image status used by status.json.
|
|
|
10596
11153
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with provider. |
|
|
10597
11154
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.type">type</a></code> | <code>string</code> | Runner provider type. |
|
|
10598
11155
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.ami">ami</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerAmiStatus">IRunnerAmiStatus</a></code> | Details about AMI used by this runner provider. |
|
|
11156
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.constructPath">constructPath</a></code> | <code>string</code> | CDK construct node path for this provider. |
|
|
10599
11157
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.image">image</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageStatus">IRunnerImageStatus</a></code> | Details about Docker image used by this runner provider. |
|
|
10600
11158
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.logGroup">logGroup</a></code> | <code>string</code> | Log group for runners. |
|
|
10601
11159
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.roleArn">roleArn</a></code> | <code>string</code> | Role attached to runners. |
|
|
@@ -10640,6 +11198,18 @@ Details about AMI used by this runner provider.
|
|
|
10640
11198
|
|
|
10641
11199
|
---
|
|
10642
11200
|
|
|
11201
|
+
##### `constructPath`<sup>Optional</sup> <a name="constructPath" id="@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.constructPath"></a>
|
|
11202
|
+
|
|
11203
|
+
```typescript
|
|
11204
|
+
public readonly constructPath: string;
|
|
11205
|
+
```
|
|
11206
|
+
|
|
11207
|
+
- *Type:* string
|
|
11208
|
+
|
|
11209
|
+
CDK construct node path for this provider.
|
|
11210
|
+
|
|
11211
|
+
---
|
|
11212
|
+
|
|
10643
11213
|
##### `image`<sup>Optional</sup> <a name="image" id="@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.image"></a>
|
|
10644
11214
|
|
|
10645
11215
|
```typescript
|