From 1a573827cc491b8858039594d849c8c485cd80de Mon Sep 17 00:00:00 2001 From: githubfoam Date: Mon, 9 Apr 2018 12:25:57 +0300 Subject: [PATCH 1/2] Cross-platform Singularity via Vagrant --- pages/docs/install/install-crossplatform.md | 73 +++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pages/docs/install/install-crossplatform.md diff --git a/pages/docs/install/install-crossplatform.md b/pages/docs/install/install-crossplatform.md new file mode 100644 index 0000000..037cd92 --- /dev/null +++ b/pages/docs/install/install-crossplatform.md @@ -0,0 +1,73 @@ +--- +title: Running Singularity with Vagrant (Windows) +sidebar: main_sidebar +permalink: install-windows +folder: docs +--- + + +This recipe demonstrates how to run Singularity on your Windows/Linux/Mac computer via Vagrant. Mac is not tried due to lack of Mac computer.However Vagrant and Virtualbox supports Microsoft Linux and Mac platforms. + +## Setup + +First, install the following software: +- install [Git for Windows](https://git-for-windows.github.io/) +- install [VirtualBox for Windows](https://www.virtualbox.org/wiki/Downloads) +- install [Vagrant for Windows](https://www.vagrantup.com/downloads.html) +- install [Vagrant Manager for Windows](http://vagrantmanager.com/downloads/) + +## Singularityware Vagrant Box + +We are maintaining a set of Vagrant Boxes via Vagrant Cloud, one of Hashicorp many tools that likely you've used and haven't known it. The current stable version of Singularity is available here: + - [singularityware/singularity-2.4](https://app.vagrantup.com/singularityware/boxes/singularity-2.4/versions/2.4) + +For other versions of Singularity see [our Vagrant Cloud repository](https://app.vagrantup.com/singularityware) + +Run GitBash. The default home directory will be C:\Users\your_username + +```bash +mkdir singularity-2.4 +cd singularity-2.4 +``` + +Note that if you had installed a previous version of the vm (and are using the same folder), you must destroy it first. In our example we create a new folder. To destroy a previous vm: + +``` +vagrant destroy +``` + +Then issue the following commands to bring up the Virtual Machine: + + +``` +vagrant init singularityware/singularity-2.4 +vagrant up +vagrant ssh +``` + +You are then ready to go with Singularity 2.4! + +``` +vagrant@vagrant:~$ which singularity +/usr/local/bin/singularity +vagrant@vagrant:~$ singularity --version +2.4-dist + +vagrant@vagrant:~$ sudo singularity build growl-llo-world.simg shub://vsoch/hello-world +Cache folder set to /root/.singularity/shub +Progress |===================================| 100.0% +Building from local image: /root/.singularity/shub/vsoch-hello-world-master.simg +Building Singularity image... +Singularity container built: growl-llo-world.simg +Cleaning up... +vagrant@vagrant:~$ ./growl-llo-world.simg +RaawwWWWWWRRRR!! +``` + +Note that when you do `vagrant up` you can also select the provider, if you use vagrant for multiple providers. For example: + +``` +vagrant up --provider virtualbox +``` + +although this isn't entirely necessary if you only have it configured for virtualbox. From 8383980c4681021e01f04bdb32ccfe9149dd1c9c Mon Sep 17 00:00:00 2001 From: githubfoam <33146150+githubfoam@users.noreply.github.com> Date: Mon, 9 Apr 2018 13:05:34 +0300 Subject: [PATCH 2/2] Update install-crossplatform.md --- pages/docs/install/install-crossplatform.md | 64 ++++++--------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/pages/docs/install/install-crossplatform.md b/pages/docs/install/install-crossplatform.md index 037cd92..3e4490f 100644 --- a/pages/docs/install/install-crossplatform.md +++ b/pages/docs/install/install-crossplatform.md @@ -1,73 +1,45 @@ --- -title: Running Singularity with Vagrant (Windows) +title: Running Singularity with Vagrant (Windows/Linux/Mac etc) sidebar: main_sidebar -permalink: install-windows +permalink: install-crossplatform folder: docs --- -This recipe demonstrates how to run Singularity on your Windows/Linux/Mac computer via Vagrant. Mac is not tried due to lack of Mac computer.However Vagrant and Virtualbox supports Microsoft Linux and Mac platforms. +This recipe demonstrates how to run Singularity on your Windows/Linux/Mac etc environment via Vagrant. Mac is not tried due to lack of Mac computer.The idea is to run Singularity on all platforms which Vagrant supports.Provisioning is chosen "ansible_local".Cross-platform method is applicable to Docker container as well. -## Setup +## Environment First, install the following software: -- install [Git for Windows](https://git-for-windows.github.io/) -- install [VirtualBox for Windows](https://www.virtualbox.org/wiki/Downloads) -- install [Vagrant for Windows](https://www.vagrantup.com/downloads.html) -- install [Vagrant Manager for Windows](http://vagrantmanager.com/downloads/) +- install [VirtualBox](https://www.virtualbox.org) +- install [Vagrant for Windows](https://www.vagrantup.com/downloads.html) or Vagrant for Linux,Mac etc. +- choose any linux flavor on vagrant cloud or custom vagrant box as base. +- Vagrantfile configuration -## Singularityware Vagrant Box +"config.vm.provision "ansible_local" do |ansible|" -We are maintaining a set of Vagrant Boxes via Vagrant Cloud, one of Hashicorp many tools that likely you've used and haven't known it. The current stable version of Singularity is available here: - - [singularityware/singularity-2.4](https://app.vagrantup.com/singularityware/boxes/singularity-2.4/versions/2.4) - -For other versions of Singularity see [our Vagrant Cloud repository](https://app.vagrantup.com/singularityware) -Run GitBash. The default home directory will be C:\Users\your_username -```bash -mkdir singularity-2.4 -cd singularity-2.4 -``` -Note that if you had installed a previous version of the vm (and are using the same folder), you must destroy it first. In our example we create a new folder. To destroy a previous vm: - -``` -vagrant destroy -``` - -Then issue the following commands to bring up the Virtual Machine: +Bring up vagrant vmguest ``` -vagrant init singularityware/singularity-2.4 vagrant up vagrant ssh ``` +On Vagrant vmguest install ubuntu singularity package. -You are then ready to go with Singularity 2.4! - -``` -vagrant@vagrant:~$ which singularity -/usr/local/bin/singularity -vagrant@vagrant:~$ singularity --version -2.4-dist - -vagrant@vagrant:~$ sudo singularity build growl-llo-world.simg shub://vsoch/hello-world -Cache folder set to /root/.singularity/shub -Progress |===================================| 100.0% -Building from local image: /root/.singularity/shub/vsoch-hello-world-master.simg -Building Singularity image... -Singularity container built: growl-llo-world.simg -Cleaning up... -vagrant@vagrant:~$ ./growl-llo-world.simg -RaawwWWWWWRRRR!! +```bash +$ sudo apt-get singularity-container ``` -Note that when you do `vagrant up` you can also select the provider, if you use vagrant for multiple providers. For example: +Verify singularity installation ``` -vagrant up --provider virtualbox +vagrant@vagrant:~$ which singularity +/usr/bin/singularity +vagrant@vagrant:~$ singularity --version +2.4.5-dist ``` -although this isn't entirely necessary if you only have it configured for virtualbox.