CloudSnorkel / cdk-github-runners

CDK constructs for self-hosted GitHub Actions runners
https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/
Apache License 2.0
255 stars 37 forks source link

feat: Windows fast launch #521

Closed kichik closed 1 month ago

kichik commented 2 months ago

Add an option for enabling fast launch for Windows AMIs. This should speed up booting up of EC2 Windows runners.

Note that it does come with extra cost.

const ec2WindowsImageBuilder = Ec2RunnerProvider.imageBuilder(stack, 'Windows EC2 Builder', {
  os: Os.WINDOWS,
  vpc,
  awsImageBuilderOptions: {
    fastLaunchOptions: {
      enabled: true,
    },
  },
});
const runners = new GitHubRunners(stack, 'runners', {
  providers: [
    new Ec2RunnerProvider(stack, 'Fast Windows', {
      labels: ['windows'],
      imageBuilder: ec2WindowsImageBuilder,
    }),
  ],
}

Before:

image

After:

image

Resolves #466 Closes #514

pharindoko commented 2 months ago

Tried it out: Works super easy and great. Only thing I have found - 5 subnets are listed in the stepfunctions while I only provided 2.

image
kichik commented 2 months ago

Thanks! Not sure how the subnets can change as nothing was modified on the provider side. Would you mind sharing the code that limits to two subnets?

pharindoko commented 2 months ago

will check this next week and try it out in another account as well.

pharindoko commented 1 month ago

@kichik As promised I tried it out in another account with non-default vpc and it works as well in a super nice way. Havent seen any issues yet :) - so heres my approval :D

kichik commented 1 month ago

Thanks @pharindoko!