Merge remote-tracking branch 'remotes/origin/feature/newVagrantBoxes' into nextRelease

This commit is contained in:
Hrvoje Jasak 2014-04-30 10:35:28 +01:00
commit 662e58aa06
11 changed files with 264 additions and 35 deletions

3
.gitignore vendored
View file

@ -119,4 +119,7 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
# vagrant stuff
vagrantSandbox/.vagrant/
# end-of-file

View file

@ -108,4 +108,7 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
# vagrant stuff
vagrantSandbox/.vagrant/
# end-of-file

View file

@ -3,7 +3,15 @@
* Prerequisites
These virtual machines require
- VirtualBox :: for running from [[https://www.virtualbox.org]]
- Vagrant :: to automatically set them up from [[http://www.vagrantup.com]]
- Vagrant :: to automatically set them up from
[[http://www.vagrantup.com]] Make sure that you have at
least version 1.5 to be able to use the base boxes from
https://vagrantcloud.com/
To make sure that for the boxes the have the newest
VirtualBox-additions do
: vagrant plugin install vagrant-vbguest
This installs a plugin that tries to update the guest addition if
they are for an older version of VirtualBox
* Starting
A virtual machine is set up with
: vagrant up <machineName>
@ -16,19 +24,45 @@
One can then connect to the virtual machine with
: vagrant ssh <machinName>
and will be in the =$HOME= directory of the user =vagrant= where in
the directory =~/OpenFOAM/OpenFOAM-1.6-ext= the sources are
the directory =~/foam/foam-extend-3.0= the sources are
available. Modifications can be pushed "outside" the virtual machine
with
: hg push
There is also a symbolic link =~/OpenFOAM/OpenFOAM-1.6-ext-parent=
There is also a symbolic link =~/foam/foam-extend-3.0-parent=
to the sources if you want to edit there directly. Use with care
and don't compile in that directory unless you know what you're
doing
* Virtual machines
Currently existing virtual machines are
- precise :: Latest LTS Ubuntu.
- precise :: Latest LTS Ubuntu. Currently the default machine to use
- lucid :: Previous LTS Ubuntu. Currently problems
with automatic setting up (something with the
=postfix=-package)
- maverick :: Tries to fix the problems with the
=lucid=-machine. Not yet working
- centos65 :: A CentOS 6.5 machine with preinstalled development
tools
- freebsd92 :: FreeBSD 9.2 64-bit machine. Currently this machine
does not provision automatically. After the first
failure log in and do
: sudo pkg_add -r rsync
: sudo pkg_add -r bash
then halt the machine and bring it up again (with the
=--provision=-option)
- freebsd10 :: FreeBSD 10.0 32-big machine. Tries to set up shared
folders via NFS. Currently not working
- opensuse12 :: OpenSUSE 12.3 machine. Currently not completely
compiling Foam
Some machines (read: the BSD-boxes) need the =VirtualBox Extension
Pack= installed (because they have USB 2.0)
* Scripts in the machine
In the home directory these scripts are found
- bootstrapFoam.sh :: A script whose aim it is to compile Foam and
the ThirdParty-packages in one go (no paraview and QT). If this
works the box is considered operational
* Provisioning scripts
Every "family" of machines has a specific script that makes sure
that the software packages necessary to compile =Foam= are installed
into the machine. In the end these scripts should call
=initGeneralScript.sh= which gets the sources into the machine. It
needs =git=, =mercurial= and =ccache= for that.

View file

@ -12,6 +12,28 @@ Vagrant.configure("2") do |config|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
# default
config.vm.define :precise do |precise|
precise.vm.box = "hashicorp/precise64"
precise.vm.box_check_update = true
# precise.vm.box_url = "http://files.vagrantup.com/precise64.box"
precise.vm.provision :shell do |s|
s.args = "precise"
s.path = "initUbunutuScript.sh"
end
end
config.vm.define :centos65 do |centos65|
centos65.vm.box = "chef/centos-6.5"
centos65.vm.box_check_update = true
# centos65.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box"
centos65.vm.provision :shell do |s|
s.args = "centos65"
s.path = "initCentOSRHELScript.sh"
end
end
# legacy
config.vm.define :lucid do |lucid|
lucid.vm.box = "lucid64"
lucid.vm.box_url = "http://files.vagrantup.com/lucid64.box"
@ -21,6 +43,7 @@ Vagrant.configure("2") do |config|
end
end
#legacy
config.vm.define :maverick do |maverick|
maverick.vm.box = "maverick64"
maverick.vm.box_url = "http://mathie-vagrant-boxes.s3.amazonaws.com/maverick64.box"
@ -30,12 +53,48 @@ Vagrant.configure("2") do |config|
end
end
config.vm.define :precise do |precise|
precise.vm.box = "precise64"
precise.vm.box_url = "http://files.vagrantup.com/precise64.box"
precise.vm.provision :shell do |s|
s.args = "precise"
s.path = "initUbunutuScript.sh"
# experimental
config.vm.define :freebsd92 do |freebsd92|
freebsd92.vm.box = "chef/freebsd-9.2"
freebsd92.vm.box_check_update = true
# freebsd92.vm.box_url = "https://wunki.org/files/freebsd-9.2-amd64-wunki.box"
# freebsd92.vm.box_url = "http://iris.hosting.lv/freebsd-9.2-i386.box"
freebsd92.vm.provision :shell do |s|
s.args = "freebsd92"
s.path = "initFreeBSDScript.sh"
end
freebsd92.vm.synced_folder "..", "/FOAM-sources", type: "rsync", rsync__exclude: "vagrantSandbox/"
freebsd92.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: "ccache4vm/"
end
# legacy/experimental
config.vm.define :freebsd10 do |freebsd10|
freebsd10.vm.box = "freebsd10"
# freebsd10.vm.box_url = "https://wunki.org/files/freebsd-10.0-amd64-wunki.box"
freebsd10.vm.box_url = "http://iris.hosting.lv/freebsd-10.0-i386.box"
freebsd10.vm.provision :shell do |s|
s.args = "freebsd10"
s.path = "initFreeBSDScript.sh"
end
freebsd10.vm.network :private_network, ip: "10.0.0.2"
# configure the NICs
freebsd10.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
end
# use NFS for the synced folder
freebsd10.vm.synced_folder "..", "/FOAM-sources", :nfs => true
end
# legacy
config.vm.define :opensuse12 do |opensuse12|
opensuse12.vm.box = "opensuse12"
opensuse12.vm.box_url = "http://sourceforge.net/projects/opensusevagrant/files/12.3/opensuse-12.3-64.box/download"
opensuse12.vm.provision :shell do |s|
s.args = "opensuse12"
s.path = "initOpenSUSEScript.sh"
end
end

View file

@ -0,0 +1,35 @@
#! /bin/bash
boxName=$1
echo
echo "Init script for $boxName"
echo
echo "Install the EPEL-repository for additional software"
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# some of these packages are already installed. But lets be sure
neededPackages=(gcc-c++ gcc-gfortran mercurial git flex bison make ccache rpm-build wget zlib-devel binutils-devel)
bonusPackages=(emacs csh tcsh zsh)
for p in ${neededPackages[@]}; do
yum install -y $p
done
for p in ${bonusPackages[@]}; do
yum install -y $p
done
echo "Update mercurial to a more recent version"
rpm -Uhv http://pkgs.repoforge.org/mercurial/mercurial-2.2.2-1.el6.rfx.x86_64.rpm
echo
echo "RHEL/CentOS-specific ended. Now doing general stuff"
echo
/vagrant/initGeneralScript.sh
echo
echo "Ended"

View file

@ -0,0 +1,29 @@
#! /usr/bin/env bash
boxName=$1
echo
echo "Init script for $boxName"
echo
pkg install -fy virtualbox-ose-additions
neededPackages=(mercurial git flex bison ccache rpm4 wget)
bonusPackages=(emacs24 zsh)
for p in ${neededPackages[@]}; do
pkg install -y $p
done
for p in ${bonusPackages[@]}; do
pkg install -y $p
done
echo
echo "FreeBSD-specific ended. Now doing general stuff"
echo
/vagrant/initGeneralScript.sh
echo
echo "Ended"

View file

@ -1,4 +1,4 @@
#! /bin/bash
#! /usr/bin/env bash
echo
echo "Copying stuff from skeleton"
@ -20,6 +20,9 @@ OFDIR=/home/vagrant/foam/
mkdir -vp $OFDIR
chown -R vagrant:vagrant $OFDIR
# for distros that don't have group vagrant
chown -R vagrant $OFDIR
OFClone=$OFDIR/foam-extend-3.0
OFReference=$OFClone-parent
@ -34,8 +37,12 @@ then
then
echo
echo "Parent is git"
echo "Cloning. This may take some time"
echo
# su -c not correctly working on FreeBSD
su vagrant - -c "git clone $OFParent $OFClone"
echo
echo "Git cloned: TODO: set same branch as parent"
echo
@ -44,10 +51,13 @@ then
echo
echo "Parent is mercurial. Hello Bernhard"
echo
branchName=`hg branch -R $OFParent`
# branchName=`hg branch -R $OFParent`
idName=`hg id -i -R $OFParent | sed -e "s/\+//"`
# sed removes + in case of a 'tainted' parent
echo "Parent is on branch $branchName"
su vagrant - -c "hg clone -u $branchName $OFParent $OFClone"
echo "Parent is on id $idName"
echo "Cloning. This may take some time"
su vagrant - -c "hg clone -u $idName $OFParent $OFClone"
echo
else
echo

View file

@ -0,0 +1,32 @@
#! /bin/bash
boxName=$1
echo
echo "Init script for $boxName"
echo
# Otherwise python/mercurial won't install
zypper -n remove patterns-openSUSE-minimal_base-conflicts
# patterns-openSUSE-devel_python
neededPackages=(gcc-c++ mercurial git flex bison make ccache zlib-devel rpm-build binutils-devel)
bonusPackages=(emacs csh tcsh zsh)
for p in ${neededPackages[@]}; do
zypper -n install $p
done
for p in ${bonusPackages[@]}; do
zypper -n install $p
done
echo
echo "OpenSUSE-specific ended. Now doing general stuff"
echo
/vagrant/initGeneralScript.sh
echo
echo "Ended"

View file

@ -24,22 +24,16 @@ echo
echo "Installing additional packages"
echo
apt-get -y install mercurial
apt-get -y install bison
apt-get -y install flex
apt-get -y install g++
apt-get -y install make
#apt-get -y install python-dev
apt-get -y install ccache
apt-get -y install cmake
neededPackages=(g++ bison flex mercurial git make ccache cmake rpm)
bonusPackages=(emacs csh tcsh zsh)
# test scripts with different shells
apt-get -y install csh
apt-get -y install tcsh
apt-get -y install zsh
for p in ${neededPackages[@]}; do
apt-get -y install $p
done
# to make the ThirdParty-Stuff work
apt-get -y install rpm
for p in ${bonusPackages[@]}; do
apt-get -y install $p
done
# this is needed for the packaging stuff
echo
@ -59,13 +53,10 @@ echo
echo "Tools for packaging"
echo
# Needed for packaging
apt-get -y install default-mta
apt-get -y install dpkg-dev
apt-get -y install debhelper devscripts cdbs
# Not needed. Just to keep Bernhard happy
apt-get -y install emacs
packagingPackages=(default-mta dpkg-dev debhelper devscripts cdbs binutils-dev)
for p in ${packagingPackages[@]}; do
apt-get -y install $p
done
echo
echo "Ubuntu-specific ended. Now doing general stuff"

View file

@ -0,0 +1,11 @@
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export WM_SCHEDULER=ccache
export CCACHE_DIR=/vagrant/ccache4vm

View file

@ -0,0 +1,22 @@
#! /usr/bin/env bash
# Just to be sure
export WM_SCHEDULER=ccache
export CCACHE_DIR=/vagrant/ccache4vm
cd foam/foam-extend-3.0
source etc/bashrc
( cd wmake/src && make )
cd $WM_THIRD_PARTY_DIR
./AllMake.stage0
./AllMake.stage1
./AllMake.stage2
./AllMake.stage3
cd $WM_PROJECT_DIR
# pick up installed packages
source etc/bashrc
./Allwmake