Skip to content

Commit a521bbd

Browse files
authored
MINOR: kafka system tests should support larger EBS volumes for newer instances (#12382)
When running with 4th generation instances supporting EBS only, we need to use a larger volume or else we run out of disk space during a system test run. This change also parameterizes the instance type as an env variable for easier testing. Reviewers: David Jacot <[email protected]>
1 parent ca8135b commit a521bbd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Vagrantfile

+18
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ ec2_subnet_id = nil
5151
# Only override this by setting it to false if you're running in a VPC and you
5252
# are running Vagrant from within that VPC as well.
5353
ec2_associate_public_ip = nil
54+
ec2_iam_instance_profile_name = nil
55+
56+
ebs_volume_type = 'gp3'
5457

5558
jdk_major = '8'
5659
jdk_full = '8u202-linux-x64'
@@ -60,6 +63,18 @@ if File.exists?(local_config_file) then
6063
eval(File.read(local_config_file), binding, "Vagrantfile.local")
6164
end
6265

66+
# override any instance type set by Vagrantfile.local or above via an environment variable
67+
if ENV['INSTANCE_TYPE'] then
68+
ec2_instance_type = ENV['INSTANCE_TYPE']
69+
end
70+
71+
# choose size based on overridden size
72+
if ec2_instance_type.start_with?("m3") then
73+
ebs_volume_size = 20
74+
else
75+
ebs_volume_size = 40
76+
end
77+
6378
# TODO(ksweeney): RAM requirements are not empirical and can probably be significantly lowered.
6479
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
6580
config.hostmanager.enabled = enable_hostmanager
@@ -118,9 +133,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
118133
aws.region = ec2_region
119134
aws.availability_zone = ec2_az
120135
aws.instance_type = ec2_instance_type
136+
121137
aws.ami = ec2_ami
122138
aws.security_groups = ec2_security_groups
123139
aws.subnet_id = ec2_subnet_id
140+
aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeType' => ebs_volume_type, 'Ebs.VolumeSize' => ebs_volume_size }]
124141
# If a subnet is specified, default to turning on a public IP unless the
125142
# user explicitly specifies the option. Without a public IP, Vagrant won't
126143
# be able to SSH into the hosts unless Vagrant is also running in the VPC.
@@ -133,6 +150,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
133150
region.spot_instance = ec2_spot_instance
134151
region.spot_max_price = ec2_spot_max_price
135152
end
153+
aws.iam_instance_profile_name = ec2_iam_instance_profile_name
136154

137155
# Exclude some directories that can grow very large from syncing
138156
override.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ['.git', 'core/data/', 'logs/', 'tests/results/', 'results/']

0 commit comments

Comments
 (0)