forked from ARM-software/lisa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
71 lines (57 loc) · 2.67 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/kinetic64"
# Allow using tools like kernelshark
config.ssh.forward_x11 = true
# Compiling pandas requires 1Gb of memory
config.vm.provider "virtualbox" do |v|
v.memory = 2048
end
# Forward ipython notebook's port to the host
config.vm.network "forwarded_port", guest: 8888, host: 8888
config.vm.provision "shell", inline: <<-SHELL
set -e
if [ ! -e /home/vagrant/lisa ]; then
ln -s /vagrant /home/vagrant/lisa
fi
cd /home/vagrant/lisa
# Install required packages
./install_base.sh --install-all
chown -R vagrant.vagrant /home/vagrant/lisa
# Let' use a venv local to vagrant so that we don't pollute the host one.
# This allows to use LISA both from the host and the VM.
export LISA_VENV_PATH=/home/vagrant/venv
# Jupyterlab config
mkdir -p /home/vagrant/.jupyter/
# Listen on all addresses so that we can connect from outside the VM
echo 'c.NotebookApp.ip = "0.0.0.0"' >> /home/vagrant/.jupyter/jupyter_notebook_config.py
# .bashrc setup
echo "cd /home/vagrant/lisa" >> /home/vagrant/.bashrc
for LC in $(locale | cut -d= -f1);
do
echo unset $LC >> /home/vagrant/.bashrc
done
echo "export LISA_VENV_PATH=$LISA_VENV_PATH" >> /home/vagrant/.bashrc
echo 'source init_env' >> /home/vagrant/.bashrc
# Trigger the creation of a venv and check that everything works well
if ! su vagrant bash -c 'tools/tests.sh'; then
echo "Self tests FAILED !"
else
echo "Virtual Machine Installation completed successfully! "
fi
echo "You can now access and use the virtual machine by running: "
echo " "
echo " $ vagrant ssh "
echo " "
echo "NOTE: if you exit, the virtual machine is still running. To shut it "
echo " down, please run: "
echo " "
echo " $ vagrant suspend "
echo " "
echo " To destroy it, use: "
echo " "
echo " $ vagrant destroy "
echo " "
SHELL
end