Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Add Vagrant file for TileDB #59

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions vagrant/Readme.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions vagrant/centos7/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vagrant
19 changes: 19 additions & 0 deletions vagrant/centos7/VagrantFile
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions vagrant/centos7/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions vagrant/trusty64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vagrant
19 changes: 19 additions & 0 deletions vagrant/trusty64/VagrantFile
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions vagrant/trusty64/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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