CloudSnorkel / cdk-github-runners

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

fix: Fail early for storage size mismatch in EC2 #659

Closed kichik closed 5 days ago

kichik commented 5 days ago

Throw an exception during build time if the EC2 runner storage size is smaller than the AMI size set in the image builder. Before this change, code like this:

new GitHubRunners(stack, 'runners', {
  providers: [
    new Ec2RunnerProvider(stack, 'EC2 Linux', {
      imageBuilder: Ec2RunnerProvider.imageBuilder(stack, 'EC2 Linux Builder', {
        awsImageBuilderOptions: {
          storageSize: cdk.Size.gibibytes(100),
        },
      }),
      storageSize: cdk.Size.gibibytes(30),
    }),
  ],
});

could result in errors in the step function that are harder to debug:

Ec2.Ec2Exception: Volume of size 30GB is smaller than snapshot 'snap-0123456789abc', expect size>= 100GB