~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to README

  • Committer: Nicola Larosa
  • Date: 2012-12-12 10:08:50 UTC
  • mfrom: (274.1.6 1086512-revise-docs)
  • Revision ID: nicola.larosa@canonical.com-20121212100850-c689dexsczxzdm3p
Put deploy docs in README, add HACKING.

Move the development instructions from the README file to a newly created HACKING one, update them, link the HACKING into the docs. Put deploying instructions in the README file. Revise all docs updating them, and fixing markup and links.

R=frankban, gary.poster
CC=
https://codereview.appspot.com/6924047

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
======
2
 
README
3
 
======
4
 
 
5
 
Developer Install
6
 
=================
7
 
 
8
 
Juju GUI uses nodejs based development tools.
9
 
 
10
 
You'll need nodejs & npm from the ppa::
11
 
 
12
 
  $ sudo add-apt-repository ppa:chris-lea/node.js
13
 
  $ sudo apt-get update
14
 
  $ sudo apt-get install nodejs npm
15
 
 
16
 
You also need ImageMagick::
17
 
 
18
 
  $ sudo apt-get install imagemagick
19
 
 
20
 
The linter will be installed locally per branch, but if you want editor
21
 
integration, you may want to install jshint globally in your system::
22
 
 
23
 
  $ sudo npm install -g jshint
24
 
 
25
 
For building the docs, you also need sphinx::
26
 
 
27
 
  $ sudo apt-get install python-sphinx
28
 
 
29
 
To make releases, you'll need pytz::
30
 
 
31
 
  $ sudo apt-get install python-tz
32
 
 
33
 
The gui frontend can be installed with::
34
 
 
35
 
  $ bzr branch lp:juju-ui trunk
36
 
  $ cd trunk
37
 
  $ make server
38
 
 
39
 
It may take a while for the server to start the first time as npm will
40
 
need to download packages.  When ready, the server will print:
41
 
 
42
 
Server listening on 8888
43
 
 
44
 
You can then access the GUI at http://localhost:8888
45
 
 
46
 
You'll also need to deploy a juju environment with REST api access.
47
 
Currently that work resides in a pipeline of juju branches. The
48
 
recommended branch to use as a server is ``lp:~hazmat/juju/rapi-delta``.
49
 
 
50
 
You can use it with any environment, but for dev purposes, a local
51
 
environment works well. One environment option specific to this branch
52
 
is the api-port. An appropriate sample configuration::
53
 
 
54
 
  default: dev
55
 
  environments:
56
 
    dev:
57
 
      type: local
58
 
      data-dir: /home/kapil/.juju/local
59
 
      admin-secret: b3a5dee4fb8c4fc9a4db04751e5936f4
60
 
      default-series: precise
61
 
      juju-origin: ppa
62
 
      api-port: 8081
63
 
 
64
 
Note that juju-origin is set to the ppa, the api server runs outside of
65
 
the container, and is launched using whichever branch you're using.
66
 
 
67
 
Also note that the api-port should be set at 8081, which the gui's
68
 
initial environment connection currently defaults to.
69
 
 
70
 
You'll need to bootstrap the local environment, and deploy one service.
71
 
The api server needs access to the provisioning credentials which are
72
 
lazily initialized in juju upon usage.
73
 
 
74
 
Juju-gui and rapi-delta can communicate via an encrypted WebSockets
75
 
connection: to enable it, add the following line to the config above::
76
 
 
77
 
  api-secure: true
78
 
 
79
 
You will also need to edit your ``app/config.js`` replacing
80
 
``ws://localhost:8081/ws`` with ``wss://localhost:8081/ws``.
81
 
 
82
 
By default, rapi-delta uses a self-signed certificate; because of that you
83
 
will need to visit the https://localhost:8081/ws WebSockets URL with your
84
 
browser and accept the included self-signed certificate, or the WebSockets
85
 
encrypted connection will not work.
86
 
 
87
 
In order to use a different certificate, you add an api-keys option to the
88
 
config above: its value will be the path of the directory containing the
89
 
certificate and the private key, whose filenames will have to be respectively
90
 
``juju.crt`` and ``juju.key``.
91
 
 
92
 
After which, the gui should be functional (it automatically polls the
93
 
api server for establishing a websocket).
94
 
 
95
 
Running unit tests
96
 
==================
97
 
 
98
 
  $ xdg-open test/index.html
99
 
 
100
 
Documentation
101
 
=============
102
 
 
103
 
Generated JavaScript documentation is available in the yuidoc directory.
104
 
Start with the index.html file. You can view the docs by running::
105
 
 
106
 
  $ xdg-open yuidoc/index.html
107
 
 
108
 
To regenerate the docs run::
109
 
 
110
 
  $ make yuidoc
111
 
 
112
 
The documentation for YUIDoc markup is at
113
 
http://yui.github.com/yuidoc/syntax/ .
114
 
 
115
 
Running lint
116
 
============
117
 
 
118
 
  $ jshint --config=jshint.config `bzr ls -RV -k file | grep -v assets/`
119
 
 
120
 
Making releases
121
 
===============
122
 
 
123
 
To make a release, you must either be in a checkout of lp:juju-gui
124
 
without uncommitted changes, or you must override one of the
125
 
`pertinent variable names`_ to force a release.
126
 
 
127
 
.. _`pertinent variable names`: `Potentially Useful Release-Oriented Makefile Variables`_
128
 
 
129
 
You also need to have a gpg key, and the python-pytz package installed (as
130
 
well as launchpadlib, but that is installed by default in Ubuntu).
131
 
 
132
 
See the Process document (docs/process.rst) for step-by-step checklists to
133
 
make developer and stable releases.
134
 
 
135
 
Potentially Useful Release-Oriented Makefile Variables
136
 
------------------------------------------------------
137
 
 
138
 
The following is a list of pertinent Makefile variables.
139
 
 
140
 
FINAL
141
 
  Set FINAL to any non-empty value to make a final release. This will cause
142
 
  the bzr revno to be omitted from the tarball name, and (if you use the
143
 
  release target) will cause the release to be uploaded to the stable series
144
 
  rather than the trunk series. Example usage::
145
 
 
146
 
    $ FINAL=1 make release
147
 
 
148
 
PROD
149
 
  By default, releases will be uploaded to staging.launchpad.net, which is a
150
 
  separate version of Launchpad that uses a temporary database.  This can be
151
 
  convenient for trying out the release process in the Makefile without
152
 
  affecting our actual production releases.  Set PROD to any non-empty value
153
 
  to send uploads to launchpad.net, the production version of Launchpad, when
154
 
  you are ready to make a real release.
155
 
 
156
 
  Note that you may need to ask the webops to turn off the two-factor
157
 
  authentication on your Launchpad staging account in order for the staging to
158
 
  work. Go to the #launchpad-ops channel on the Canonical IRC server and ask
159
 
  something like "webops, could you disable 2FA on my staging account?"
160
 
 
161
 
  Example usage::
162
 
 
163
 
    $ PROD=1 make release
164
 
 
165
 
IS_TRUNK_CHECKOUT
166
 
  Set this to any non-empty value to force the Makefile to believe it is
167
 
  working with a trunk checkout. Example usage::
168
 
 
169
 
    $ IS_TRUNK_CHECKOUT=1 make release
170
 
 
171
 
HAS_NO_CHANGES
172
 
  Set this to any non-empty value to force the Makefile to believe that the
173
 
  current code tree has no changes. Example usage::
174
 
 
175
 
    $ HAS_NO_CHANGES=1 make release
176
 
 
177
 
IS_SAFE_RELEASE
178
 
  Set this to any non-empty value to force the Makefile to bypass checks of
179
 
  IS_TRUNK_CHECKOUT and HAS_NO_CHANGES. Example usage::
180
 
 
181
 
    $ IS_SAFE_RELEASE=1 make release
182
 
 
183
 
More documentation
184
 
==================
185
 
 
186
 
Install Sphinx::
187
 
 
188
 
  $ sudo apt-get install python-sphinx
189
 
 
190
 
Build the docs::
191
 
 
192
 
  $ cd docs
193
 
  $ make html
194
 
 
195
 
View them::
196
 
 
197
 
  $ xdg-open _build/html/index.html
 
1
========
 
2
Juju-GUI
 
3
========
 
4
 
 
5
Welcome. Juju-GUI is a web-based GUI for `Juju <https://juju.ubuntu.com/>`_.
 
6
Juju lets you deploy connected services to the cloud in a convenient,
 
7
vendor-neutral, and powerful way. The GUI lets you visualize and manage
 
8
your work more intuitively from a web browser.
 
9
 
 
10
See also:
 
11
 
 
12
- `The new Juju GUI: because a picture paints a thousand words
 
13
  <http://blog.canonical.com/2012/10/29/the-new-juju-gui-because-a-picture-paints-a-thousand-words/>`_
 
14
- a `demo of trunk <http://uistage.jujucharms.com:8080/>`_, which is reset
 
15
  every 15 minutes.
 
16
 
 
17
Deploy
 
18
======
 
19
 
 
20
There are no official releases of Juju-GUI yet, so you have to get the source
 
21
code from Launchpad::
 
22
 
 
23
  $ bzr branch lp:juju-gui
 
24
 
 
25
The most useful available commands are shown by the command::
 
26
 
 
27
  $ make help
 
28
 
 
29
You'll typically want to run one of ``make prod``,  ``make debug`` or ``make
 
30
devel`` to deploy an environment. You might also run ``make test`` to check
 
31
that everything is ok. You may also run ``make doc`` to generate the available
 
32
documentation.
 
33
 
 
34
Configure
 
35
=========
 
36
 
 
37
TBD