@cloudsnorkel/cdk-github-runners 0.4.0 → 0.5.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/.jsii +55 -73
- package/API.md +2 -19
- package/README.md +11 -11
- package/lib/lambdas/delete-runner/index.js +48 -41
- package/lib/lambdas/setup/index.html +1 -1
- package/lib/lambdas/status/index.js +48 -41
- package/lib/lambdas/token-retriever/index.js +48 -41
- package/lib/providers/codebuild.js +1 -1
- package/lib/providers/common.d.ts +0 -8
- package/lib/providers/common.js +4 -4
- package/lib/providers/docker-images/fargate/linux-arm64/Dockerfile +0 -2
- package/lib/providers/docker-images/fargate/linux-x64/Dockerfile +0 -3
- package/lib/providers/fargate.d.ts +1 -0
- package/lib/providers/fargate.js +55 -14
- package/lib/providers/image-builders/codebuild.d.ts +4 -0
- package/lib/providers/image-builders/codebuild.js +11 -9
- package/lib/providers/image-builders/container.d.ts +2 -2
- package/lib/providers/image-builders/container.js +8 -7
- package/lib/providers/image-builders/static.js +1 -1
- package/lib/providers/lambda.d.ts +1 -0
- package/lib/providers/lambda.js +74 -14
- package/lib/runner.js +1 -1
- package/lib/secrets.js +1 -1
- package/package.json +12 -10
- package/lib/providers/docker-images/fargate/linux-arm64/runner.sh +0 -5
- package/lib/providers/docker-images/fargate/linux-x64/runner.sh +0 -5
package/.jsii
CHANGED
|
@@ -3010,7 +3010,7 @@
|
|
|
3010
3010
|
"stability": "experimental"
|
|
3011
3011
|
},
|
|
3012
3012
|
"homepage": "https://github.com/CloudSnorkel/cdk-github-runners.git",
|
|
3013
|
-
"jsiiVersion": "1.
|
|
3013
|
+
"jsiiVersion": "1.67.0 (build 2c027f5)",
|
|
3014
3014
|
"keywords": [
|
|
3015
3015
|
"aws",
|
|
3016
3016
|
"aws-cdk",
|
|
@@ -3034,7 +3034,7 @@
|
|
|
3034
3034
|
},
|
|
3035
3035
|
"name": "@cloudsnorkel/cdk-github-runners",
|
|
3036
3036
|
"readme": {
|
|
3037
|
-
"markdown": "# GitHub Self-Hosted Runners CDK Constructs\n\n[][7]\n[][6]\n[][8]\n[][11]\n[][12]\n[](https://github.com/CloudSnorkel/cdk-github-runners/actions/workflows/release.yml)\n[](https://github.com/CloudSnorkel/cdk-github-runners/blob/main/LICENSE)\n\nUse this CDK construct to create ephemeral [self-hosted GitHub runners][1] on-demand inside your AWS account.\n\n* Easy to configure GitHub integration with a web-based interface\n* Customizable runners with decent defaults\n* Multiple runner configurations controlled by labels\n* Everything fully hosted in your account\n* Automatically updated build environment with latest runner version\n\nSelf-hosted runners in AWS are useful when:\n\n* You need easy access to internal resources in your actions\n* You want to pre-install some software for your actions\n* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials][2] has more security controls)\n\nEphemeral (or on-demand) runners are the [recommended way by GitHub][14] for auto-scaling, and they make sure all jobs run with a clean image. Runners are started on-demand. You don't pay unless a job is running.\n\n## API\n\nThe best way to browse API documentation is on [Constructs Hub][13]. It is available in all supported programming languages.\n\n## Providers\n\nA runner provider creates compute resources on-demand and uses [actions/runner][5] to start a runner.\n\n| | CodeBuild | Fargate
|
|
3037
|
+
"markdown": "# GitHub Self-Hosted Runners CDK Constructs\n\n[][7]\n[][6]\n[][8]\n[][11]\n[][12]\n[](https://github.com/CloudSnorkel/cdk-github-runners/actions/workflows/release.yml)\n[](https://github.com/CloudSnorkel/cdk-github-runners/blob/main/LICENSE)\n\nUse this CDK construct to create ephemeral [self-hosted GitHub runners][1] on-demand inside your AWS account.\n\n* Easy to configure GitHub integration with a web-based interface\n* Customizable runners with decent defaults\n* Multiple runner configurations controlled by labels\n* Everything fully hosted in your account\n* Automatically updated build environment with latest runner version\n\nSelf-hosted runners in AWS are useful when:\n\n* You need easy access to internal resources in your actions\n* You want to pre-install some software for your actions\n* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials][2] has more security controls)\n\nEphemeral (or on-demand) runners are the [recommended way by GitHub][14] for auto-scaling, and they make sure all jobs run with a clean image. Runners are started on-demand. You don't pay unless a job is running.\n\n## API\n\nThe best way to browse API documentation is on [Constructs Hub][13]. It is available in all supported programming languages.\n\n## Providers\n\nA runner provider creates compute resources on-demand and uses [actions/runner][5] to start a runner.\n\n| | CodeBuild | Fargate | Lambda |\n|------------------|----------------------------|----------------|---------------|\n| **Time limit** | 8 hours | Unlimited | 15 minutes |\n| **vCPUs** | 2, 4, 8, or 72 | 0.25 to 4 | 1 to 6 |\n| **RAM** | 3gb, 7gb, 15gb, or 145gb | 512mb to 30gb | 128mb to 10gb |\n| **Storage** | 50gb to 824gb | 20gb to 200gb | Up to 10gb |\n| **Architecture** | x86_64, ARM64 | x86_64, ARM64 | x86_64, ARM64 |\n| **sudo** | ✔ | ✔ | ❌ |\n| **Docker** | ✔ (Linux only) | ❌ | ❌ |\n| **Spot pricing** | ❌ | ✔ | ❌ |\n| **OS** | Linux, Windows | Linux, Windows | Linux |\n\nThe best provider to use mostly depends on your current infrastructure. When in doubt, CodeBuild is always a good choice. Execution history and logs are easy to view, and it has no restrictive limits unless you need to run for more than 8 hours.\n\nYou can also create your own provider by implementing `IRunnerProvider`.\n\n## Installation\n\n1. Confirm you're using CDK v2\n2. Install the appropriate package\n 1. [Python][6]\n ```\n pip install cloudsnorkel.cdk-github-runners\n ```\n 2. [TypeScript or JavaScript][7]\n ```\n npm i @cloudsnorkel/cdk-github-runners\n ```\n 3. [Java][8]\n ```xml\n <dependency>\n <groupId>com.cloudsnorkel</groupId>\n <artifactId>cdk.github.runners</artifactId>\n </dependency>\n ```\n 4. [Go][11]\n ```\n go get github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n ```\n 5. [.NET][12]\n ```\n dotnet add package CloudSnorkel.Cdk.Github.Runners\n ```\n3. Use `GitHubRunners` construct in your code (starting with default arguments is fine)\n4. Deploy your stack\n5. Look for the status command output similar to `aws --region us-east-1 lambda invoke --function-name status-XYZ123 status.json`\n6. Execute the status command (you may need to specify `--profile` too) and open the resulting `status.json` file\n7. Open the URL in `github.setup.url` from `status.json` or [manually setup GitHub](SETUP_GITHUB.md) integration as an app or with personal access token\n8. Run status command again to confirm `github.auth.status` and `github.webhook.status` are OK\n9. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted, linux, codebuild]` or similar\n10. If the action is not successful, see [troubleshooting](#Troubleshooting)\n\n[](https://youtu.be/wlyv_3V8lIw)\n\n## Customizing\n\nThe default providers configured by `GitHubRunners` are useful for testing but probably not too much for actual production work. They run in the default VPC or no VPC and have no added IAM permissions. You would usually want to configure the providers yourself.\n\nFor example:\n\n```typescript\nlet vpc: ec2.Vpc;\nlet runnerSg: ec2.SecurityGroup;\nlet dbSg: ec2.SecurityGroup;\nlet bucket: s3.Bucket;\n\n// create a custom CodeBuild provider\nconst myProvider = new CodeBuildRunner(this, 'codebuild runner', {\n label: 'my-codebuild',\n vpc: vpc,\n securityGroup: runnerSg,\n});\n// grant some permissions to the provider\nbucket.grantReadWrite(myProvider);\ndbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), 'allow runners to connect to MySQL database');\n\n// create the runner infrastructure\nnew GitHubRunners(this, 'runners', {\n providers: [myProvider],\n});\n```\n\nAnother way to customize runners is by modifying the image used to spin them up. The image contains the [runner][5], any required dependencies, and integration code with the provider. You may choose to customize this image by adding more packages, for example.\n\n```typescript\nconst myBuilder = new CodeBuildImageBuilder(this, 'image builder', {\n dockerfilePath: FargateProvider.LINUX_X64_DOCKERFILE_PATH,\n runnerVersion: RunnerVersion.specific('2.291.0'),\n rebuildInterval: Duration.days(14),\n});\nmyBuilder.setBuildArg('EXTRA_PACKAGES', 'nginx xz-utils');\n\nconst myProvider = new FargateProvider(this, 'fargate runner', {\n label: 'customized-fargate',\n vpc: vpc,\n securityGroup: runnerSg,\n});\n\n// create the runner infrastructure\nnew GitHubRunners(stack, 'runners', {\n providers: [myProvider],\n});\n```\n\nYour workflow will then look like:\n\n```yaml\nname: self-hosted example\non: push\njobs:\n self-hosted:\n runs-on: [self-hosted, customized-fargate]\n steps:\n - run: echo hello world\n```\n\n## Architecture\n\n\n\n## Troubleshooting\n\n1. Always start with the status function, make sure no errors are reported, and confirm all status codes are OK\n2. Confirm the webhook Lambda was called by visiting the URL in `troubleshooting.webhookHandlerUrl` from `status.json`\n 1. If it's not called or logs errors, confirm the webhook settings on the GitHub side\n 2. If you see too many errors, make sure you're only sending `workflow_job` events\n3. When using GitHub app, make sure there are active installation in `github.auth.app.installations`\n4. Check execution details of the orchestrator step function by visiting the URL in `troubleshooting.stepFunctionUrl` from `status.json`\n 1. Use the details tab to find the specific execution of the provider (Lambda, CodeBuild, Fargate, etc.)\n 2. Every step function execution should be successful, even if the runner action inside it failed\n\n## Other Options\n\n1. [philips-labs/terraform-aws-github-runner][3] if you're using Terraform\n2. [actions-runner-controller/actions-runner-controller][4] if you're using Kubernetes\n\n\n[1]: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners\n[2]: https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions\n[3]: https://github.com/philips-labs/terraform-aws-github-runner\n[4]: https://github.com/actions-runner-controller/actions-runner-controller\n[5]: https://github.com/actions/runner\n[6]: https://pypi.org/project/cloudsnorkel.cdk-github-runners\n[7]: https://www.npmjs.com/package/@cloudsnorkel/cdk-github-runners\n[8]: https://search.maven.org/search?q=g:%22com.cloudsnorkel%22%20AND%20a:%22cdk.github.runners%22\n[9]: https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps\n[10]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n[11]: https://pkg.go.dev/github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n[12]: https://www.nuget.org/packages/CloudSnorkel.Cdk.Github.Runners/\n[13]: https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/\n[14]: https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling\n"
|
|
3038
3038
|
},
|
|
3039
3039
|
"repository": {
|
|
3040
3040
|
"type": "git",
|
|
@@ -3174,7 +3174,7 @@
|
|
|
3174
3174
|
},
|
|
3175
3175
|
"locationInModule": {
|
|
3176
3176
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3177
|
-
"line":
|
|
3177
|
+
"line": 168
|
|
3178
3178
|
},
|
|
3179
3179
|
"parameters": [
|
|
3180
3180
|
{
|
|
@@ -3214,7 +3214,7 @@
|
|
|
3214
3214
|
},
|
|
3215
3215
|
"locationInModule": {
|
|
3216
3216
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3217
|
-
"line":
|
|
3217
|
+
"line": 275
|
|
3218
3218
|
},
|
|
3219
3219
|
"name": "addExtraCertificates",
|
|
3220
3220
|
"parameters": [
|
|
@@ -3236,7 +3236,7 @@
|
|
|
3236
3236
|
},
|
|
3237
3237
|
"locationInModule": {
|
|
3238
3238
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3239
|
-
"line":
|
|
3239
|
+
"line": 209
|
|
3240
3240
|
},
|
|
3241
3241
|
"name": "addFiles",
|
|
3242
3242
|
"parameters": [
|
|
@@ -3267,7 +3267,7 @@
|
|
|
3267
3267
|
},
|
|
3268
3268
|
"locationInModule": {
|
|
3269
3269
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3270
|
-
"line":
|
|
3270
|
+
"line": 261
|
|
3271
3271
|
},
|
|
3272
3272
|
"name": "addPolicyStatement",
|
|
3273
3273
|
"parameters": [
|
|
@@ -3289,7 +3289,7 @@
|
|
|
3289
3289
|
},
|
|
3290
3290
|
"locationInModule": {
|
|
3291
3291
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3292
|
-
"line":
|
|
3292
|
+
"line": 236
|
|
3293
3293
|
},
|
|
3294
3294
|
"name": "addPostBuildCommand",
|
|
3295
3295
|
"parameters": [
|
|
@@ -3311,7 +3311,7 @@
|
|
|
3311
3311
|
},
|
|
3312
3312
|
"locationInModule": {
|
|
3313
3313
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3314
|
-
"line":
|
|
3314
|
+
"line": 224
|
|
3315
3315
|
},
|
|
3316
3316
|
"name": "addPreBuildCommand",
|
|
3317
3317
|
"parameters": [
|
|
@@ -3333,7 +3333,7 @@
|
|
|
3333
3333
|
},
|
|
3334
3334
|
"locationInModule": {
|
|
3335
3335
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3336
|
-
"line":
|
|
3336
|
+
"line": 285
|
|
3337
3337
|
},
|
|
3338
3338
|
"name": "bind",
|
|
3339
3339
|
"overrides": "@cloudsnorkel/cdk-github-runners.IImageBuilder",
|
|
@@ -3351,7 +3351,7 @@
|
|
|
3351
3351
|
},
|
|
3352
3352
|
"locationInModule": {
|
|
3353
3353
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3354
|
-
"line":
|
|
3354
|
+
"line": 249
|
|
3355
3355
|
},
|
|
3356
3356
|
"name": "setBuildArg",
|
|
3357
3357
|
"parameters": [
|
|
@@ -3385,7 +3385,7 @@
|
|
|
3385
3385
|
"immutable": true,
|
|
3386
3386
|
"locationInModule": {
|
|
3387
3387
|
"filename": "src/providers/image-builders/codebuild.ts",
|
|
3388
|
-
"line":
|
|
3388
|
+
"line": 168
|
|
3389
3389
|
},
|
|
3390
3390
|
"name": "props",
|
|
3391
3391
|
"type": {
|
|
@@ -4017,7 +4017,7 @@
|
|
|
4017
4017
|
"assembly": "@cloudsnorkel/cdk-github-runners",
|
|
4018
4018
|
"base": "constructs.Construct",
|
|
4019
4019
|
"docs": {
|
|
4020
|
-
"remarks": "Builders can be used with runner providers.\n\nThe CodeBuild builder is better and faster. Only use this one if you have no choice. For example, if you need Windows containers.\n\nEach builder re-runs automatically at a set interval to make sure the images contain the latest versions of everything.\n\nYou can create an instance of this construct to customize the image used to spin-up runners. Some runner providers may require custom components. Check the runner provider documentation. The default components work with CodeBuild.\n\nFor example, to set a specific runner version, rebuild the image every 2 weeks, and add a few packages for the Fargate provider, use:\n\n```\nconst builder = new ContainerImageBuilder(this, 'Builder', {\n runnerVersion: RunnerVersion.specific('2.293.0'),\n rebuildInterval: Duration.days(14),\n});\nnew CodeBuildRunner(this, '
|
|
4020
|
+
"remarks": "Builders can be used with runner providers.\n\nThe CodeBuild builder is better and faster. Only use this one if you have no choice. For example, if you need Windows containers.\n\nEach builder re-runs automatically at a set interval to make sure the images contain the latest versions of everything.\n\nYou can create an instance of this construct to customize the image used to spin-up runners. Some runner providers may require custom components. Check the runner provider documentation. The default components work with CodeBuild and Fargate.\n\nFor example, to set a specific runner version, rebuild the image every 2 weeks, and add a few packages for the Fargate provider, use:\n\n```\nconst builder = new ContainerImageBuilder(this, 'Builder', {\n runnerVersion: RunnerVersion.specific('2.293.0'),\n rebuildInterval: Duration.days(14),\n});\nnew CodeBuildRunner(this, 'CodeBuild provider', {\n label: 'windows-codebuild',\n imageBuilder: builder,\n});\n```",
|
|
4021
4021
|
"stability": "experimental",
|
|
4022
4022
|
"summary": "An image builder that uses Image Builder to build Docker images pre-baked with all the GitHub Actions runner requirements."
|
|
4023
4023
|
},
|
|
@@ -4542,7 +4542,7 @@
|
|
|
4542
4542
|
},
|
|
4543
4543
|
"locationInModule": {
|
|
4544
4544
|
"filename": "src/providers/fargate.ts",
|
|
4545
|
-
"line":
|
|
4545
|
+
"line": 249
|
|
4546
4546
|
},
|
|
4547
4547
|
"parameters": [
|
|
4548
4548
|
{
|
|
@@ -4571,7 +4571,7 @@
|
|
|
4571
4571
|
"kind": "class",
|
|
4572
4572
|
"locationInModule": {
|
|
4573
4573
|
"filename": "src/providers/fargate.ts",
|
|
4574
|
-
"line":
|
|
4574
|
+
"line": 175
|
|
4575
4575
|
},
|
|
4576
4576
|
"methods": [
|
|
4577
4577
|
{
|
|
@@ -4582,7 +4582,7 @@
|
|
|
4582
4582
|
},
|
|
4583
4583
|
"locationInModule": {
|
|
4584
4584
|
"filename": "src/providers/fargate.ts",
|
|
4585
|
-
"line":
|
|
4585
|
+
"line": 331
|
|
4586
4586
|
},
|
|
4587
4587
|
"name": "getStepFunctionTask",
|
|
4588
4588
|
"overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
|
|
@@ -4616,7 +4616,7 @@
|
|
|
4616
4616
|
"immutable": true,
|
|
4617
4617
|
"locationInModule": {
|
|
4618
4618
|
"filename": "src/providers/fargate.ts",
|
|
4619
|
-
"line":
|
|
4619
|
+
"line": 192
|
|
4620
4620
|
},
|
|
4621
4621
|
"name": "LINUX_ARM64_DOCKERFILE_PATH",
|
|
4622
4622
|
"static": true,
|
|
@@ -4634,7 +4634,7 @@
|
|
|
4634
4634
|
"immutable": true,
|
|
4635
4635
|
"locationInModule": {
|
|
4636
4636
|
"filename": "src/providers/fargate.ts",
|
|
4637
|
-
"line":
|
|
4637
|
+
"line": 183
|
|
4638
4638
|
},
|
|
4639
4639
|
"name": "LINUX_X64_DOCKERFILE_PATH",
|
|
4640
4640
|
"static": true,
|
|
@@ -4650,7 +4650,7 @@
|
|
|
4650
4650
|
"immutable": true,
|
|
4651
4651
|
"locationInModule": {
|
|
4652
4652
|
"filename": "src/providers/fargate.ts",
|
|
4653
|
-
"line":
|
|
4653
|
+
"line": 227
|
|
4654
4654
|
},
|
|
4655
4655
|
"name": "assignPublicIp",
|
|
4656
4656
|
"type": {
|
|
@@ -4665,7 +4665,7 @@
|
|
|
4665
4665
|
"immutable": true,
|
|
4666
4666
|
"locationInModule": {
|
|
4667
4667
|
"filename": "src/providers/fargate.ts",
|
|
4668
|
-
"line":
|
|
4668
|
+
"line": 197
|
|
4669
4669
|
},
|
|
4670
4670
|
"name": "cluster",
|
|
4671
4671
|
"type": {
|
|
@@ -4680,7 +4680,7 @@
|
|
|
4680
4680
|
"immutable": true,
|
|
4681
4681
|
"locationInModule": {
|
|
4682
4682
|
"filename": "src/providers/fargate.ts",
|
|
4683
|
-
"line":
|
|
4683
|
+
"line": 237
|
|
4684
4684
|
},
|
|
4685
4685
|
"name": "connections",
|
|
4686
4686
|
"overrides": "aws-cdk-lib.aws_ec2.IConnectable",
|
|
@@ -4696,7 +4696,7 @@
|
|
|
4696
4696
|
"immutable": true,
|
|
4697
4697
|
"locationInModule": {
|
|
4698
4698
|
"filename": "src/providers/fargate.ts",
|
|
4699
|
-
"line":
|
|
4699
|
+
"line": 207
|
|
4700
4700
|
},
|
|
4701
4701
|
"name": "container",
|
|
4702
4702
|
"type": {
|
|
@@ -4711,7 +4711,7 @@
|
|
|
4711
4711
|
"immutable": true,
|
|
4712
4712
|
"locationInModule": {
|
|
4713
4713
|
"filename": "src/providers/fargate.ts",
|
|
4714
|
-
"line":
|
|
4714
|
+
"line": 232
|
|
4715
4715
|
},
|
|
4716
4716
|
"name": "grantPrincipal",
|
|
4717
4717
|
"overrides": "aws-cdk-lib.aws_iam.IGrantable",
|
|
@@ -4727,7 +4727,7 @@
|
|
|
4727
4727
|
"immutable": true,
|
|
4728
4728
|
"locationInModule": {
|
|
4729
4729
|
"filename": "src/providers/fargate.ts",
|
|
4730
|
-
"line":
|
|
4730
|
+
"line": 247
|
|
4731
4731
|
},
|
|
4732
4732
|
"name": "image",
|
|
4733
4733
|
"overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
|
|
@@ -4743,7 +4743,7 @@
|
|
|
4743
4743
|
"immutable": true,
|
|
4744
4744
|
"locationInModule": {
|
|
4745
4745
|
"filename": "src/providers/fargate.ts",
|
|
4746
|
-
"line":
|
|
4746
|
+
"line": 212
|
|
4747
4747
|
},
|
|
4748
4748
|
"name": "label",
|
|
4749
4749
|
"overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
|
|
@@ -4759,7 +4759,7 @@
|
|
|
4759
4759
|
"immutable": true,
|
|
4760
4760
|
"locationInModule": {
|
|
4761
4761
|
"filename": "src/providers/fargate.ts",
|
|
4762
|
-
"line":
|
|
4762
|
+
"line": 242
|
|
4763
4763
|
},
|
|
4764
4764
|
"name": "spot",
|
|
4765
4765
|
"type": {
|
|
@@ -4774,7 +4774,7 @@
|
|
|
4774
4774
|
"immutable": true,
|
|
4775
4775
|
"locationInModule": {
|
|
4776
4776
|
"filename": "src/providers/fargate.ts",
|
|
4777
|
-
"line":
|
|
4777
|
+
"line": 202
|
|
4778
4778
|
},
|
|
4779
4779
|
"name": "task",
|
|
4780
4780
|
"type": {
|
|
@@ -4789,7 +4789,7 @@
|
|
|
4789
4789
|
"immutable": true,
|
|
4790
4790
|
"locationInModule": {
|
|
4791
4791
|
"filename": "src/providers/fargate.ts",
|
|
4792
|
-
"line":
|
|
4792
|
+
"line": 222
|
|
4793
4793
|
},
|
|
4794
4794
|
"name": "securityGroup",
|
|
4795
4795
|
"optional": true,
|
|
@@ -4806,7 +4806,7 @@
|
|
|
4806
4806
|
"immutable": true,
|
|
4807
4807
|
"locationInModule": {
|
|
4808
4808
|
"filename": "src/providers/fargate.ts",
|
|
4809
|
-
"line":
|
|
4809
|
+
"line": 217
|
|
4810
4810
|
},
|
|
4811
4811
|
"name": "vpc",
|
|
4812
4812
|
"optional": true,
|
|
@@ -5253,7 +5253,7 @@
|
|
|
5253
5253
|
"kind": "interface",
|
|
5254
5254
|
"locationInModule": {
|
|
5255
5255
|
"filename": "src/providers/common.ts",
|
|
5256
|
-
"line":
|
|
5256
|
+
"line": 127
|
|
5257
5257
|
},
|
|
5258
5258
|
"methods": [
|
|
5259
5259
|
{
|
|
@@ -5266,7 +5266,7 @@
|
|
|
5266
5266
|
},
|
|
5267
5267
|
"locationInModule": {
|
|
5268
5268
|
"filename": "src/providers/common.ts",
|
|
5269
|
-
"line":
|
|
5269
|
+
"line": 135
|
|
5270
5270
|
},
|
|
5271
5271
|
"name": "bind",
|
|
5272
5272
|
"returns": {
|
|
@@ -5289,7 +5289,7 @@
|
|
|
5289
5289
|
"kind": "interface",
|
|
5290
5290
|
"locationInModule": {
|
|
5291
5291
|
"filename": "src/providers/common.ts",
|
|
5292
|
-
"line":
|
|
5292
|
+
"line": 191
|
|
5293
5293
|
},
|
|
5294
5294
|
"name": "IRunnerImageStatus",
|
|
5295
5295
|
"properties": [
|
|
@@ -5302,7 +5302,7 @@
|
|
|
5302
5302
|
"immutable": true,
|
|
5303
5303
|
"locationInModule": {
|
|
5304
5304
|
"filename": "src/providers/common.ts",
|
|
5305
|
-
"line":
|
|
5305
|
+
"line": 205
|
|
5306
5306
|
},
|
|
5307
5307
|
"name": "imageBuilderLogGroup",
|
|
5308
5308
|
"optional": true,
|
|
@@ -5319,7 +5319,7 @@
|
|
|
5319
5319
|
"immutable": true,
|
|
5320
5320
|
"locationInModule": {
|
|
5321
5321
|
"filename": "src/providers/common.ts",
|
|
5322
|
-
"line":
|
|
5322
|
+
"line": 195
|
|
5323
5323
|
},
|
|
5324
5324
|
"name": "imageRepository",
|
|
5325
5325
|
"optional": true,
|
|
@@ -5336,7 +5336,7 @@
|
|
|
5336
5336
|
"immutable": true,
|
|
5337
5337
|
"locationInModule": {
|
|
5338
5338
|
"filename": "src/providers/common.ts",
|
|
5339
|
-
"line":
|
|
5339
|
+
"line": 200
|
|
5340
5340
|
},
|
|
5341
5341
|
"name": "imageTag",
|
|
5342
5342
|
"optional": true,
|
|
@@ -5362,7 +5362,7 @@
|
|
|
5362
5362
|
"kind": "interface",
|
|
5363
5363
|
"locationInModule": {
|
|
5364
5364
|
"filename": "src/providers/common.ts",
|
|
5365
|
-
"line":
|
|
5365
|
+
"line": 211
|
|
5366
5366
|
},
|
|
5367
5367
|
"methods": [
|
|
5368
5368
|
{
|
|
@@ -5374,7 +5374,7 @@
|
|
|
5374
5374
|
},
|
|
5375
5375
|
"locationInModule": {
|
|
5376
5376
|
"filename": "src/providers/common.ts",
|
|
5377
|
-
"line":
|
|
5377
|
+
"line": 239
|
|
5378
5378
|
},
|
|
5379
5379
|
"name": "getStepFunctionTask",
|
|
5380
5380
|
"parameters": [
|
|
@@ -5407,7 +5407,7 @@
|
|
|
5407
5407
|
"immutable": true,
|
|
5408
5408
|
"locationInModule": {
|
|
5409
5409
|
"filename": "src/providers/common.ts",
|
|
5410
|
-
"line":
|
|
5410
|
+
"line": 230
|
|
5411
5411
|
},
|
|
5412
5412
|
"name": "image",
|
|
5413
5413
|
"type": {
|
|
@@ -5423,7 +5423,7 @@
|
|
|
5423
5423
|
"immutable": true,
|
|
5424
5424
|
"locationInModule": {
|
|
5425
5425
|
"filename": "src/providers/common.ts",
|
|
5426
|
-
"line":
|
|
5426
|
+
"line": 215
|
|
5427
5427
|
},
|
|
5428
5428
|
"name": "label",
|
|
5429
5429
|
"type": {
|
|
@@ -5439,7 +5439,7 @@
|
|
|
5439
5439
|
"immutable": true,
|
|
5440
5440
|
"locationInModule": {
|
|
5441
5441
|
"filename": "src/providers/common.ts",
|
|
5442
|
-
"line":
|
|
5442
|
+
"line": 225
|
|
5443
5443
|
},
|
|
5444
5444
|
"name": "securityGroup",
|
|
5445
5445
|
"optional": true,
|
|
@@ -5456,7 +5456,7 @@
|
|
|
5456
5456
|
"immutable": true,
|
|
5457
5457
|
"locationInModule": {
|
|
5458
5458
|
"filename": "src/providers/common.ts",
|
|
5459
|
-
"line":
|
|
5459
|
+
"line": 220
|
|
5460
5460
|
},
|
|
5461
5461
|
"name": "vpc",
|
|
5462
5462
|
"optional": true,
|
|
@@ -5818,7 +5818,7 @@
|
|
|
5818
5818
|
},
|
|
5819
5819
|
"locationInModule": {
|
|
5820
5820
|
"filename": "src/providers/lambda.ts",
|
|
5821
|
-
"line":
|
|
5821
|
+
"line": 221
|
|
5822
5822
|
},
|
|
5823
5823
|
"name": "getStepFunctionTask",
|
|
5824
5824
|
"overrides": "@cloudsnorkel/cdk-github-runners.IRunnerProvider",
|
|
@@ -5886,7 +5886,7 @@
|
|
|
5886
5886
|
"immutable": true,
|
|
5887
5887
|
"locationInModule": {
|
|
5888
5888
|
"filename": "src/providers/lambda.ts",
|
|
5889
|
-
"line":
|
|
5889
|
+
"line": 210
|
|
5890
5890
|
},
|
|
5891
5891
|
"name": "connections",
|
|
5892
5892
|
"overrides": "aws-cdk-lib.aws_ec2.IConnectable",
|
|
@@ -6279,7 +6279,7 @@
|
|
|
6279
6279
|
"immutable": true,
|
|
6280
6280
|
"locationInModule": {
|
|
6281
6281
|
"filename": "src/providers/common.ts",
|
|
6282
|
-
"line":
|
|
6282
|
+
"line": 105
|
|
6283
6283
|
},
|
|
6284
6284
|
"name": "architecture",
|
|
6285
6285
|
"type": {
|
|
@@ -6327,31 +6327,13 @@
|
|
|
6327
6327
|
"immutable": true,
|
|
6328
6328
|
"locationInModule": {
|
|
6329
6329
|
"filename": "src/providers/common.ts",
|
|
6330
|
-
"line":
|
|
6330
|
+
"line": 110
|
|
6331
6331
|
},
|
|
6332
6332
|
"name": "os",
|
|
6333
6333
|
"type": {
|
|
6334
6334
|
"fqn": "@cloudsnorkel/cdk-github-runners.Os"
|
|
6335
6335
|
}
|
|
6336
6336
|
},
|
|
6337
|
-
{
|
|
6338
|
-
"abstract": true,
|
|
6339
|
-
"docs": {
|
|
6340
|
-
"remarks": "If the digest is not specified, imageTag must always point to a new tag on update. If not, the build may try to use the old image.\n\nWARNING: 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.",
|
|
6341
|
-
"stability": "experimental",
|
|
6342
|
-
"summary": "Image digest for providers that need to know the digest like Lambda."
|
|
6343
|
-
},
|
|
6344
|
-
"immutable": true,
|
|
6345
|
-
"locationInModule": {
|
|
6346
|
-
"filename": "src/providers/common.ts",
|
|
6347
|
-
"line": 109
|
|
6348
|
-
},
|
|
6349
|
-
"name": "imageDigest",
|
|
6350
|
-
"optional": true,
|
|
6351
|
-
"type": {
|
|
6352
|
-
"primitive": "string"
|
|
6353
|
-
}
|
|
6354
|
-
},
|
|
6355
6337
|
{
|
|
6356
6338
|
"abstract": true,
|
|
6357
6339
|
"docs": {
|
|
@@ -6361,7 +6343,7 @@
|
|
|
6361
6343
|
"immutable": true,
|
|
6362
6344
|
"locationInModule": {
|
|
6363
6345
|
"filename": "src/providers/common.ts",
|
|
6364
|
-
"line":
|
|
6346
|
+
"line": 115
|
|
6365
6347
|
},
|
|
6366
6348
|
"name": "logGroup",
|
|
6367
6349
|
"optional": true,
|
|
@@ -6383,7 +6365,7 @@
|
|
|
6383
6365
|
"kind": "interface",
|
|
6384
6366
|
"locationInModule": {
|
|
6385
6367
|
"filename": "src/providers/common.ts",
|
|
6386
|
-
"line":
|
|
6368
|
+
"line": 141
|
|
6387
6369
|
},
|
|
6388
6370
|
"name": "RunnerProviderProps",
|
|
6389
6371
|
"properties": [
|
|
@@ -6398,7 +6380,7 @@
|
|
|
6398
6380
|
"immutable": true,
|
|
6399
6381
|
"locationInModule": {
|
|
6400
6382
|
"filename": "src/providers/common.ts",
|
|
6401
|
-
"line":
|
|
6383
|
+
"line": 149
|
|
6402
6384
|
},
|
|
6403
6385
|
"name": "logRetention",
|
|
6404
6386
|
"optional": true,
|
|
@@ -6421,7 +6403,7 @@
|
|
|
6421
6403
|
"kind": "interface",
|
|
6422
6404
|
"locationInModule": {
|
|
6423
6405
|
"filename": "src/providers/common.ts",
|
|
6424
|
-
"line":
|
|
6406
|
+
"line": 161
|
|
6425
6407
|
},
|
|
6426
6408
|
"name": "RunnerRuntimeParameters",
|
|
6427
6409
|
"properties": [
|
|
@@ -6435,7 +6417,7 @@
|
|
|
6435
6417
|
"immutable": true,
|
|
6436
6418
|
"locationInModule": {
|
|
6437
6419
|
"filename": "src/providers/common.ts",
|
|
6438
|
-
"line":
|
|
6420
|
+
"line": 175
|
|
6439
6421
|
},
|
|
6440
6422
|
"name": "githubDomainPath",
|
|
6441
6423
|
"type": {
|
|
@@ -6451,7 +6433,7 @@
|
|
|
6451
6433
|
"immutable": true,
|
|
6452
6434
|
"locationInModule": {
|
|
6453
6435
|
"filename": "src/providers/common.ts",
|
|
6454
|
-
"line":
|
|
6436
|
+
"line": 180
|
|
6455
6437
|
},
|
|
6456
6438
|
"name": "ownerPath",
|
|
6457
6439
|
"type": {
|
|
@@ -6467,7 +6449,7 @@
|
|
|
6467
6449
|
"immutable": true,
|
|
6468
6450
|
"locationInModule": {
|
|
6469
6451
|
"filename": "src/providers/common.ts",
|
|
6470
|
-
"line":
|
|
6452
|
+
"line": 185
|
|
6471
6453
|
},
|
|
6472
6454
|
"name": "repoPath",
|
|
6473
6455
|
"type": {
|
|
@@ -6484,7 +6466,7 @@
|
|
|
6484
6466
|
"immutable": true,
|
|
6485
6467
|
"locationInModule": {
|
|
6486
6468
|
"filename": "src/providers/common.ts",
|
|
6487
|
-
"line":
|
|
6469
|
+
"line": 170
|
|
6488
6470
|
},
|
|
6489
6471
|
"name": "runnerNamePath",
|
|
6490
6472
|
"type": {
|
|
@@ -6500,7 +6482,7 @@
|
|
|
6500
6482
|
"immutable": true,
|
|
6501
6483
|
"locationInModule": {
|
|
6502
6484
|
"filename": "src/providers/common.ts",
|
|
6503
|
-
"line":
|
|
6485
|
+
"line": 165
|
|
6504
6486
|
},
|
|
6505
6487
|
"name": "runnerTokenPath",
|
|
6506
6488
|
"type": {
|
|
@@ -6854,6 +6836,6 @@
|
|
|
6854
6836
|
"symbolId": "src/providers/image-builders/static:StaticRunnerImage"
|
|
6855
6837
|
}
|
|
6856
6838
|
},
|
|
6857
|
-
"version": "0.
|
|
6858
|
-
"fingerprint": "
|
|
6839
|
+
"version": "0.5.0",
|
|
6840
|
+
"fingerprint": "TrXXmr6DqZTAl+tOVxWtqOc8yYawCSk66gd7FL7DqLY="
|
|
6859
6841
|
}
|
package/API.md
CHANGED
|
@@ -549,7 +549,7 @@ The CodeBuild builder is better and faster. Only use this one if you have no cho
|
|
|
549
549
|
|
|
550
550
|
Each builder re-runs automatically at a set interval to make sure the images contain the latest versions of everything.
|
|
551
551
|
|
|
552
|
-
You can create an instance of this construct to customize the image used to spin-up runners. Some runner providers may require custom components. Check the runner provider documentation. The default components work with CodeBuild.
|
|
552
|
+
You can create an instance of this construct to customize the image used to spin-up runners. Some runner providers may require custom components. Check the runner provider documentation. The default components work with CodeBuild and Fargate.
|
|
553
553
|
|
|
554
554
|
For example, to set a specific runner version, rebuild the image every 2 weeks, and add a few packages for the Fargate provider, use:
|
|
555
555
|
|
|
@@ -558,7 +558,7 @@ const builder = new ContainerImageBuilder(this, 'Builder', {
|
|
|
558
558
|
runnerVersion: RunnerVersion.specific('2.293.0'),
|
|
559
559
|
rebuildInterval: Duration.days(14),
|
|
560
560
|
});
|
|
561
|
-
new CodeBuildRunner(this, '
|
|
561
|
+
new CodeBuildRunner(this, 'CodeBuild provider', {
|
|
562
562
|
label: 'windows-codebuild',
|
|
563
563
|
imageBuilder: builder,
|
|
564
564
|
});
|
|
@@ -3162,7 +3162,6 @@ const runnerImage: RunnerImage = { ... }
|
|
|
3162
3162
|
| <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. |
|
|
3163
3163
|
| <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. |
|
|
3164
3164
|
| <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. |
|
|
3165
|
-
| <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. |
|
|
3166
3165
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.LogGroup</code> | Log group where image builds are logged. |
|
|
3167
3166
|
|
|
3168
3167
|
---
|
|
@@ -3215,22 +3214,6 @@ OS type of the image.
|
|
|
3215
3214
|
|
|
3216
3215
|
---
|
|
3217
3216
|
|
|
3218
|
-
##### `imageDigest`<sup>Optional</sup> <a name="imageDigest" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.imageDigest"></a>
|
|
3219
|
-
|
|
3220
|
-
```typescript
|
|
3221
|
-
public readonly imageDigest: string;
|
|
3222
|
-
```
|
|
3223
|
-
|
|
3224
|
-
- *Type:* string
|
|
3225
|
-
|
|
3226
|
-
Image digest for providers that need to know the digest like Lambda.
|
|
3227
|
-
|
|
3228
|
-
If the digest is not specified, imageTag must always point to a new tag on update. If not, the build may try to use the old image.
|
|
3229
|
-
|
|
3230
|
-
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.
|
|
3231
|
-
|
|
3232
|
-
---
|
|
3233
|
-
|
|
3234
3217
|
##### `logGroup`<sup>Optional</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.RunnerImage.property.logGroup"></a>
|
|
3235
3218
|
|
|
3236
3219
|
```typescript
|
package/README.md
CHANGED
|
@@ -32,17 +32,17 @@ The best way to browse API documentation is on [Constructs Hub][13]. It is avail
|
|
|
32
32
|
|
|
33
33
|
A runner provider creates compute resources on-demand and uses [actions/runner][5] to start a runner.
|
|
34
34
|
|
|
35
|
-
| | CodeBuild | Fargate
|
|
36
|
-
|
|
37
|
-
| **Time limit** | 8 hours | Unlimited
|
|
38
|
-
| **vCPUs** | 2, 4, 8, or 72 | 0.25 to 4
|
|
39
|
-
| **RAM** | 3gb, 7gb, 15gb, or 145gb | 512mb to 30gb
|
|
40
|
-
| **Storage** | 50gb to 824gb | 20gb to 200gb
|
|
41
|
-
| **Architecture** | x86_64, ARM64 | x86_64, ARM64
|
|
42
|
-
| **sudo** | ✔ | ✔
|
|
43
|
-
| **Docker** | ✔ (Linux only) | ❌
|
|
44
|
-
| **Spot pricing** | ❌ | ✔
|
|
45
|
-
| **OS** | Linux, Windows | Linux
|
|
35
|
+
| | CodeBuild | Fargate | Lambda |
|
|
36
|
+
|------------------|----------------------------|----------------|---------------|
|
|
37
|
+
| **Time limit** | 8 hours | Unlimited | 15 minutes |
|
|
38
|
+
| **vCPUs** | 2, 4, 8, or 72 | 0.25 to 4 | 1 to 6 |
|
|
39
|
+
| **RAM** | 3gb, 7gb, 15gb, or 145gb | 512mb to 30gb | 128mb to 10gb |
|
|
40
|
+
| **Storage** | 50gb to 824gb | 20gb to 200gb | Up to 10gb |
|
|
41
|
+
| **Architecture** | x86_64, ARM64 | x86_64, ARM64 | x86_64, ARM64 |
|
|
42
|
+
| **sudo** | ✔ | ✔ | ❌ |
|
|
43
|
+
| **Docker** | ✔ (Linux only) | ❌ | ❌ |
|
|
44
|
+
| **Spot pricing** | ❌ | ✔ | ❌ |
|
|
45
|
+
| **OS** | Linux, Windows | Linux, Windows | Linux |
|
|
46
46
|
|
|
47
47
|
The best provider to use mostly depends on your current infrastructure. When in doubt, CodeBuild is always a good choice. Execution history and logs are easy to view, and it has no restrictive limits unless you need to run for more than 8 hours.
|
|
48
48
|
|