Merge lp:~canonical-platform-qa/qa-dashboard/vagrant-fixes into lp:qa-dashboard

Proposed by Federico Gimenez
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/qa-dashboard/vagrant-fixes
Merge into: lp:qa-dashboard
Diff against target: 139 lines (+61/-22)
4 files modified
.bzrignore (+4/-0)
Vagrantfile (+15/-14)
docs/installing.rst (+32/-6)
setup.sh (+10/-2)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-dashboard/vagrant-fixes
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Pending
Canonical CI Engineering Pending
Review via email: mp+256801@code.launchpad.net

Commit message

Vagrant configuration updated

Description of the change

Includes this changes:

* Updated Vagrantfile to the latest version format (customizations for virtualbox inside a provider block) to get rid of a deprecation warning
* Added python-tastypie to the dependencies and updated URL of the database dump in the setup.sh provision script. Also added db related commands and server startup to the provision process.
* The dash directory is shared with rsync between host and guest to prevent file sync problems in the bzr commands

Thanks,

To post a comment you must log in.
768. By Federico Gimenez

rsync for shared folder

769. By Federico Gimenez

nfs, valid for both virtualbox and libvirt providers

770. By Vincent Ladeuil

Update instructions for using libvirt with vagrant (for sites where virtualbox can't be used).

771. By Vincent Ladeuil

Override default rsync default values to remove --copy-links since the code tree is broken in that respect (juju_settings.py ?!?!).

772. By Vincent Ladeuil

Switch to nfs for both folders to simplify.

Unmerged revisions

772. By Vincent Ladeuil

Switch to nfs for both folders to simplify.

771. By Vincent Ladeuil

Override default rsync default values to remove --copy-links since the code tree is broken in that respect (juju_settings.py ?!?!).

770. By Vincent Ladeuil

Update instructions for using libvirt with vagrant (for sites where virtualbox can't be used).

769. By Federico Gimenez

nfs, valid for both virtualbox and libvirt providers

768. By Federico Gimenez

rsync for shared folder

767. By Federico Gimenez

Changes for a working vagrant up

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-05-24 20:25:28 +0000
3+++ .bzrignore 2015-04-22 07:43:35 +0000
4@@ -1,3 +1,7 @@
5 plugins.py
6 local_settings.py
7 *.pyc
8+.vagrant/
9+branches/*
10+build/*
11+.sourcecode/
12
13=== modified file 'Vagrantfile'
14--- Vagrantfile 2013-02-12 20:44:28 +0000
15+++ Vagrantfile 2015-04-22 07:43:35 +0000
16@@ -1,18 +1,19 @@
17 # -*- mode: ruby -*-
18 # vi: set ft=ruby :
19
20-Vagrant::Config.run do |dash|
21- dash.vm.box = "qa-dash-devserver"
22- dash.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box"
23- dash.vm.forward_port 8000, 8000
24- dash.vm.network :hostonly, "33.33.33.10"
25- dash.vm.customize ["modifyvm", :id, "--memory", 512]
26-
27- dash.ssh.max_tries = 50
28- dash.ssh.timeout = 300
29-
30- dash.vm.share_folder("v-root", "/home/vagrant/dash", ".")
31-
32- dash.vm.provision :shell, :path => "setup.sh"
33-
34+VAGRANTFILE_API_VERSION = '2'
35+
36+Vagrant.configure(VAGRANTFILE_API_VERSION) do |dash|
37+ dash.vm.box = 'qa-dash-devserver'
38+ dash.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box'
39+
40+ dash.vm.network 'private_network', ip: '33.33.33.10'
41+
42+ dash.vm.provider 'virtualbox' do |vb|
43+ vb.customize ['modifyvm', :id, '--memory', 512]
44+ end
45+ dash.vm.synced_folder '.', '/home/vagrant/dash', type: 'nfs'
46+ dash.vm.synced_folder '.', '/vagrant', type: 'nfs'
47+
48+ dash.vm.provision :shell, :path => 'setup.sh'
49 end
50
51=== modified file 'docs/installing.rst'
52--- docs/installing.rst 2013-03-27 15:58:26 +0000
53+++ docs/installing.rst 2015-04-22 07:43:35 +0000
54@@ -10,12 +10,38 @@
55
56 Requirements
57 ~~~~~~~~~~~~
58-To get started, you'll need:
59- * Vagrant
60-
61-sudo apt-get install vagrant
62-
63-
64+To get started, you'll need Vagrant::
65+
66+ sudo apt-get install vagrant
67+
68+This will use virtualbox as the default box/machine provider.
69+
70+Using libvirt instead of virtualbox
71+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+
73+/!\ virtualbox and qemu/kvm are mutually exclusive, if you're already using
74+qemu/kvm, you need a slightly different setup. If you're using virtualbox,
75+ignore this section.
76+
77+Install the pre-requisites::
78+
79+ sudo apt-get install libxslt-dev libxml2-dev libvirt-dev
80+ # the box provider (vagrant-libvirt) and the tool to turn the virtualbox
81+ # image provided by cloud-images.c.c into a libvirt one
82+ vagrant plugin install vagrant-libvirt vagrant-mutate
83+ vagrant box add qa-dash-devserver http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box
84+ vagrant mutate qa-dash-devserver libvirt
85+
86+From there setting up the machine is achieved with::
87+
88+ vagrant up --provider=libvirt
89+
90+
91+That should be the only difference with the virtualbox setup which is only::
92+
93+ vagrant up
94+
95+
96 Grab the source
97 ---------------
98
99
100=== modified file 'setup.sh'
101--- setup.sh 2014-04-23 21:30:58 +0000
102+++ setup.sh 2015-04-22 07:43:35 +0000
103@@ -1,4 +1,5 @@
104 VAGRANT_SETUP=/home/vagrant/vagrant-setup
105+VAGRANT_DASH=/home/vagrant/dash
106
107 echo "Does the vagrant-setup directory exist?"
108 if [ ! -f $VAGRANT_SETUP/_dir ]; then
109@@ -53,7 +54,7 @@
110 echo "Vagrant is already been setup, no need to install packages"
111 else
112 echo "Install packages"
113- sudo apt-get -y install python python-dev postgresql python-psycopg2 python-django python-django-south python-yaml django-tables python-flake8 python-django-auth-openid python-numpy python-mock
114+ sudo apt-get -y install python python-dev postgresql python-psycopg2 python-django python-django-south python-yaml django-tables python-flake8 python-django-auth-openid python-numpy python-mock python-tastypie
115 fi
116
117 echo "Does the postgres config need updating?"
118@@ -68,7 +69,7 @@
119 echo "Is there already a database dump? If not, download it"
120 if [ ! -f $VAGRANT_SETUP/dash.sql ]; then
121 echo "Download database"
122- wget -q http://people.ubuntu.com/~chrisjohnston/qa_dash/dash.tgz -O $VAGRANT_SETUP/dash.tgz
123+ wget -q http://people.ubuntu.com/~cjohnston/qa_dash/dash.tgz -O $VAGRANT_SETUP/dash.tgz
124 tar xzf $VAGRANT_SETUP/dash.tgz -C $VAGRANT_SETUP
125 else
126 echo "Database already exists"
127@@ -93,5 +94,12 @@
128 echo "local_settings.py already exists"
129 fi
130
131+cd $VAGRANT_DASH && make
132+rm -rf .sourcecode && make
133+echo 'ALLOWED_HOSTS = ["33.33.33.10"]' >> local_settings.py
134+python manage.py syncdb
135+python manage.py migrate
136+nohup python manage.py runserver 0.0.0.0:8000 > out.txt &
137+
138 echo "Setup complete!"
139 touch $VAGRANT_SETUP/_complete

Subscribers

People subscribed via source and target branches