diff --git a/API.md b/API.md index f9926d66..8c28128d 100644 --- a/API.md +++ b/API.md @@ -4231,6 +4231,8 @@ 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. + --- ##### ~~`label`~~Optional @@ -4613,6 +4615,8 @@ 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. + --- ##### `instanceType`Optional @@ -4908,6 +4912,8 @@ Provider running an image to run inside CodeBuild with GitHub runner pre-configu A user named `runner` is expected to exist. +The image builder determines the OS and architecture of the runner. + --- ##### ~~`label`~~Optional @@ -5417,6 +5423,8 @@ Provider running an image to run inside CodeBuild with GitHub runner pre-configu 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. + > [https://github.com/CloudSnorkel/cdk-github-runners/tree/main/src/providers/docker-images/lambda](https://github.com/CloudSnorkel/cdk-github-runners/tree/main/src/providers/docker-images/lambda) --- diff --git a/README.md b/README.md index 2279b597..2aec4ac1 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) diff --git a/src/providers/codebuild.ts b/src/providers/codebuild.ts index 0b806dbd..efa642fa 100644 --- a/src/providers/codebuild.ts +++ b/src/providers/codebuild.ts @@ -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; diff --git a/src/providers/ec2.ts b/src/providers/ec2.ts index 41323861..82d07ba0 100644 --- a/src/providers/ec2.ts +++ b/src/providers/ec2.ts @@ -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; diff --git a/src/providers/fargate.ts b/src/providers/fargate.ts index fc9348fa..b69969da 100644 --- a/src/providers/fargate.ts +++ b/src/providers/fargate.ts @@ -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; diff --git a/src/providers/lambda.ts b/src/providers/lambda.ts index beaaeb97..c63efed6 100644 --- a/src/providers/lambda.ts +++ b/src/providers/lambda.ts @@ -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 */