Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

kichik
Copy link
Member

@kichik kichik commented Nov 22, 2024

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

Throw an exception during build time if the EC2 runner storage size is smaller than the AMI size set in the image builder. This could result in errors like:

```
Ec2.Ec2Exception: Volume of size 30GB is smaller than snapshot 'snap-0123456789abc', expect size>= 100GB
```
@mergify mergify bot merged commit 8d7757b into main Nov 22, 2024
16 checks passed
@mergify mergify bot deleted the mismatch-ec2-storage-size branch November 22, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant