Merge lp:~bac/charms/precise/juju-gui/unified-ppa into lp:charms/juju-gui

Proposed by Brad Crittenden
Status: Merged
Approved by: Brad Crittenden
Approved revision: 67
Merged at revision: 67
Proposed branch: lp:~bac/charms/precise/juju-gui/unified-ppa
Merge into: lp:charms/juju-gui
Diff against target: 258 lines (+88/-49)
6 files modified
Dependencies.md (+46/-0)
config.yaml (+38/-33)
hooks/backend.py (+0/-9)
hooks/install (+3/-3)
hooks/utils.py (+0/-3)
revision (+1/-1)
To merge this branch: bzr merge lp:~bac/charms/precise/juju-gui/unified-ppa
Reviewer Review Type Date Requested Status
Nicola Larosa (community) Approve
Benji York (community) code Approve
charmers Pending
Review via email: mp+167039@code.launchpad.net

Description of the change

Rather than have dependencies on various PPAs which are not under our control, causing the behavior of our charm to change without our input, we've created a single PPA that contains all of the packages the charm needs that are not part of the standard Ubuntu repositories for the series. Actually, there are two PPAs, 'stable' and 'devel'. The charm will use 'stable' but developers can switch to using the devel PPA by:

juju set juju-gui setting repository-location=ppa:juju-gui-charmers/devel

immediately after the deploy.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

Looks good.

The Dependencies.md file is an especially nice touch.

review: Approve (code)
Revision history for this message
Brad Crittenden (bac) wrote :

I meant to add the following:

After starting a charm and setting the repository-location config, I see the following:

ubuntu@ip-10-4-106-129:~$ ls /etc/apt/sources.list.d
juju-gui-charmers-devel-precise.list

Proof that we're getting the single PPA we want and all is well.

Also I took these notes about versions, etc:

# List of dependencies #

Source Package Use version / repo
---------------------------- ---------------- --- ----------
ppa:chris-lea/node.js-legacy nodejs base 0.8.23-1chl1~precise1
    npm base 1.2.18-1chl1~precise1

ppa:juju-gui/ppa haproxy gui 1.5-dev17-1

ppa:juju/pkgs python-charmhelpers[1] base 0.3+bzr178-3~precise1 (deprecated)
    python-shelltoolbox[2] base 0.2.1+bzr17-1~precise1~ppa1

ubuntu repositories python-yaml go 3.10-2 / main
    python-apt base 0.8.3ubuntu7.1 / main
    python-launchpadlib base 1.9.12-1 / main
    python-tempita base 0.5.1-1build1 / main
    zookeeper improv 3.3.5+dfsg1-1ubuntu1 / universe

[1] The juju/pkgs PPA is using a recipe that no longer builds
    python-charmhelpers. A new recipe is in place to build it directly into
    juju-gui-charmers/devel.
[2] The version of python-shelltoolbox in universe is 0.2.1+bzr17-1 for quantal and later.

67. By Brad Crittenden

Fixed old references.

Revision history for this message
Nicola Larosa (teknico) wrote :

Good stuff, thank you.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Dependencies.md'
2--- Dependencies.md 1970-01-01 00:00:00 +0000
3+++ Dependencies.md 2013-06-03 14:29:23 +0000
4@@ -0,0 +1,46 @@
5+# Juju GUI Charm external dependencies #
6+
7+The Juju GUI has a number of external dependencies including packages that are
8+in the Ubuntu repositories and other packages that are collected together into
9+a single PPA that the Juju GUI charm developers maintain.
10+
11+The packages in our devel PPA provide a superset of all software the charm may
12+need for different deployment strategies, such as using the sandbox
13+vs. improv, or Python Juju vs. Go Juju.
14+
15+# Stable and Devel #
16+
17+The GUI developers are members of the group ~juju-gui on Launchpad
18+(http://launchpad.net/~juju-gui). We have two PPAs hosted there to support the
19+GUI, `stable` and `devel`.
20+
21+To isolate charm deployments from upstream code changes, we have collected all
22+of the external software we depend upon and stored them in the PPAs we manage.
23+
24+The `stable` PPA includes only versions of our dependencies that we have
25+tested and found to work with the charm. The `devel` version includes new
26+versions of external software that are in the process of being tested.
27+
28+# Selecting the PPA #
29+
30+In the charm configuration file (config.yaml) there is an entry
31+`repository-location` that defaults to `juju-gui/charm_stable`. You can
32+change that in your config.yaml file or do a
33+
34+`juju set juju-gui repository-location=ppa:juju-gui/charm_devel`,
35+
36+for instance, immediately after deploying the GUI charm to pull from the devel
37+version. Only Juju GUI developers doing QA for the new PPA should ever need
38+to select the devel version.
39+
40+# Deploying for the enterprise #
41+
42+Organizations deploying the charm for their enterprise may have the
43+requirement to not allow the installation of software from outside of their
44+local network. Typically those environments require all external software to
45+be downloaded to a local server and used from there. Our devel PPA provides a
46+single starting place to obtain QA'd software. Dev ops can grab the subset of
47+packages they need, audit, test, and then serve them locally. The
48+`repository-location` config variable can be used to point to the local repo.
49+
50+
51
52=== modified file 'config.yaml'
53--- config.yaml 2013-05-11 00:18:47 +0000
54+++ config.yaml 2013-06-03 14:29:23 +0000
55@@ -18,26 +18,26 @@
56 default: stable
57 juju-api-branch:
58 description: |
59- The Juju API Bazaar branch (implementing the WebSocket server).
60- Since juju-core includes the WebSocket API server out of the box, this
61- option is ignored if the charm is deployed using juju-core.
62+ The Juju API Bazaar branch (implementing the WebSocket server). Since
63+ juju-core includes the WebSocket API server out of the box, this option
64+ is ignored if the charm is deployed using juju-core.
65 type: string
66 default: lp:~hazmat/juju/rapi-rollup
67 staging:
68 description: |
69- Connect the Juju GUI to the staging backend
70- (i.e. a simulated Juju environment).
71- Currently juju-core does not support the staging backend. For this
72- reason, this option is ignored if the charm is deployed using juju-core.
73+ Connect the Juju GUI to the staging backend (i.e. a simulated Juju
74+ environment). Currently juju-core does not support the staging
75+ backend. For this reason, this option is ignored if the charm is
76+ deployed using juju-core.
77 type: boolean
78 default: false
79 staging-environment:
80 description: |
81 The environment JSON export used by the staging server. This option can
82 be used to change the topology of the simulated Juju environment.
83- Possible values are 'sample' and 'large'.
84- Currently juju-core does not support the staging backend. For this
85- reason, this option is ignored if the charm is deployed using juju-core.
86+ Possible values are 'sample' and 'large'. Currently juju-core does not
87+ support the staging backend. For this reason, this option is ignored if
88+ the charm is deployed using juju-core.
89 type: string
90 default: sample
91 juju-gui-console-enabled:
92@@ -47,8 +47,8 @@
93 default: false
94 command-log-file:
95 description: |
96- The log file where stdout and stderr should be sent for all
97- commands that are run by charm hooks.
98+ The log file where stdout and stderr should be sent for all commands
99+ that are run by charm hooks.
100 type: string
101 default: /var/log/juju/juju-gui.log
102 ssl-cert-path:
103@@ -79,43 +79,48 @@
104 description: |
105 Whether or not the GUI is in read-only mode. Note that read-only mode is
106 advisory, and enforced only in the client. If someone can access the
107- websocket and has the password, they can send commands over the websocket
108- to mutate the environment.
109+ websocket and has the password, they can send commands over the
110+ websocket to mutate the environment.
111 type: boolean
112 default: false
113 serve-tests:
114 description: |
115- Whether or not the GUI unit tests are exposed. If this option is enabled,
116- unit tests can be run in the browser by visiting the URL
117+ Whether or not the GUI unit tests are exposed. If this option is
118+ enabled, unit tests can be run in the browser by visiting the URL
119 "https://[Juju GUI address]/test/".
120 type: boolean
121 default: false
122 secure:
123 description: |
124- In order to run the GUI over a non secure connection (HTTP) set this flag
125- to false. Do not set this property unless you understand and accept the
126- risks.
127+ In order to run the GUI over a non secure connection (HTTP) set this
128+ flag to false. Do not set this property unless you understand and accept
129+ the risks.
130 type: boolean
131 default: true
132 sandbox:
133 description: |
134- Run using an in-memory sandbox rather than a real (or even improv) Juju backend.
135- Sandbox is a client side construct running entirely in the client. Sandbox doesn't
136- currently support imported environment simulation and is exclusive to the staging: true
137- configuration. If staging is true it will be used in preference to sandbox at this time.
138+ Run using an in-memory sandbox rather than a real (or even improv) Juju
139+ backend. Sandbox is a client side construct running entirely in the
140+ client. Sandbox does not currently support imported environment
141+ simulation and is exclusive to the staging: true configuration. If
142+ staging is true it will be used in preference to sandbox at this time.
143 type: boolean
144 default: false
145- allow-additional-deb-repositories:
146- description: |
147- Allow access to remote PPAs. If this is False then you must have somehow
148- configured the configured package sources to include the packages that
149- the GUI needs. This will be made more explicit soon. For now, look in
150- the source: hooks/install and hooks/backend.py in particular.
151- type: boolean
152- default: true
153 charmworld-url:
154 description: |
155- The URL of the charm catalog site ("charmworld") from which charm catalog
156- data will be drawn.
157+ The URL of the charm catalog site ("charmworld") from which charm
158+ catalog data will be drawn.
159 type: string
160 default: https://manage.jujucharms.com
161+ repository-location:
162+ description: |
163+ The charm depends on several software packages that are not packaged in
164+ Ubuntu. In order to ensure that only versions known to work with our
165+ charm are used, there is a single PPA where all packages are kept. The
166+ juju-gui-charmers team supports 'stable' and 'devel' versions. Only
167+ stable should be used for production. For enterprise deployments that
168+ do not allow access to resources outside of their control, the location
169+ can be any specification as long as it is recognizable by
170+ 'add-apt-repository'.
171+ type: string
172+ default: ppa:juju-gui-charmers/stable
173
174=== modified file 'hooks/backend.py'
175--- hooks/backend.py 2013-05-03 09:13:45 +0000
176+++ hooks/backend.py 2013-06-03 14:29:23 +0000
177@@ -31,8 +31,6 @@
178 missing = utils.find_missing_packages(*backend.debs)
179 if missing:
180 utils.cmd_log(
181- backend.install_extra_repositories(*backend.repositories))
182- utils.cmd_log(
183 shelltoolbox.apt_get_install(*backend.debs))
184
185 # If we are not using a pre-built release of the GUI (i.e., we are
186@@ -87,7 +85,6 @@
187
188
189 class GuiMixin(object):
190- repositories = ('ppa:juju-gui/ppa',)
191
192 def start(self, backend):
193 config = backend.config
194@@ -191,12 +188,6 @@
195 mixins[i] = b()
196 self.mixins = mixins
197
198- def install_extra_repositories(self, *packages):
199- if self.config.get('allow-additional-deb-repositories', True):
200- utils.install_extra_repositories(*packages)
201- else:
202- apt_get('update')
203-
204 def different(self, *keys):
205 """Return a boolean indicating if the current config
206 value differs from the config value passed in prev_config
207
208=== modified file 'hooks/install'
209--- hooks/install 2013-04-28 09:57:41 +0000
210+++ hooks/install 2013-06-03 14:29:23 +0000
211@@ -18,9 +18,9 @@
212 return json.loads(output)
213
214 config = get_config()
215-allow_repos = config.get('allow-additional-deb-repositories', True)
216-if allow_repos:
217- bootstrap_utils.install_extra_repositories('ppa:juju/pkgs')
218+repo = config.get('repository-location')
219+if repo:
220+ bootstrap_utils.install_extra_repositories(repo)
221
222 # Python dependencies must be installed here so that the charm can import and
223 # use required libraries.
224
225=== modified file 'hooks/utils.py'
226--- hooks/utils.py 2013-05-17 09:07:28 +0000
227+++ hooks/utils.py 2013-06-03 14:29:23 +0000
228@@ -59,7 +59,6 @@
229 apt_get_install,
230 command,
231 environ,
232- install_extra_repositories,
233 run,
234 script_name,
235 search_file,
236@@ -88,7 +87,6 @@
237 JUJU_GUI_SITE = '/etc/apache2/sites-available/juju-gui'
238 JUJU_GUI_PORTS = '/etc/apache2/ports.conf'
239 JUJU_PEM = 'juju.includes-private-key.pem'
240-BUILD_REPOSITORIES = ('ppa:chris-lea/node.js-legacy',)
241 DEB_BUILD_DEPENDENCIES = (
242 'bzr', 'imagemagick', 'make', 'nodejs', 'npm',
243 )
244@@ -111,7 +109,6 @@
245 def _get_build_dependencies():
246 """Install deb dependencies for building."""
247 log('Installing build dependencies.')
248- cmd_log(install_extra_repositories(*BUILD_REPOSITORIES))
249 cmd_log(apt_get_install(*DEB_BUILD_DEPENDENCIES))
250
251
252
253=== modified file 'revision'
254--- revision 2013-05-23 13:34:03 +0000
255+++ revision 2013-06-03 14:29:23 +0000
256@@ -1,1 +1,1 @@
257-47
258+54

Subscribers

People subscribed via source and target branches