|
@@ -25,7 +25,7 @@ def provision_bootstrap(config, role)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-def provider_aws(config, role, ip_address)
|
|
|
|
|
|
+def provider_aws(config, role, ip_address='172.16.0.16')
|
|
config.vm.provider :aws do |aws, override|
|
|
config.vm.provider :aws do |aws, override|
|
|
aws.access_key_id = ENV['TFB_AWS_ACCESS_KEY']
|
|
aws.access_key_id = ENV['TFB_AWS_ACCESS_KEY']
|
|
aws.secret_access_key = ENV['TFB_AWS_SECRET_KEY']
|
|
aws.secret_access_key = ENV['TFB_AWS_SECRET_KEY']
|
|
@@ -40,34 +40,42 @@ def provider_aws(config, role, ip_address)
|
|
# This is 64-bit Ubuntu 14.04 US east EBS
|
|
# This is 64-bit Ubuntu 14.04 US east EBS
|
|
# See http://cloud-images.ubuntu.com/vagrant/trusty/current/
|
|
# See http://cloud-images.ubuntu.com/vagrant/trusty/current/
|
|
# for comparison to the Ubuntu Vagrant VirtualBox boxes
|
|
# for comparison to the Ubuntu Vagrant VirtualBox boxes
|
|
- aws.ami = "ami-62c8160a"
|
|
|
|
|
|
+ aws.ami = "ami-f6bf659e"
|
|
override.ssh.username = "ubuntu"
|
|
override.ssh.username = "ubuntu"
|
|
-
|
|
|
|
-
|
|
|
|
- aws.region = ENV.fetch('TFB_AWS_REGION', 'us-east-1')
|
|
|
|
|
|
|
|
aws.private_ip_address = ip_address
|
|
aws.private_ip_address = ip_address
|
|
aws.associate_public_ip = true
|
|
aws.associate_public_ip = true
|
|
|
|
+ aws.region = ENV.fetch('TFB_AWS_REGION', 'us-east-1')
|
|
aws.subnet_id = ENV['TFB_AWS_SUBNET'] # subnet-2737230f for me
|
|
aws.subnet_id = ENV['TFB_AWS_SUBNET'] # subnet-2737230f for me
|
|
aws.security_groups = [ENV['TFB_AWS_SEC_GROUP']] # sg-871240e2
|
|
aws.security_groups = [ENV['TFB_AWS_SEC_GROUP']] # sg-871240e2
|
|
|
|
+ aws.instance_type = ENV.fetch('TFB_AWS_EC2_TYPE', 'm1.large')
|
|
|
|
|
|
aws.tags = {
|
|
aws.tags = {
|
|
'Project' => 'FrameworkBenchmarks',
|
|
'Project' => 'FrameworkBenchmarks',
|
|
'TFB_role' => role
|
|
'TFB_role' => role
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # Setup disk. Defauly is 15GB General Purpose SSD
|
|
# Double the default volume size, as we download and
|
|
# Double the default volume size, as we download and
|
|
# install a *lot* of stuff
|
|
# install a *lot* of stuff
|
|
|
|
+ # Documentation is at http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-template.html
|
|
|
|
+ aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1',
|
|
|
|
+ 'Ebs.VolumeSize' => 15 ,
|
|
|
|
+ 'Ebs.DeleteOnTermination' => ENV.fetch('TFB_AWS_EBS_DELETE', true),
|
|
|
|
+ 'Ebs.VolumeType' => ENV.fetch('TFB_AWS_EBS_TYPE', 'gp2')
|
|
|
|
+ }]
|
|
|
|
+ if ENV.fetch('TFB_AWS_EBS_TYPE', 'standard') == 'io1'
|
|
|
|
+ aws.block_device_mapping[0]['Ebs.Iops'] = ENV.fetch('TFB_AWS_EBS_IO', '1000')
|
|
|
|
+ end
|
|
|
|
|
|
- # TODO use http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-template.html
|
|
|
|
- # and read the type from the environment
|
|
|
|
- aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeSize' => 15 }]
|
|
|
|
|
|
+ if ENV.fetch('TFB_FORCE_SYNC', "false") == "true"
|
|
|
|
+ override.vm.synced_folder "../../..", "/FrameworkBenchmarks"
|
|
|
|
+ end
|
|
|
|
|
|
- aws.instance_type = "m1.small"
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-def provider_virtualbox(config, role, ip_address)
|
|
|
|
|
|
+def provider_virtualbox(config, role)
|
|
config.vm.provider :virtualbox do |vb, override|
|
|
config.vm.provider :virtualbox do |vb, override|
|
|
override.vm.hostname = "TFB-#{role}"
|
|
override.vm.hostname = "TFB-#{role}"
|
|
|
|
|
|
@@ -75,11 +83,6 @@ def provider_virtualbox(config, role, ip_address)
|
|
if ENV.fetch('TFB_VM_ARCH','64') == "32"
|
|
if ENV.fetch('TFB_VM_ARCH','64') == "32"
|
|
override.vm.box = "ubuntu/trusty32"
|
|
override.vm.box = "ubuntu/trusty32"
|
|
end
|
|
end
|
|
-
|
|
|
|
- # Use a non-standard value here as most home networks are
|
|
|
|
- # 192.168.X.X or 10.X.X.X and we cannot have a collision
|
|
|
|
- # with the host network
|
|
|
|
- override.vm.network "private_network", ip: ip_address
|
|
|
|
|
|
|
|
if ENV.fetch('TFB_SHOW_VM', false)
|
|
if ENV.fetch('TFB_SHOW_VM', false)
|
|
vb.gui = true
|
|
vb.gui = true
|