==== Overview ====
The oar-vagrant project aims at using Vagrant to test the different flavors of installation of OAR.
For now, you can test the installation of OAR's packages (rpm, dev) on VMs running Centos 6, Centos 7, Debian 7 (wheezy) and Debian 8 (jessie), with mysql or postgresql as the database backend.
==== Prepare ====
Vagrant is a multi-platform tool, available for Linux, MacOS X and MS Windows.
Before anything, you must install Vagrant (preferably the last version).
If the Debian package is outdated, you can look at what is provided at: http://www.vagrantup.com/downloads.html.
You also need to install [[https://www.virtualbox.org|Virtualbox]] (remember: Vagrant is just a tool which instruments VM engines, with Virtualbox being well supported).
Vagrant boxes are registered on https://app.vagrantup.com/. Search for oar-team.
== Note about Linked clone VM disks: ==
To speed-up the VM startup, and for disk space concerns, you can enable the use of VirtualBox "linked clone VMs".
If the Vagrant version you are using is 1.8 or newer, this should work out of the box.
If not, you can enable the tricks we had in place before Vagrant 1.8 went out:
* either by sourcing the ../misc/env.sh file in your current shell (this will alter your shell's PATH) (this is what I use)
* or by uncommenting the lines at the beginning of the Vagrantfiles
==== Pull and build ====
Once done, pull oar-vagrant from:
https://github.com/oar-team/oar-vagrant
Change directory to one of the subdirectory where you will find a Vagrantfile and a provisioning script. Those directories are different flavors of installation with a choice of distribution among Debian and Centos versions, and of database backend (Mysql or PostgreSQL). E.g.:
* rpm_centos6_pgsql (broken)
* rpm_centos6_mysql (broken)
* rpm_centos7_pgsql
* deb_debian7_pgsql
* deb_debian8_pgsql
* deb_debian8_mysql
* deb_debian9_pgsql
* deb_debian10_pgsql
* deb_debian11_pgsql
* deb_debian12_pgsql
* deb_debian13_pgsql
* //other might appear someday//
Vagrant is quite greedy on disk space, so by default you will only get one node. You might change that by exporting the OARVAGRANT_NODES_COUNT shell environment variable (warning: changing the node count requires to destroy and up again everything).
By default, OAR packages that will be used are the stable (or backports, for Debian) package for the distribution. If you want to use testing package, you can use the OAR_FTP_DISTRIB environment variable. For Debian, you can also use the DEBIAN_EXTRA_DISTRIB environment variables to use packages from Debian unstable or testing distribution.
== Examples for Debian ==
* '''export OAR_FTP_DISTRIB=sid_beta''' allows one to use the beta version of the packages for Debian sid/unstable (typically before the are uploaded to Debian sid/unstable and then moved to Debian testing a few days afterward).
* '''export OAR_FTP_DISTRIB=jessie-backports_beta''' allows on to use the beta version of the packages for jessie-backports (typically before the are uploaded to Debian jessie-backports distribution).
* '''export DEBIAN_EXTRA_DISTRIB=unstable''' or '''export DEBIAN_EXTRA_DISTRIB=testing''' allows one to get the packages from Debian unstable or testing.
See http://oar-ftp.imag.fr/oar/2.5/debian/dists/ to list oar-ftp distributions.
== Examples for Centos 6 or 7 ==
* '''export OAR_FTP_DISTRIB=testing''' allows one to use the testing packages for the distribution.
Once ready, just execute:
$ vagrant up
And your virtual cluster should be up and runnng.
==== Play ====
You can then play with you virtual cluster:
* Connect to the frontend as user1, user2 or user3 (all passwords are //vagrant//)
$ vagrant ssh frontend -- -l user1
* Launch a job
frontend $ oarsub -I
You should have your job id #1 ! :-)
Monika, drawgantt-svg as welle as OAR API should be available:
* Monika and drawgantt-svg are installed on the server (IP ending by .10).
* OAR API is installed on the frontend (IP ending by .11).
Each flavor of installation use a different network prefix. Look at the system to find out the network.
For example, centos7 use 192.168.31.
URLs are (OAR 2.5.6 rc3):
* http://NETWORK_PREFIX.11/monika
* http://NETWORK_PREFIX.11/drawgantt-svg
* http://NETWORK_PREFIX.11:6668/oarapi/index.html
=== Other tweaks ===
You can also:
* get more memory in VMs by exporting the OARVAGRANT_VM_MEMORY shell variable
* get more CPUs in VMs by exporting the OARVAGRANT_VM_CPU shell variable
* use a different oar-ftp host by exporting the OAR_FTP_HOST shell variable
==== Supported OAR versions ====
OAR-vagrant main branch (master) will be maintained to support OAR's last version.
Older versions might not work out of the box by just changing OAR repository setting (e.g. OAR ≤ 2.5.2 lacks drawgantt-svg and OAR ≤ 2.5.3 lacks oar_resources_add).
Provision scripts for older versions of OAR might however be provided in other branches (e.g. see branch "oar-2.5.2").
==== Post Scriptum: provision scripts ====
If you are new to OAR, mind looking at the provision.sh script, as an example of how to install a OAR cluster !
Please note that since this script uses some bash machinery lines to fit well in vagrant mechanism, a pretty printer can be caller to display a pruned version of the script, e.g.:
oar-vagrant/deb_debian8_pgsql$ ../misc/bin/provision-prettyprinter
or to open the output in vim to get syntax coloring:
oar-vagrant/deb_debian8_pgsql$ ../misc/bin/provision-prettyprinter | vim -R -
NB: if you sourced ../misc/env.sh, provision-prettyprinter should be in your PATH