Skip to content

Commit

Permalink
MINOR: kafka system tests should support larger EBS volumes for newer…
Browse files Browse the repository at this point in the history
… instances (apache#12382) (apache#738)

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 <djacot@confluent.io>
  • Loading branch information
lbradstreet committed Jul 8, 2022
1 parent 15274f4 commit a9a293e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ ec2_subnet_id = nil
# Only override this by setting it to false if you're running in a VPC and you
# are running Vagrant from within that VPC as well.
ec2_associate_public_ip = nil
ec2_iam_instance_profile_name = nil

ebs_volume_type = 'gp3'

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

# override any instance type set by Vagrantfile.local or above via an environment variable
if ENV['INSTANCE_TYPE'] then
ec2_instance_type = ENV['INSTANCE_TYPE']
end

# choose size based on overridden size
if ec2_instance_type.start_with?("m3") then
ebs_volume_size = 20
else
ebs_volume_size = 40
end

# TODO(ksweeney): RAM requirements are not empirical and can probably be significantly lowered.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.hostmanager.enabled = enable_hostmanager
Expand Down Expand Up @@ -118,9 +133,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
aws.region = ec2_region
aws.availability_zone = ec2_az
aws.instance_type = ec2_instance_type

aws.ami = ec2_ami
aws.security_groups = ec2_security_groups
aws.subnet_id = ec2_subnet_id
aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeType' => ebs_volume_type, 'Ebs.VolumeSize' => ebs_volume_size }]
# If a subnet is specified, default to turning on a public IP unless the
# user explicitly specifies the option. Without a public IP, Vagrant won't
# be able to SSH into the hosts unless Vagrant is also running in the VPC.
Expand All @@ -133,6 +150,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
region.spot_instance = ec2_spot_instance
region.spot_max_price = ec2_spot_max_price
end
aws.iam_instance_profile_name = ec2_iam_instance_profile_name

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

0 comments on commit a9a293e

Please sign in to comment.