@cloudsnorkel/cdk-github-runners 0.10.8 → 0.11.1

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.
Files changed (35) hide show
  1. package/.jsii +337 -26
  2. package/API.md +16 -2
  3. package/README.md +10 -0
  4. package/assets/delete-failed-runner.lambda/index.js +472 -5527
  5. package/assets/idle-runner-repear.lambda/index.js +472 -5527
  6. package/assets/setup.lambda/index.js +1 -0
  7. package/assets/status.lambda/index.js +478 -5527
  8. package/assets/token-retriever.lambda/index.js +472 -5527
  9. package/assets/webhook-handler.lambda/index.js +17590 -17
  10. package/lib/access.js +1 -1
  11. package/lib/image-builders/api.js +1 -1
  12. package/lib/image-builders/aws-image-builder/builder.js +1 -1
  13. package/lib/image-builders/aws-image-builder/deprecated/ami.js +1 -1
  14. package/lib/image-builders/aws-image-builder/deprecated/container.js +1 -1
  15. package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
  16. package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
  17. package/lib/image-builders/codebuild-deprecated.js +1 -1
  18. package/lib/image-builders/components.js +1 -1
  19. package/lib/image-builders/static.js +1 -1
  20. package/lib/providers/codebuild.js +2 -2
  21. package/lib/providers/common.js +3 -3
  22. package/lib/providers/ec2.js +4 -4
  23. package/lib/providers/ecs.d.ts +1 -1
  24. package/lib/providers/ecs.js +11 -6
  25. package/lib/providers/fargate.js +2 -2
  26. package/lib/providers/lambda.d.ts +1 -1
  27. package/lib/providers/lambda.js +10 -6
  28. package/lib/runner.d.ts +9 -0
  29. package/lib/runner.js +73 -3
  30. package/lib/secrets.js +1 -1
  31. package/lib/status.lambda.js +7 -1
  32. package/lib/webhook-handler.lambda.js +44 -8
  33. package/lib/webhook.d.ts +14 -1
  34. package/lib/webhook.js +7 -2
  35. package/package.json +11 -11
package/API.md CHANGED
@@ -3199,6 +3199,7 @@ new GitHubRunners(scope: Construct, id: string, props?: GitHubRunnersProps)
3199
3199
  | **Name** | **Description** |
3200
3200
  | --- | --- |
3201
3201
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.toString">toString</a></code> | Returns a string representation of this construct. |
3202
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.createLogsInsightsQueries">createLogsInsightsQueries</a></code> | Creates CloudWatch Logs Insights saved queries that can be used to debug issues with the runners. |
3202
3203
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.failedImageBuildsTopic">failedImageBuildsTopic</a></code> | Creates a topic for notifications when a runner image build fails. |
3203
3204
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed">metricFailed</a></code> | Metric for failed runner executions. |
3204
3205
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricJobCompleted">metricJobCompleted</a></code> | Metric for the number of GitHub Actions jobs completed. |
@@ -3215,6 +3216,19 @@ public toString(): string
3215
3216
 
3216
3217
  Returns a string representation of this construct.
3217
3218
 
3219
+ ##### `createLogsInsightsQueries` <a name="createLogsInsightsQueries" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.createLogsInsightsQueries"></a>
3220
+
3221
+ ```typescript
3222
+ public createLogsInsightsQueries(): void
3223
+ ```
3224
+
3225
+ Creates CloudWatch Logs Insights saved queries that can be used to debug issues with the runners.
3226
+
3227
+ * "Webhook errors" helps diagnose configuration issues with GitHub integration
3228
+ * "Ignored webhook" helps understand why runners aren't started
3229
+ * "Ignored jobs based on labels" helps debug label matching issues
3230
+ * "Webhook started runners" helps understand which runners were started
3231
+
3218
3232
  ##### `failedImageBuildsTopic` <a name="failedImageBuildsTopic" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.failedImageBuildsTopic"></a>
3219
3233
 
3220
3234
  ```typescript
@@ -3825,7 +3839,7 @@ Included components:
3825
3839
  * `RunnerImageComponent.githubRunner()`
3826
3840
  * `RunnerImageComponent.lambdaEntrypoint()`
3827
3841
 
3828
- Base Docker image: `public.ecr.aws/lambda/nodejs:14-x86_64` or `public.ecr.aws/lambda/nodejs:14-arm64`
3842
+ Base Docker image: `public.ecr.aws/lambda/nodejs:16-x86_64` or `public.ecr.aws/lambda/nodejs:16-arm64`
3829
3843
 
3830
3844
  ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.imageBuilder.parameter.scope"></a>
3831
3845
 
@@ -4185,7 +4199,7 @@ Included components:
4185
4199
  * `RunnerImageComponent.githubRunner()`
4186
4200
  * `RunnerImageComponent.lambdaEntrypoint()`
4187
4201
 
4188
- Base Docker image: `public.ecr.aws/lambda/nodejs:14-x86_64` or `public.ecr.aws/lambda/nodejs:14-arm64`
4202
+ Base Docker image: `public.ecr.aws/lambda/nodejs:16-x86_64` or `public.ecr.aws/lambda/nodejs:16-arm64`
4189
4203
 
4190
4204
  ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.LambdaRunnerProvider.imageBuilder.parameter.scope"></a>
4191
4205
 
package/README.md CHANGED
@@ -280,6 +280,16 @@ Runners are started in response to a webhook coming in from GitHub. If there are
280
280
  2. If you see too many errors, make sure you're only sending `workflow_job` events
281
281
  5. When using GitHub app, make sure there are active installations in `github.auth.app.installations`
282
282
 
283
+ All logs are saved in CloudWatch.
284
+ * Log group names can be found in `status.json` for each provider, image builder, and other parts of the system
285
+ * Some useful Logs Insights queries can be enabled with `GitHubRunners.createLogsInsightsQueries()`
286
+
287
+ To get `status.json`, check out the CloudFormation stack output for a command that generates it. The command looks like:
288
+
289
+ ```
290
+ aws --region us-east-1 lambda invoke --function-name status-XYZ123 status.json
291
+ ```
292
+
283
293
  ## Monitoring
284
294
 
285
295
  There are two important ways to monitor your runners: