Browse Source

Merge pull request #3 from alan-turing-institute/build

Improve build process
Jim Madge 3 years ago
parent
commit
b2cffc6fba
4 changed files with 38 additions and 7 deletions
  1. 26 0
      README.md
  2. 8 4
      Vagrantfile
  3. 2 1
      workflows/pytorch_GAN_zoo/README.md
  4. 2 2
      workflows/pytorch_GAN_zoo/build.sh

+ 26 - 0
README.md

@@ -1,3 +1,29 @@
 # AI-workflows
 
 A collections of portable, real-world AI workflows for testing and benchmarking
+
+## Using Vagrant
+
+The included Vagrantfile can be used to build the examples if your system does
+not support singularity or if you would prefer not to install singularity on
+your host. The Vagrantfile has support for the VirtualBox and libvirt providers.
+
+To create the virtual machine run
+
+```bash
+vagrant up --provider <provider>
+```
+
+for example
+
+```bash
+vagrant up --provider libvirt
+```
+
+When this is finished, you can connect to the virtualmachine in the normal way
+
+```bash
+vagrant ssh
+```
+
+and will find this project mounted at `/vagrant/`

+ 8 - 4
Vagrantfile

@@ -5,10 +5,14 @@ Vagrant.configure("2") do |config|
 
   config.vm.synced_folder "./", "/vagrant"
 
-   config.vm.provider "virtualbox" do |vb|
-     vb.memory = "8192"
-     vb.cpus = "4"
-   end
+  config.vm.provider "virtualbox" do |vb|
+    vb.memory = 8192
+    vb.cpus = 4
+  end
+  config.vm.provider :libvirt do |libvirt|
+    libvirt.cpus = 4
+    libvirt.memory = 8192
+  end
 
   config.vm.provision "shell", inline: <<-SHELL
     # Install singularity dependencies

+ 2 - 1
workflows/pytorch_GAN_zoo/README.md

@@ -15,7 +15,8 @@ To build the singularity container use the build script in this directory.
 ./build.sh
 ```
 
-This script will try to use singularities fakeroot support if you run as a
+This script will try to use singularities [fakeroot
+support](https://sylabs.io/guides/3.5/user-guide/fakeroot.html) if you run as a
 non-root user. If this is not supported on your system you can run the script as
 root.
 

+ 2 - 2
workflows/pytorch_GAN_zoo/build.sh

@@ -1,10 +1,10 @@
 #!/bin/sh
 
-UID=$(id -u)
+_UID=$(id -u)
 DEF_FILE="pytorch_GAN_zoo.def"
 SIF_FILE="pytorch_GAN_zoo.sif"
 
-if [ "$UID" = 0 ]; then
+if [ "$_UID" = 0 ]; then
     singularity build $SIF_FILE $DEF_FILE
 else
     singularity build --fakeroot $SIF_FILE $DEF_FILE