Last active
October 6, 2015 11:12
-
-
Save dakl/83103471cc5a622d9dd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Define the list of machines | |
machines = { | |
:reportcreatormahcine => { | |
:hostname => "reportcreatormahcine", | |
:ipaddress => "10.10.10.99" #gretzky | |
}, | |
} | |
#-------------------------------------- | |
# General provisioning inline script | |
#-------------------------------------- | |
$script = <<SCRIPT | |
# Start by making yum faster | |
sudo yum install yum-plugin-fastestmirror | |
sudo yum upgrade | |
wget --no-clobber -P /tmp http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
cd /tmp | |
sudo rpm -ivh epel-release-6-8.noarch.rpm | |
sudo yum install -y java-1.7.0-openjdk-devel openssl-devel libxml2-devel | |
sudo yum install -y git nano | |
sudo yum -y install libcurl libcurl-devel | |
sudo yum -y groupinstall "Development tools" | |
sudo yum install -y perl-devel perl rsync dos2unix perl-CPAN gcc zlib-devel.x86_64 zlib.x86_64 expat-devel | |
curl -L http://cpanmin.us | perl - --sudo App::cpanminus | |
#Install the perl modules! | |
sudo /usr/local/bin/cpanm Archive::Zip | |
sudo /usr/local/bin/cpanm PerlIO::gzip | |
sudo /usr/local/bin/cpanm XML::Simple | |
sudo /usr/local/bin/cpanm MD5 | |
sudo /usr/local/bin/cpanm ExtUtils::MakeMaker | |
# sudo /usr/local/bin/cpanm --force Module::Compile | |
# sudo /usr/local/bin/cpanm XML::LibXSLT | |
# sudo /usr/local/bin/cpanm PDL | |
sudo yum install -y R | |
cat | Rscript /dev/stdin <<EOF | |
update.packages(repos="http://ftp.sunet.se/pub/lang/CRAN/", ask=FALSE) | |
# "httr" "RCurl" devtools "glmnet" | |
packages <- c("getopt", "plyr", "reshape", "devtools", | |
"data.table", "ggplot2", "knitr", "xtable", "uuid", "pamr" ) | |
biocpackages <- c("CNAnorm", "QDNAseq", "DESeq") | |
githubrepos <- c("dakl/clinseqr") | |
for( package in packages ){ # package <- packages[1] | |
if( !require(package = package, character.only = TRUE) ){ | |
install.packages(package, repos="http://ftp.sunet.se/pub/lang/CRAN/") | |
} | |
} | |
library(devtools) | |
for( repo in githubrepos ){ # repo <- githubrepos[1] | |
package <- unlist(strsplit(x = repo, split = "/"))[2] | |
if( !require(package = package, character.only = TRUE) ){ | |
install_github(repo) | |
} | |
} | |
source("http://bioconductor.org/biocLite.R") | |
for( package in biocpackages ){ # package <- biocpackages[1] | |
if( !require(package = package, character.only = TRUE) ){ | |
biocLite(package) | |
} | |
} | |
EOF | |
SCRIPT | |
#-------------------------------------- | |
# Fire up the machine | |
#-------------------------------------- | |
Vagrant.configure("2") do |global_config| | |
machines.each_pair do |name, options| | |
global_config.vm.define name do |config| | |
#VM configurations | |
config.vm.box = "bento/centos-6.7" | |
config.vm.hostname = "#{name}" | |
config.vm.network :private_network, ip: options[:ipaddress] | |
config.vm.synced_folder "~/projects/clinseq-reporting", "/home/vagrant/projects/clinseq-reporting" | |
config.vm.synced_folder "/proj", "/proj" | |
#VM specifications | |
config.vm.provider :virtualbox do |v| | |
v.customize ["modifyvm", :id, "--memory", "4096", "--cpus", 2] | |
end | |
#VM provisioning | |
config.vm.provision :shell, | |
:inline => $script | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment