script/vagrant: split into functions - setup ssh and vagrant-cachier
Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com> Change-Id: I871ec3f64ba3680ea382ac5e71c5bab4e340c94a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3716 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
221c5b5ee2
commit
211be73970
36
scripts/vagrant/Vagrantfile
vendored
36
scripts/vagrant/Vagrantfile
vendored
@ -176,6 +176,26 @@ def setup_ocssd_disk(libvirt, disk, index)
|
|||||||
libvirt.qemuargs :value => "nvme,drive=#{nvme_disk_id},serial=deadbeef,oacs=0,namespaces=1,lver=2,lba_index=4,mdts=10,lnum_lun=8,lnum_pln=2,lpgs_per_blk=1536,lsecs_per_pg=2,lblks_per_pln=45,metadata=#{nvme_disk}_ocssd_md,nsdatafile=#{nvme_disk}_ocssd_blknvme.ns,laer_thread_sleep=3000,stride=4"
|
libvirt.qemuargs :value => "nvme,drive=#{nvme_disk_id},serial=deadbeef,oacs=0,namespaces=1,lver=2,lba_index=4,mdts=10,lnum_lun=8,lnum_pln=2,lpgs_per_blk=1536,lsecs_per_pg=2,lblks_per_pln=45,metadata=#{nvme_disk}_ocssd_md,nsdatafile=#{nvme_disk}_ocssd_blknvme.ns,laer_thread_sleep=3000,stride=4"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setup_ssh(config)
|
||||||
|
config.ssh.forward_agent = true
|
||||||
|
config.ssh.forward_x11 = true
|
||||||
|
if ENV['VAGRANT_PASSWORD_AUTH'] == "1"
|
||||||
|
config.ssh.username = "vagrant"
|
||||||
|
config.ssh.password = "vagrant"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def setup_vagrant_cachier(config, plugins_sync_backend)
|
||||||
|
if Vagrant.has_plugin?("vagrant-cachier")
|
||||||
|
config.cache.scope = :box
|
||||||
|
config.cache.synced_folder_opts = plugins_sync_backend
|
||||||
|
else
|
||||||
|
puts 'vagrant-cachier caches apt/yum etc to speed subsequent vagrant up'
|
||||||
|
puts 'to enable install vagrant-cachier plugin: '
|
||||||
|
puts 'vagrant plugin install vagrant-cachier'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
|
|
||||||
# Pick the right distro and bootstrap, default is fedora30
|
# Pick the right distro and bootstrap, default is fedora30
|
||||||
@ -230,13 +250,7 @@ Vagrant.configure(2) do |config|
|
|||||||
|
|
||||||
# vagrant-cachier caches apt/yum etc to speed subsequent
|
# vagrant-cachier caches apt/yum etc to speed subsequent
|
||||||
# vagrant up
|
# vagrant up
|
||||||
# to enable, run
|
setup_vagrant_cachier(config, plugins_sync_backend)
|
||||||
# vagrant plugin install vagrant-cachier
|
|
||||||
#
|
|
||||||
if Vagrant.has_plugin?("vagrant-cachier")
|
|
||||||
config.cache.scope = :box
|
|
||||||
config.cache.synced_folder_opts = plugins_sync_backend
|
|
||||||
end
|
|
||||||
|
|
||||||
# use http proxy if avaiable
|
# use http proxy if avaiable
|
||||||
setup_proxy(config, distro)
|
setup_proxy(config, distro)
|
||||||
@ -251,12 +265,8 @@ Vagrant.configure(2) do |config|
|
|||||||
# local copy.
|
# local copy.
|
||||||
make_spdk_local_copy_of_nfs(config,distro) if plugins_sync_backend[:type] == :nfs
|
make_spdk_local_copy_of_nfs(config,distro) if plugins_sync_backend[:type] == :nfs
|
||||||
|
|
||||||
config.ssh.forward_agent = true
|
# Setup SSH
|
||||||
config.ssh.forward_x11 = true
|
setup_ssh(config)
|
||||||
if ENV['VAGRANT_PASSWORD_AUTH'] == "1"
|
|
||||||
config.ssh.username = "vagrant"
|
|
||||||
config.ssh.password = "vagrant"
|
|
||||||
end
|
|
||||||
|
|
||||||
config.vm.provider "virtualbox" do |vb|
|
config.vm.provider "virtualbox" do |vb|
|
||||||
vb.customize ["modifyvm", :id, "--ioapic", "on"]
|
vb.customize ["modifyvm", :id, "--ioapic", "on"]
|
||||||
|
Loading…
Reference in New Issue
Block a user