Browse Source

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 <djacot@confluent.io>
pull/12389/head
Lucas Bradstreet 2 years ago committed by GitHub
parent
commit
a521bbd755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      Vagrantfile

18
Vagrantfile vendored

@ -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 # 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. # are running Vagrant from within that VPC as well.
ec2_associate_public_ip = nil ec2_associate_public_ip = nil
ec2_iam_instance_profile_name = nil
ebs_volume_type = 'gp3'
jdk_major = '8' jdk_major = '8'
jdk_full = '8u202-linux-x64' jdk_full = '8u202-linux-x64'
@ -60,6 +63,18 @@ if File.exists?(local_config_file) then
eval(File.read(local_config_file), binding, "Vagrantfile.local") eval(File.read(local_config_file), binding, "Vagrantfile.local")
end 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. # TODO(ksweeney): RAM requirements are not empirical and can probably be significantly lowered.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.hostmanager.enabled = enable_hostmanager config.hostmanager.enabled = enable_hostmanager
@ -118,9 +133,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
aws.region = ec2_region aws.region = ec2_region
aws.availability_zone = ec2_az aws.availability_zone = ec2_az
aws.instance_type = ec2_instance_type aws.instance_type = ec2_instance_type
aws.ami = ec2_ami aws.ami = ec2_ami
aws.security_groups = ec2_security_groups aws.security_groups = ec2_security_groups
aws.subnet_id = ec2_subnet_id 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 # 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 # 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. # 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|
region.spot_instance = ec2_spot_instance region.spot_instance = ec2_spot_instance
region.spot_max_price = ec2_spot_max_price region.spot_max_price = ec2_spot_max_price
end end
aws.iam_instance_profile_name = ec2_iam_instance_profile_name
# Exclude some directories that can grow very large from syncing # 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/'] override.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ['.git', 'core/data/', 'logs/', 'tests/results/', 'results/']

Loading…
Cancel
Save