Skip to content

Commit

Permalink
Merge pull request #800 from KrisThielemans/VM_improvements
Browse files Browse the repository at this point in the history
VM scripts improvements
  • Loading branch information
KrisThielemans authored Jan 22, 2023
2 parents 25a1ba8 + 8f133f7 commit d50fce8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- CMake: 3.21.3
- fixes documentation
- use the VMSVGA graphics controller
- use environment variables in Vagrantfile for easier building
- updated versions:
- SIRF: v3.4.0
- CIL: a6062410028c9872c5b355be40b96ed1497fed2a > 22.1.0
Expand Down
3 changes: 2 additions & 1 deletion VirtualBox/scripts/bootstrap_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Script to create the SyneRBI VM. Do not use for your own system!
# Any arguments will be passed through to UPDATE.sh -s
#
# Authors: Kris Thielemans, Evgueni Ovtchinnikov, Edoardo Pasca,
# Casper da Costa-Luis
Expand Down Expand Up @@ -95,4 +96,4 @@ else
fi

chown -R $SIRFUSERNAME:users $userHOME
sudo -u $SIRFUSERNAME -H bash $userHOME/devel/SIRF-SuperBuild/VirtualBox/scripts/UPDATE.sh -s
sudo -u $SIRFUSERNAME -H bash $userHOME/devel/SIRF-SuperBuild/VirtualBox/scripts/UPDATE.sh -s $*
5 changes: 4 additions & 1 deletion VirtualBox/scripts/first_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ location=`dirname $0`

# script to adjust gnome settings and other bits to be run only once
# after VM is created

echo "Configuring GNOME"
"$location/configure_gnome.sh"

#configure jupyter notebook
echo "configuring jupyter server"
"$location/configure_jupyter.sh"

echo "Done"
echo "Before exporting the VM, please run either $location/zero_fill.sh or $location/clean_before_VM_export.sh."

13 changes: 13 additions & 0 deletions VirtualBox/vagrant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ vagrant plugin install vagrant-vbguest

Make sure there is no other SIRF VM running (as it will mean vagrant aborts due to a port forwarding conflict)

### Set environment variables used in the Vagrantfile
We currently have the following:
- `VB_CPUS` (defaults to 4): number of virtual CPUs used by the VM
- `VB_RAM` (defaults to 6096): system RAM to be used by the VM
- `VB_NAME` (defaults to "SIRF 3.4.0")
- `UPDATE_ARGS` (defaults to "-j `nproc`"): any arguments to be passed to the `UPDATE.sh` script.

For example in Windows Powershell:
```ps
$Env:UPDATE_ARGS="-t origin/master -j 4"
```
will make sure we use current `master` (as opposed to the latest release), with a parallel build of max 4 processes.

### Start the machine

```
Expand Down
15 changes: 10 additions & 5 deletions VirtualBox/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Vagrant.configure("2") do |config|
# Display the VirtualBox GUI when booting the machine
vb.gui = true

# Customize the amount of memory on the VM:
vb.cpus = "2"
vb.memory = "6096"
# Customize number of processors (default: 4) and the amount of memory on the VM:
vb.cpus = ENV["VB_CPUS"] || "4"
vb.memory = ENV["VB_RAM"] || "6096"

vb.customize "pre-boot", [
"storageattach", :id,
Expand All @@ -74,7 +74,7 @@ Vagrant.configure("2") do |config|
"--medium", "emptydrive"
]

vb.name = "SIRF 3.4.0"
vb.name = ENV["VB_NAME"] || "SIRF 3.4.0"
vb.customize ["modifyvm", :id,
"--clipboard", "bidirectional",
'--graphicscontroller', 'vmsvga',
Expand All @@ -97,6 +97,11 @@ Vagrant.configure("2") do |config|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.

config.vm.provision "shell", path: "../scripts/bootstrap_ubuntu.sh"
# install packages and build SIRF-SuperBuild
# default is using the latest tag and all processors for the parallel build
config.vm.provision "shell" do |s|
s.path = "../scripts/bootstrap_ubuntu.sh"
s.args = ENV["UPDATE_ARGS"] || "-j `nproc`"
end
end

0 comments on commit d50fce8

Please sign in to comment.