From f830d09d6e5055b1b95f8ed45836bb7ca4271d02 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Tue, 7 Sep 2021 14:18:26 +0200 Subject: [PATCH 1/4] vagrant: Change OS environment variable to DISTRO On many Linux distributions (including openSUSE) the OS env variable is already used with value "Linux". This results in weird errors like: ==> .1: Box 'generic/Linux' could not be found. Attempting to find and install... To avoid the conflict, use the more neutral and less likely to be taken DISTRO variable. Signed-off-by: Michal Rostecki --- Vagrantfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index da0081105a..01f884c39b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,4 +1,4 @@ -OS = (ENV['OS'] || "alpine312") +DISTRO = (ENV['DISTRO'] || "alpine312") BOX_REPO = (ENV['BOX_REPO'] || "generic") HOME = ENV['HOME'] PROJ_HOME = File.dirname(__FILE__) @@ -17,7 +17,7 @@ MOUNT_TYPE = ENV['MOUNT_TYPE'] || "virtualbox" # --- May need to add terminal to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access def provision(vm, node_num) - node_os = (ENV["OS_#{node_num}"] || OS) + node_os = (ENV["DISTRO_#{node_num}"] || DISTRO) vm.box = (ENV["BOX_#{node_num}"] || ENV["BOX"] || "#{BOX_REPO}/#{node_os}") vm.hostname = "#{PROJECT}-#{node_num}-#{vm.box.gsub(/^.*\//,"")}" vm.network "private_network", ip: "#{NETWORK_PREFIX}.#{100+node_num}" From e420583684480bbe21f96a3636f2600f2130b910 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Tue, 7 Sep 2021 14:21:39 +0200 Subject: [PATCH 2/4] vagrant: Add support for vagrant-libvirt This change adds support for libvirt provider. Please note that libvirt doesn't support the "virtualbox" mount type, so an another MOUNT_TYPE has to be provided while using libvirt. 9p works well. Signed-off-by: Michal Rostecki --- Vagrantfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 01f884c39b..a975a01bc1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -33,6 +33,10 @@ Vagrant.configure("2") do |config| v.memory = NODE_MEMORY v.customize ["modifyvm", :id, "--audio", "none"] end + config.vm.provider "libvirt" do |v| + v.cpus = NODE_CPUS + v.memory = NODE_MEMORY + end if Vagrant.has_plugin?("vagrant-timezone") config.timezone.value = :host end From 5e012011955169d7d00f0588f008000e3147c4e6 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Tue, 12 Oct 2021 15:06:56 +0200 Subject: [PATCH 3/4] vagrant: Update package list for Ubuntu Before this change, Ubuntu provisioning script used the package list from Alpine. But a lot of packages from that list have name mismatches. Biggest example - `docker`, which has nothing to do with Docker as a container engine in Ubuntu (the proper package is `docker.io`). Let's just keep the full list for Ubuntu in its own provisioning script. Signed-off-by: Michal Rostecki --- scripts/provision/generic/ubuntu1804/vagrant | 23 ++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/provision/generic/ubuntu1804/vagrant b/scripts/provision/generic/ubuntu1804/vagrant index fd784a05cc..ef3d89eb83 100755 --- a/scripts/provision/generic/ubuntu1804/vagrant +++ b/scripts/provision/generic/ubuntu1804/vagrant @@ -9,17 +9,32 @@ export SELINUX=true EOF . /etc/profile.d/build.sh # --- +apt-get update apt-get install -y \ build-essential \ - pkg-config \ + ca-certificates \ + curl \ + docker.io \ + gcc \ + git \ + jq \ + libffi-dev \ libseccomp-dev \ libsqlite3-dev \ libselinux1-dev \ + libuv1-dev \ + make \ + npm \ + pkg-config \ + python3 \ + squashfs-tools \ + tar \ + wget \ + vim \ + zip \ zlib1g-dev \ + zstd -# --- -sed -E 's|apk( -U)?( --no-cache)?( --repository [^ ]*)? add|apt-get install -y|g' -i /tmp/docker-run -. /tmp/docker-run # --- go get -u github.com/go-delve/delve/cmd/dlv # --- From d6b6a3ee9f7f92702b2919062de649b8a8468c79 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Tue, 12 Oct 2021 15:09:27 +0200 Subject: [PATCH 4/4] vagrant: Add Ubuntu 21.04 support By simply adding a symlink. Signed-off-by: Michal Rostecki --- scripts/provision/generic/ubuntu2104 | 1 + 1 file changed, 1 insertion(+) create mode 120000 scripts/provision/generic/ubuntu2104 diff --git a/scripts/provision/generic/ubuntu2104 b/scripts/provision/generic/ubuntu2104 new file mode 120000 index 0000000000..967c57335e --- /dev/null +++ b/scripts/provision/generic/ubuntu2104 @@ -0,0 +1 @@ +ubuntu1804 \ No newline at end of file