FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bring the Vagrant configuration up to date. · devhttps/frontend@a8c84cd · GitHub

Commit a8c84cd

Browse files
Bring the Vagrant configuration up to date.
1 parent 68907fa commit a8c84cd

21 files changed

Lines changed: 321 additions & 139 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ frontend.sublime-workspace
3030
frontend.sublime-project
3131
common/app/assets/stylesheets/theme/fonts.less
3232
tags
33+
*.box

‎README.md‎

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ a project in IntelliJ.
3030
Further information on using the Play console is available [here][play2-console].
3131

3232

33+
Virtualisation
34+
--------------
35+
Virtualisation provides for robust development environments and a controlled
36+
system dependency solution. See the instructions in `README.vagrant.md` for
37+
using [Vagrant][vagrant] virtualisation with this project.
38+
39+
3340
Endpoints
3441
---------
3542
The available endpoints are listed in `conf/routes` of each application and
@@ -54,61 +61,6 @@ No Proxy Build
5461
Invoke `sbt011` with a `--no-proxy` parameter to directly download artifacts.
5562

5663

57-
Vagrant virtualisation (optional)
58-
---------------------------------
59-
[Vagrant][vagrant] is a tool to "create and configure lightweight, reproducible,
60-
and portable development environments." Vagrant itself is a virtual instance
61-
creation and startup tool on top of Oracle VirtualBox which takes care of the
62-
virtualisation.
63-
64-
Install the Open Source Edition of VirtualBox and Vagrant itself:
65-
66-
sudo apt-get install virtualbox-ose
67-
wget http://files.vagrantup.com/packages/aafa79fe66db687da265d790d5e67a2a7ec30d92/vagrant_1.0.0_x86_64.deb
68-
sudo dpkg -i vagrant_1.0.0_x86_64.deb
69-
70-
The vagrant instance to use is the one defined in `dev/vagrant/frontend_lucid64`.
71-
There should be a prebuilt version at the following location:
72-
73-
http://devscreen.gudev.gnl/vagrant/frontend_lucid64.box
74-
75-
If this is unreachable, build the package from scratch:
76-
77-
cd dev/vagrant/frontend_lucid64.box
78-
/opt/vagrant/bin/vagrant up
79-
/opt/vagrant/bin/vagrant package --vagrantfile Vagrantfile --include ../manifests
80-
mv package.box frontend_lucid64.box
81-
82-
It is convenient to start the instance in the root of the source tree:
83-
84-
/opt/vagrant/bin/vagrant init frontend http://devscreen.gudev.gnl/vagrants/frontend_article_lucid64.box
85-
/opt/vagrant/bin/vagrant up
86-
87-
As a temporary measure until API key distribution is organised, you will
88-
need to copy a useful e.g. `/etc/gu/frontend-article.properties`. Developers
89-
should be able to copy the necessary `frontend-article.properties` from
90-
their dev box proper to the source root and then onto `/etc/gu` in the
91-
virtual instance.
92-
93-
Do not check in `frontend-article.properties`.
94-
95-
SSH onto the virtual instance, copy `frontend-article.properties` and start
96-
the app:
97-
98-
/opt/vagrant/bin/vagrant ssh
99-
$ cd /vagrant
100-
$ sudo cp frontend-article.properties /etc/gu
101-
$ ./sbt011 run
102-
103-
The instance forwards port 80 on the virtual box to port 8000 on the developer
104-
box proper so the application should be available at:
105-
106-
http://localhost:8000
107-
108-
Since Play recompiles on refresh, you should be able to pretty much ignore the
109-
instance from this point.
110-
111-
11264
Additional Documentation
11365
------------------------
11466
Further documentation notes and useful items can be found in `dev`.

‎README.vagrant.md‎

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
Vagrant
2+
=======
3+
4+
[Vagrant][vagrant] is a tool to "create and configure lightweight, reproducible,
5+
and portable development environments." Vagrant itself is a virtual instance
6+
creation and startup tool on top of Oracle VirtualBox which takes care of the
7+
virtualisation.
8+
9+
10+
Install Vagrant (Ubuntu)
11+
------------------------
12+
Install the Open Source Edition of VirtualBox:
13+
14+
wget http://download.virtualbox.org/virtualbox/4.1.18/virtualbox-4.1_4.1.18-78361~Ubuntu~natty_amd64.deb
15+
sudo dpkg -i virtualbox-4.1_4.1.18-78361~Ubuntu~natty_amd64.deb
16+
17+
If you are using a different version of Ubuntu, substitute the appropriate
18+
deb from the [VirtualBox download page][virtualbox-download].
19+
20+
Then install Vagrant itself:
21+
22+
wget http://files.vagrantup.com/packages/eb590aa3d936ac71cbf9c64cf207f148ddfc000a/vagrant_1.0.3_x86_64.deb
23+
sudo dpkg -i vagrant_1.0.3_x86_64.deb
24+
25+
26+
Creating the VM
27+
---------------
28+
The vagrant instance to use is the one defined in
29+
`dev/vagrant/frontend_precise64`. There should be a prebuilt version at the
30+
following location:
31+
32+
http://devscreen.gudev.gnl/vagrant/frontend_precise64.box
33+
34+
If this is unreachable, you will need to build the package from scratch and
35+
update the `config.vm.box_url` property of the `Vagrantfile` at the top level.
36+
37+
cd dev/vagrant
38+
vagrant up
39+
vagrant package --output frontend_precise64.box
40+
41+
Start the VM defined in `Vagrantfile` at the top of the source tree:
42+
43+
vagrant up
44+
45+
And ssh onto it:
46+
47+
vagrant ssh
48+
49+
As a temporary measure until API key distribution is organised, you will need to
50+
copy the necessary properties file to `/etc/gu/` on the VM. Developers should
51+
be able to copy the necessary `frontend-*.properties` from their dev box
52+
proper to the source root and then onto `/etc/gu` in the virtual instance.
53+
54+
Do not check in `frontend-*.properties`.
55+
56+
SSH onto the virtual instance, copy `frontend-*.properties` and start
57+
the app:
58+
59+
> cp /etc/gu/frontend-*.properties .
60+
> vagrant ssh
61+
...
62+
63+
$ cd /vagrant
64+
$ sudo cp frontend-*.properties /etc/gu
65+
$ ./sbt011 run
66+
67+
The instance forwards port 80 on the virtual box to port 8000 on the developer
68+
box proper so the application should be available at:
69+
70+
http://localhost:8000
71+
72+
Since Play recompiles on refresh, you should be able to pretty much ignore the
73+
instance from this point.
74+
75+
76+
Vagrant Commmands
77+
-----------------
78+
79+
* `vagrant suspend`: Disable the virtual instance. The
80+
allocated disc space for the instance is retained but the instance will not be
81+
available. The running state at suspend time is saved for resumption.
82+
* `vagrant resume`: Wake up a previously suspended virtual
83+
instance.
84+
* `vagrant halt`: Turn off the virtual instance. Calling
85+
`vagrant up` after this is the equivalent of a reboot.
86+
* `vagrant up --no-provision`: Bring up the virtual instance
87+
without doing the provisioning step. Useful if the provisioning step is
88+
destructive.
89+
* `vagrant destroy`: Hose your virtual instance, reclaiming the
90+
allocated disc space.
91+
* `vagrant provision`: Rerun puppet or chef provisioning on the
92+
virtual instance.
93+
94+
95+
Vagrant SSH X Forwarding
96+
------------------------
97+
X applications on VMs can be displayed on the host machine by specifying a
98+
Vagrant SSH connection with X11 forwarding in the `Vagrantfile`:
99+
100+
config.ssh.forward_x11 = true
101+
102+
On the host machine, add an `xhost` for the Vagrant VM:
103+
104+
xhost +10.0.0.2
105+
106+
Then X applications started from the VM should display on the host machine.
107+
108+
109+
Vagrant Troubleshooting
110+
-----------------------
111+
To see more verbose output on any vagrant command, add a VAGRANT_LOG environment
112+
variable setting, e.g.:
113+
114+
VAGRANT_LOG=INFO vagrant up
115+
116+
Further help troubleshooting can be obtained by editing your `Vagrantfile` and
117+
enabling the `config.vm.boot_mode = :gui` setting. This will pop up a VirtualBox
118+
GUI window on boot.
119+
120+
There have been some issues getting 64bit instances to start. The error is
121+
apparent in GUI boot:
122+
123+
VT-x/AMD-V hardware acceleration has been enabled, but is not
124+
operational. Your 64-bit guest will fail to detect a 64-bit CPU and
125+
will not be able to boot.
126+
127+
Some BIOS setting changes can help. The changes are described at
128+
`http://dba-star.blogspot.com/2011/11/how-to-enable-vtx-and-vtd-on-hp-compaq.html`
129+
but briefly:
130+
131+
1. Restart your developer box.
132+
2. Press F10 for BIOS settings at the boot splash.
133+
3. Edit Security -> System Security (I wasn't expecting it here either!)
134+
4. Enable VT-x and VT-d settings.
135+
5. Save and exit.
136+
137+
138+
[vagrant]: http://vagrantup.com
139+
[virtualbox-download]: https://www.virtualbox.org/wiki/Linux_Downloads

‎dev/vagrant/manifests/classes/basic.pp‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎dev/vagrant/manifests/classes/guardian_config.pp‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎dev/vagrant/manifests/classes/java.pp‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎dev/vagrant/manifests/classes/nginx.pp‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎dev/vagrant/manifests/frontend_article.pp‎

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Acquire::http::Timeout "300";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Acquire::http::Retries "3";

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL