135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
1 |
Setup LAVA Web Application Development Environment
|
2 |
==================================================
|
|
3 |
||
4 |
Setup Steps
|
|
5 |
^^^^^^^^^^^
|
|
6 |
||
145.4.1
by Fathi Boudra
Update documentation |
7 |
Prepare a requirements file that doesn't include the LAVA webapp which you want |
8 |
to develop in. e.g. if you want to develop lava-scheduler, make a |
|
9 |
requirements-dev.txt as follow: |
|
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
10 |
|
11 |
lava-server |
|
12 |
lava-dashboard |
|
13 |
||
145.4.1
by Fathi Boudra
Update documentation |
14 |
Then follow the steps: |
15 |
||
16 |
$ ./lava-deployment-tool setup |
|
17 |
$ ./lava-deployment-tool bundle requirements-dev.txt |
|
18 |
$ ./lava-development-tool install dev lava.pybundle |
|
145.4.3
by Fathi Boudra
Include documentation to create an admin user. |
19 |
$ ./lava-development-tool manage dev createsuperuser |
145.4.1
by Fathi Boudra
Update documentation |
20 |
|
21 |
Toggle developer mode during the installation. |
|
22 |
||
23 |
Checkout lava-scheduler source code in /srv/lava/instances/dev/src: |
|
24 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
25 |
$ cd /srv/lava/instances/dev/src |
26 |
$ bzr branch lp:lava-scheduler |
|
145.4.1
by Fathi Boudra
Update documentation |
27 |
|
28 |
After adding a component, run the following command to ensure the component is |
|
29 |
integrated with the rest of the application: |
|
30 |
||
31 |
$ ./lava-deployment-tool install_config_app dev |
|
32 |
||
33 |
Activate virtualenv: |
|
34 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
35 |
$ . /srv/lava/instances/dev/bin/activate |
145.4.1
by Fathi Boudra
Update documentation |
36 |
|
37 |
Setup develop environment in webapp: |
|
38 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
39 |
$ cd /srv/lava/instances/dev/src/lava-scheduler |
40 |
$ ./setup.py develop |
|
145.4.1
by Fathi Boudra
Update documentation |
41 |
|
163.1.2
by Spring Zhang
Update more instructions |
42 |
Setup and sync the database: |
43 |
$ ./lava-deployment-tool manage dev syncdb |
|
163.1.1
by Spring Zhang
Add DB setup in SETUP-WEBDEV-ENV |
44 |
$ ./lava-deployment-tool manage dev migrate |
45 |
||
145.4.1
by Fathi Boudra
Update documentation |
46 |
Touch the uwsgi.reload to restart the uwsgi, you can find the log by |
47 |
'tail -F dev/var/log/lava-uwsgi.log' in another console: |
|
48 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
49 |
$ touch etc/lava-server/uwsgi.reload |
145.4.1
by Fathi Boudra
Update documentation |
50 |
|
51 |
If uwsgi fails to reload, try to start it again: |
|
52 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
53 |
$ sudo start lava-instance-uwsgi LAVA_INSTANCE=env |
145.4.1
by Fathi Boudra
Update documentation |
54 |
|
55 |
On Ubuntu 10.10 (Maverick), comment the following line in |
|
56 |
/etc/init/lava-server-uwsgi.conf: |
|
57 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
58 |
# kill signal xxx |
145.4.1
by Fathi Boudra
Update documentation |
59 |
|
60 |
Now you can browse the lava-server from http://<Your IP>/ |
|
61 |
||
62 |
When you do some changes to lava-scheduler webapp code, reload related webapp |
|
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
63 |
to load the changes: |
145.4.1
by Fathi Boudra
Update documentation |
64 |
|
138.1.1
by Spring Zhang
update webapp develop doc |
65 |
$ touch etc/lava-server/uwsgi.reload |
145.4.1
by Fathi Boudra
Update documentation |
66 |
|
67 |
If it doesn't take effect, try: |
|
68 |
||
69 |
$ sudo restart lava-instance-scheduler LAVA_INSTANCE=dev |
|
70 |
||
71 |
Notes
|
|
72 |
^^^^^
|
|
73 |
||
74 |
* Don't run 'setup.py develop' without activating the virtualenv from the
|
|
75 |
instance. |
|
76 |
||
77 |
* Editing templates does not require restarting uwsgi.
|
|
78 |
||
79 |
* You may want to enable debug mode in
|
|
80 |
/srv/lava/instances/dev/etc/lava-server/lava-server.conf |
|
81 |
||
82 |
* If you change code, touch the uwsgi file
|
|
83 |
||
84 |
* If you want to change scheduler code (not the web parts) you'll have to
|
|
85 |
restart lava-instance-scheduler: |
|
86 |
||
87 |
$ sudo restart lava-instance-scheduler LAVA_INSTANCE=dev |
|
88 |
||
89 |
* If you have more than one instance installed on the machine, there are two
|
|
90 |
ways to make it browsable from http://<IP>/ |
|
91 |
||
92 |
a) disable other sites |
|
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
93 |
|
94 |
$ cd /etc/apache2/sites-enabled |
|
95 |
$ ls |
|
96 |
lab.conf dev.conf |
|
97 |
$ sudo a2dissite lab.conf |
|
98 |
$ sudo restart apache2 |
|
99 |
||
145.4.1
by Fathi Boudra
Update documentation |
100 |
b) allow multiple sites together |
101 |
||
135.1.1
by Spring Zhang
Add doc how to setup web app development environment |
102 |
TODO |