You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by da...@apache.org on 2022/07/07 07:14:22 UTC

[kafka] branch trunk updated: MINOR: kafka system tests should support larger EBS volumes for newer instances (#12382)

This is an automated email from the ASF dual-hosted git repository.

dajac pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a521bbd7552 MINOR: kafka system tests should support larger EBS volumes for newer instances (#12382)
a521bbd7552 is described below

commit a521bbd7552f61af1fe956ef5d3f84567f8a4642
Author: Lucas Bradstreet <lu...@gmail.com>
AuthorDate: Thu Jul 7 00:14:05 2022 -0700

    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 <dj...@confluent.io>
---
 Vagrantfile | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Vagrantfile b/Vagrantfile
index ee08487be66..a053be28d01 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -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'
@@ -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
@@ -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.
@@ -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/']