Skip to content

Commit

Permalink
chore: Better documentation of ARM64 usage (#245)
Browse files Browse the repository at this point in the history
Fix #243
  • Loading branch information
kichik authored Feb 27, 2023
1 parent 1ad318f commit a62cecf
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
8 changes: 8 additions & 0 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const myProvider = new FargateRunnerProvider(this, 'fargate runner', {
label: 'customized-windows-fargate',
vpc: vpc,
securityGroup: runnerSg,
imageBuiler: myWindowsBuilder,
imageBuidler: myWindowsBuilder,
});

// create the runner infrastructure
Expand All @@ -184,6 +184,23 @@ new GitHubRunners(stack, 'runners', {
});
```

The runner OS and architecture is determined by the image it is set to use. For example, to create a CodeBuild runner provider for ARM64 set the `architecture` property for the image builder to `Architecture.ARM64` and use the `LINUX_ARM64_DOCKERFILE_PATH` constant.

```typescript
new GitHubRunners(stack, 'runners', {
providers: [
new FargateRunnerProvider(this, 'fargate runner', {
labels: ['arm64', 'fargate'],
imageBuidler: new CodeBuildImageBuilder(this, 'image builder', {
architecture: Architecture.ARM64,
os: Os.LINUX,
dockerfilePath: FargateRunner.LINUX_ARM64_DOCKERFILE_PATH,
}),
}),
],
});
```

## Architecture

![Architecture diagram](architecture.svg)
Expand Down
2 changes: 2 additions & 0 deletions src/providers/codebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface CodeBuildRunnerProviderProps extends RunnerProviderProps {
/**
* Image builder for CodeBuild image with GitHub runner pre-configured. A user named `runner` is expected to exist with access to Docker-in-Docker.
*
* The image builder determines the OS and architecture of the runner.
*
* @default image builder with `CodeBuildRunner.LINUX_X64_DOCKERFILE_PATH` as Dockerfile
*/
readonly imageBuilder?: IImageBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/providers/ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export interface Ec2RunnerProviderProps extends RunnerProviderProps {
/**
* AMI builder that creates AMIs with GitHub runner pre-configured. On Linux, a user named `runner` is expected to exist with access to Docker.
*
* The AMI builder determines the OS and architecture of the runner.
*
* @default AMI builder for Ubuntu Linux on the same subnet as configured by {@link vpc} and {@link subnetSelection}
*/
readonly amiBuilder?: IAmiBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/providers/fargate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export interface FargateRunnerProviderProps extends RunnerProviderProps {
/**
* Provider running an image to run inside CodeBuild with GitHub runner pre-configured. A user named `runner` is expected to exist.
*
* The image builder determines the OS and architecture of the runner.
*
* @default image builder with `FargateRunner.LINUX_X64_DOCKERFILE_PATH` as Dockerfile
*/
readonly imageBuilder?: IImageBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/providers/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export interface LambdaRunnerProviderProps extends RunnerProviderProps {
*
* The default command (`CMD`) should be `["runner.handler"]` which points to an included `runner.js` with a function named `handler`. The function should start the GitHub runner.
*
* The image builder determines the OS and architecture of the runner.
*
* @see https://github.com/CloudSnorkel/cdk-github-runners/tree/main/src/providers/docker-images/lambda
* @default image builder with LambdaRunner.LINUX_X64_DOCKERFILE_PATH as Dockerfile
*/
Expand Down

0 comments on commit a62cecf

Please sign in to comment.