Merge pull request #4192 from vadorovsky/vagrant-fixes

Various Vagrant improvements
This commit is contained in:
Michal Rostecki 2021-10-13 02:34:31 +02:00 committed by GitHub
commit 623f579869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

8
Vagrantfile vendored
View File

@ -1,4 +1,4 @@
OS = (ENV['OS'] || "alpine312") DISTRO = (ENV['DISTRO'] || "alpine312")
BOX_REPO = (ENV['BOX_REPO'] || "generic") BOX_REPO = (ENV['BOX_REPO'] || "generic")
HOME = ENV['HOME'] HOME = ENV['HOME']
PROJ_HOME = File.dirname(__FILE__) 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 # --- May need to add terminal to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access
def provision(vm, node_num) 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.box = (ENV["BOX_#{node_num}"] || ENV["BOX"] || "#{BOX_REPO}/#{node_os}")
vm.hostname = "#{PROJECT}-#{node_num}-#{vm.box.gsub(/^.*\//,"")}" vm.hostname = "#{PROJECT}-#{node_num}-#{vm.box.gsub(/^.*\//,"")}"
vm.network "private_network", ip: "#{NETWORK_PREFIX}.#{100+node_num}" vm.network "private_network", ip: "#{NETWORK_PREFIX}.#{100+node_num}"
@ -33,6 +33,10 @@ Vagrant.configure("2") do |config|
v.memory = NODE_MEMORY v.memory = NODE_MEMORY
v.customize ["modifyvm", :id, "--audio", "none"] v.customize ["modifyvm", :id, "--audio", "none"]
end end
config.vm.provider "libvirt" do |v|
v.cpus = NODE_CPUS
v.memory = NODE_MEMORY
end
if Vagrant.has_plugin?("vagrant-timezone") if Vagrant.has_plugin?("vagrant-timezone")
config.timezone.value = :host config.timezone.value = :host
end end

View File

@ -9,17 +9,32 @@ export SELINUX=true
EOF EOF
. /etc/profile.d/build.sh . /etc/profile.d/build.sh
# --- # ---
apt-get update
apt-get install -y \ apt-get install -y \
build-essential \ build-essential \
pkg-config \ ca-certificates \
curl \
docker.io \
gcc \
git \
jq \
libffi-dev \
libseccomp-dev \ libseccomp-dev \
libsqlite3-dev \ libsqlite3-dev \
libselinux1-dev \ libselinux1-dev \
libuv1-dev \
make \
npm \
pkg-config \
python3 \
squashfs-tools \
tar \
wget \
vim \
zip \
zlib1g-dev \ 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 go get -u github.com/go-delve/delve/cmd/dlv
# --- # ---

View File

@ -0,0 +1 @@
ubuntu1804