fix: 40GB disk for docker Spot instances (monorepo + Docker layers)
This commit is contained in:
@@ -309,6 +309,12 @@ func startSpotRunner(ctx context.Context, c cfg, label, runID string) (string, e
|
||||
|
||||
client := ec2.NewFromConfig(awsCfg)
|
||||
|
||||
// Docker builds need more disk (monorepo + layers)
|
||||
diskSize := int32(20)
|
||||
if label == "docker" {
|
||||
diskSize = 40
|
||||
}
|
||||
|
||||
out, err := client.RunInstances(ctx, &ec2.RunInstancesInput{
|
||||
ImageId: aws.String(c.AMI),
|
||||
InstanceType: ec2types.InstanceType(spot.InstanceType),
|
||||
@@ -316,6 +322,16 @@ func startSpotRunner(ctx context.Context, c cfg, label, runID string) (string, e
|
||||
MaxCount: aws.Int32(1),
|
||||
UserData: aws.String(userData),
|
||||
|
||||
// Root volume — bigger for Docker builds
|
||||
BlockDeviceMappings: []ec2types.BlockDeviceMapping{{
|
||||
DeviceName: aws.String("/dev/xvda"),
|
||||
Ebs: &ec2types.EbsBlockDevice{
|
||||
VolumeSize: aws.Int32(diskSize),
|
||||
VolumeType: ec2types.VolumeTypeGp3,
|
||||
DeleteOnTermination: aws.Bool(true),
|
||||
},
|
||||
}},
|
||||
|
||||
// Spot request
|
||||
InstanceMarketOptions: &ec2types.InstanceMarketOptionsRequest{
|
||||
MarketType: ec2types.MarketTypeSpot,
|
||||
|
||||
Reference in New Issue
Block a user