diff --git a/vagrant/Readme.md b/vagrant/Readme.md new file mode 100644 index 00000000..d263e390 --- /dev/null +++ b/vagrant/Readme.md @@ -0,0 +1,42 @@ +## Developing TIleDB with Vagrant + +Vagrant is a system that creates lightweight, self-contained development +environments as virtual machines. This directory contains a Vagrantfiles +that provision a headless VirtualBox instances for building TileDB. + +### Requirements + +To develop under Vagrant, you will first need to install [Oracle +VirtualBox](https://www.virtualbox.org/wiki/Downloads) and +[Vagrant](http://downloads.vagrantup.com/). Then, from a command line, enter +the `TileDB/vagrant/*` directory, and enter: + +``` +$ vagrant up +``` + +A virtual machine will be downloaded if needed, created, and provisioned with +the dependencies to build TileDB. + +To re-provision the virtual machine (re-run bootstrap.sh): + +``` +$ vagrant up --provision +``` + +By default, it exposes an SSH server to your +local machine on port 2222. + +``` +$ vagrant ssh +``` + +To bring down the virtual machine, use `suspend` or `halt`. + +``` +$ vagrant suspend\halt +``` + +See the [Vagrant +documentation](http://docs.vagrantup.com/v2/) for complete details on using +Vagrant. diff --git a/vagrant/centos7/.gitignore b/vagrant/centos7/.gitignore new file mode 100644 index 00000000..dace7081 --- /dev/null +++ b/vagrant/centos7/.gitignore @@ -0,0 +1 @@ +/.vagrant diff --git a/vagrant/centos7/VagrantFile b/vagrant/centos7/VagrantFile new file mode 100644 index 00000000..7f47a219 --- /dev/null +++ b/vagrant/centos7/VagrantFile @@ -0,0 +1,19 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + # Every Vagrant virtual environment requires a box to build off of. + config.vm.box = "centos/7" + + # The list of software to install + config.vm.provision :shell, :path => "bootstrap.sh" + + config.vm.provider "virtualbox" do |v| + v.memory = 3072 + end + +end diff --git a/vagrant/centos7/bootstrap.sh b/vagrant/centos7/bootstrap.sh new file mode 100644 index 00000000..97785457 --- /dev/null +++ b/vagrant/centos7/bootstrap.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +# Make sure the package information is up-to-date +sudo yum update + +# Install Cmake, Git, MPICH, zlib, OpenSSL, Gtest and LZ4 +#sudo yum install cmake git mpich libmpich2-dev zlib1g-dev libssl-dev libgtest-dev liblz4-dev +sudo yum -y install cmake git wget vim +sudo yum -y install gcc-c++ +sudo yum -y install mpich-3.2 mpich-3.2-devel +sudo yum -y install zlib zlib-devel +sudo yum -y install openssl-devel + +# The following packages are in EPEL (http://fedoraproject.org/wiki/EPEL) +sudo yum -y install epel-release +sudo yum -y install lz4 lz4-devel + +# Install Zstandard +cd /home/vagrant +wget -N https://github.com/facebook/zstd/archive/v1.0.0.tar.gz # only download if newer +tar xf v1.0.0.tar.gz +cd zstd-1.0.0 +sudo make install PREFIX='/usr' + +# Install Blosc +cd /home/vagrant +git clone https://github.com/Blosc/c-blosc +cd c-blosc +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX='/usr' .. +cmake --build . +sudo cmake --build . --target install + +# Install Google Test +cd /home/vagrant +wget -N https://github.com/google/googletest/archive/release-1.8.0.tar.gz +tar xf release-1.8.0.tar.gz +cd googletest-release-1.8.0/googletest +sudo cmake -DBUILD_SHARED_LIBS=ON . +sudo make +sudo cp -a include/gtest /usr/include +sudo cp -a libgtest_main.so libgtest.so /usr/lib/ + +# Check out TileDB +if [ ! -d /home/vagrant/TileDB ]; then + git clone https://github.com/Intel-HLS/TileDB /home/vagrant/TileDB + chown -R vagrant /home/vagrant/TileDB +fi diff --git a/vagrant/trusty64/.gitignore b/vagrant/trusty64/.gitignore new file mode 100644 index 00000000..dace7081 --- /dev/null +++ b/vagrant/trusty64/.gitignore @@ -0,0 +1 @@ +/.vagrant diff --git a/vagrant/trusty64/VagrantFile b/vagrant/trusty64/VagrantFile new file mode 100644 index 00000000..4522242d --- /dev/null +++ b/vagrant/trusty64/VagrantFile @@ -0,0 +1,19 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + # Every Vagrant virtual environment requires a box to build off of. + config.vm.box = "trusty64" + + # The list of software to install + config.vm.provision :shell, :path => "bootstrap.sh" + + config.vm.provider "virtualbox" do |v| + v.memory = 3072 + end + +end diff --git a/vagrant/trusty64/bootstrap.sh b/vagrant/trusty64/bootstrap.sh new file mode 100644 index 00000000..6d00b956 --- /dev/null +++ b/vagrant/trusty64/bootstrap.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Make sure the package information is up-to-date +apt-get update + +# Install Cmake, Git, MPICH, zlib, OpenSSL, Gtest and LZ4 +sudo apt-get -y install cmake git mpich libmpich2-dev zlib1g-dev libssl-dev libgtest-dev liblz4-dev + +# Install Zstandard +cd /home/vagrant +wget -N https://github.com/facebook/zstd/archive/v1.0.0.tar.gz # only download if newer +tar xf v1.0.0.tar.gz +cd zstd-1.0.0 +sudo make install PREFIX='/usr' + +# Install Blosc +cd /home/vagrant +git clone https://github.com/Blosc/c-blosc +cd c-blosc +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX='/usr' .. +cmake --build . +sudo cmake --build . --target install + +# Install Google Test +cd /usr/src/gtest +sudo cmake . +sudo make +sudo mv libgtest* /usr/lib/ + +# Check out TileDB +if [ ! -d /home/vagrant/TileDB ]; then + git clone https://github.com/Intel-HLS/TileDB /home/vagrant/TileDB + chown -R vagrant /home/vagrant/TileDB +fi