Merge lp:~thomnico/orange-box-examples/serie-of-small-bugfixes into lp:orange-box-examples

Proposed by Nicolas Thomas
Status: Merged
Approved by: Nicolas Thomas
Approved revision: 99
Merged at revision: 96
Proposed branch: lp:~thomnico/orange-box-examples/serie-of-small-bugfixes
Merge into: lp:orange-box-examples
Diff against target: 337 lines (+118/-26)
5 files modified
bin/bundle2local.sh (+82/-0)
bin/orange-box-import-SA-keys (+1/-1)
contrail/contrail.yaml (+2/-1)
openstack/icehouse/trusty/icehouseOB-local.yaml (+21/-19)
telco/mydomain-bundle.sh (+12/-5)
To merge this branch: bzr merge lp:~thomnico/orange-box-examples/serie-of-small-bugfixes
Reviewer Review Type Date Requested Status
Nicolas Thomas (community) Approve
Review via email: mp+265489@code.launchpad.net

This proposal supersedes a proposal from 2015-07-22.

To post a comment you must log in.
Revision history for this message
Nicolas Thomas (thomnico) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Nicolas Thomas (thomnico) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'bin/bundle2local.sh'
2--- bin/bundle2local.sh 1970-01-01 00:00:00 +0000
3+++ bin/bundle2local.sh 2015-07-22 09:07:53 +0000
4@@ -0,0 +1,82 @@
5+#!/bin/bash
6+#
7+# bundle2local
8+# Copyright (C) 2014 Canonical Ltd.
9+#
10+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as published by
14+# the Free Software Foundation, version 3 of the License.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU General Public License for more details.
20+#
21+# You should have received a copy of the GNU General Public License
22+# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
24+## TODO start from juju-deployer to do the same but more beautifully ..
25+set -ex
26+
27+
28+bundle2local()
29+{
30+
31+[ -d charmstore/trusty ] || mkdir -p charmstore/trusty
32+[ -d charmstore/precise ] || mkdir -p charmstore/precise
33+TMPFILE=`mktemp`
34+CACHEDIRS=`mktemp`
35+ROOTDIR=$PWD
36+
37+### this is THE biggest hack deployer know how to match charmstore to specific version reuse that and turn it into local charms. bonus it is super fast
38+juju-deployer -vbu -c $1 2>&1 | grep "Cache dir" |awk '{print $5}' > $CACHEDIRS
39+
40+## regex to get serie and charm name.
41+grep "charm:" $1 | sed -r 's!.*charm\s*.*.*(trusty|precise)\/(.*)!\1:\2!' > $TMPFILE
42+#normalise if there is " or ' some bundle don't have them
43+sed -ie 's|["'\'']||g' $TMPFILE
44+while IFS=: read serie charm
45+do
46+ canonicalcharm=`echo $charm | sed -r 's!(.*)-.*[0-9]$!\1!'`
47+ CHARMDIR=`grep $serie_$charm $CACHEDIRS`
48+ [ -d charmstore/$serie/$charm ] || mkdir -p charmstore/$serie/$charm
49+ cp -rf $CHARMDIR/* charmstore/$serie/$charm/
50+cd $ROOTDIR
51+done <$TMPFILE
52+## Now create a -local version of the bundle:
53+BASEFILE=`basename $1 .yaml`
54+cat $1 | sed -r 's!(^.*\s)charm:\s*(.*)*(trusty|precise)\/(.*)*"$!\1charm: local:\3/\4!' > ${BASEFILE}-local.yaml
55+cat <<EOF
56+You can now do:
57+export JUJU_REPOSITORY=$ROOTDIR/charmstore
58+juju-deployer -c ${BASEFILE}-local.yaml
59+
60+To use your locally copied charms
61+If your bundle was already using some local charms you will have to copy them in $ROOTDIR/charmstore
62+EOF
63+
64+}
65+
66+usage()
67+{
68+cat << EOF
69+
70+bundle2local - create a local usable copy of charms and create a local version of the bundle
71+
72+USAGE: bundle2local mybundle.yaml
73+ Be sure to have charm-tools installed
74+ If already downloaded a pull request will be done.
75+ the charmstore will be local to the directory you run the script in.
76+EOF
77+exit 0
78+}
79+
80+
81+[ $# -lt 1 ] && usage
82+[ -f $1 ] || usage
83+BUNDLE=$1
84+
85+bundle2local $1
86+
87
88=== modified file 'bin/orange-box-import-SA-keys'
89--- bin/orange-box-import-SA-keys 2015-05-12 23:30:15 +0000
90+++ bin/orange-box-import-SA-keys 2015-07-22 09:07:53 +0000
91@@ -4,7 +4,7 @@
92 mv ~/.ssh/authorized_keys ~/.ssh/authorized_keys.old
93
94 #copy maas user's ssh key
95-sudo cat /home/maas/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
96+sudo cat ~maas/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
97
98 #sabdfl
99 ssh-import-id sabdfl
100
101=== modified file 'contrail/contrail.yaml'
102--- contrail/contrail.yaml 2015-05-12 22:13:31 +0000
103+++ contrail/contrail.yaml 2015-07-22 09:07:53 +0000
104@@ -118,7 +118,8 @@
105 - [ contrail-control, contrail-configuration ]
106 - [ nova-compute, neutron-contrail ]
107 - [ contrail-webui, keystone ]
108- - [ contrail-webui, contrail-configuration ]
109+ - - "contrail-webui:contrail_discovery"
110+ - "contrail-configuration:contrail-discovery"
111 - [ neutron-contrail, contrail-control ]
112 - [ neutron-contrail, neutron-gateway ]
113 - [ neutron-contrail, contrail-configuration ]
114
115=== modified file 'openstack/icehouse/trusty/icehouseOB-local.yaml'
116--- openstack/icehouse/trusty/icehouseOB-local.yaml 2015-02-07 17:59:14 +0000
117+++ openstack/icehouse/trusty/icehouseOB-local.yaml 2015-07-22 09:07:53 +0000
118@@ -1,25 +1,26 @@
119 icehouse:
120 overrides:
121 openstack-origin: "cloud:trusty-icehouse"
122+ source: "distro"
123 services:
124 ceph:
125- branch: "lp:charms/ceph"
126+ charm: "local:trusty/ceph-27"
127 num_units: 3
128 constraints: tags=physical
129 options:
130 fsid: "9e7aac42-4bf4-11e3-b4b7-5254006a039c"
131 "monitor-secret": AQAAvoJSOAv/NRAAgvXP8d7iXN7lWYbvDZzm2Q==
132- "osd-devices": "/srv"
133+ "osd-devices": "/srv /dev/sdb"
134 "osd-reformat": "yes"
135 annotations:
136 "gui-x": "2648.6688842773438"
137 "gui-y": "708.3873901367188"
138 ubuntu:
139- branch: "lp:charms/ubuntu"
140+ charm: "local:trusty/ubuntu"
141 num_units: 1
142 constraints: tags=physical
143 keystone:
144- branch: "lp:charms/keystone"
145+ charm: "local:trusty/keystone-5"
146 num_units: 1
147 to: lxc:ubuntu=0
148 options:
149@@ -29,7 +30,7 @@
150 "gui-x": "2013.905517578125"
151 "gui-y": "75.58013916015625"
152 "nova-compute":
153- branch: "lp:charms/nova-compute"
154+ charm: "local:trusty/nova-compute-11"
155 num_units: 3
156 to: [ceph=0, ceph=1, ceph=2]
157 options:
158@@ -38,7 +39,7 @@
159 "gui-x": "776.1040649414062"
160 "gui-y": "-81.22811031341553"
161 "neutron-gateway":
162- branch: "lp:charms/quantum-gateway"
163+ charm: "local:trusty/quantum-gateway-3"
164 num_units: 1
165 constraints: tags=virtual
166 options:
167@@ -48,30 +49,31 @@
168 "gui-x": "329.0572509765625"
169 "gui-y": "46.4658203125"
170 "nova-cloud-controller":
171- branch: "lp:charms/nova-cloud-controller"
172+ charm: "local:trusty/nova-cloud-controller-50"
173 num_units: 1
174 to: lxc:ubuntu=0
175 options:
176 "network-manager": Neutron
177+ "console-access-protocol": novnc
178 annotations:
179 "gui-x": "1388.40185546875"
180 "gui-y": "-118.01156234741211"
181 rabbitmq:
182- branch: "lp:charms/rabbitmq-server"
183+ charm: "local:trusty/rabbitmq-server-4"
184 num_units: 1
185 to: lxc:ubuntu=0
186 annotations:
187 "gui-x": "633.8120727539062"
188 "gui-y": "862.6530151367188"
189 glance:
190- branch: "lp:charms/glance"
191+ charm: "local:trusty/glance-3"
192 num_units: 1
193 to: lxc:ubuntu=0
194 annotations:
195 "gui-x": "1147.3269653320312"
196 "gui-y": "1389.5643157958984"
197 cinder:
198- branch: "lp:charms/cinder"
199+ charm: "local:trusty/cinder-4"
200 num_units: 1
201 to: lxc:ubuntu=0
202 options:
203@@ -80,20 +82,20 @@
204 "gui-x": "1752.32568359375"
205 "gui-y": "1365.716194152832"
206 "ceph-radosgw":
207- branch: "lp:charms/ceph-radosgw"
208+ charm: "local:trusty/ceph-radosgw-3"
209 num_units: 1
210 to: lxc:ubuntu=0
211 annotations:
212 "gui-x": "2216.68212890625"
213 "gui-y": "697.16796875"
214 cinder-ceph:
215- branch: "lp:charms/cinder-ceph"
216+ charm: "local:trusty/cinder-ceph-1"
217 num_units: 0
218 annotations:
219 "gui-x": "2257.5515747070312"
220 "gui-y": "1231.2130126953125"
221 "openstack-dashboard":
222- branch: "lp:charms/openstack-dashboard"
223+ charm: "local:trusty/openstack-dashboard-4"
224 num_units: 1
225 to: lxc:ubuntu=0
226 options:
227@@ -102,7 +104,7 @@
228 "gui-x": "2353.6898193359375"
229 "gui-y": "-94.2642593383789"
230 mysql:
231- branch: "lp:charms/mysql"
232+ charm: "local:trusty/mysql-1"
233 num_units: 1
234 to: lxc:ubuntu=0
235 options:
236@@ -111,34 +113,34 @@
237 "gui-x": "364.4567565917969"
238 "gui-y": "1067.5167846679688"
239 mongodb:
240- branch: "lp:charms/mongodb"
241+ charm: "local:trusty/mongodb-0"
242 num_units: 1
243 to: lxc:ubuntu=0
244 annotations:
245 "gui-x": "-70.0399979352951"
246 "gui-y": "1282.8224487304688"
247 ceilometer:
248- branch: "lp:charms/ceilometer"
249+ charm: "local:trusty/ceilometer-0"
250 num_units: 1
251 to: lxc:ubuntu=0
252 annotations:
253 "gui-x": "-78.13333225250244"
254 "gui-y": "919.3128051757812"
255 ceilometer-agent:
256- branch: "lp:charms/ceilometer-agent"
257+ charm: "local:trusty/ceilometer-agent-0"
258 num_units: 0
259 annotations:
260 "gui-x": "-90.9158582687378"
261 "gui-y": "562.5347595214844"
262 heat:
263- branch: "lp:charms/heat"
264+ charm: "local:trusty/heat-0"
265 num_units: 1
266 to: lxc:ubuntu=0
267 annotations:
268 "gui-x": "494.94012451171875"
269 "gui-y": "1363.6024169921875"
270 ntp:
271- branch: "lp:charms/ntp"
272+ charm: "local:trusty/ntp-4"
273 num_units: 0
274 annotations:
275 "gui-x": "-104.57728099822998"
276
277=== modified file 'telco/mydomain-bundle.sh'
278--- telco/mydomain-bundle.sh 2015-02-18 16:44:51 +0000
279+++ telco/mydomain-bundle.sh 2015-07-22 09:07:53 +0000
280@@ -28,7 +28,9 @@
281 annotations:
282 "gui-x": "400"
283 "gui-y": "0"
284- "clearwater-homer":
285+ to:
286+ - lxc:clearwater-bono=0
287+ clearwater-homer:
288 charm: "cs:~thomnico/precise/clearwater-homer"
289 num_units: 1
290 options:
291@@ -48,7 +50,8 @@
292 annotations:
293 "gui-x": "200"
294 "gui-y": "300"
295- "clearwater-sprout":
296+ to: lxc:clearwater-homer=0
297+ clearwater-sprout:
298 charm: "cs:~thomnico/precise/clearwater-sprout"
299 num_units: 1
300 options:
301@@ -68,7 +71,8 @@
302 annotations:
303 "gui-x": "1000"
304 "gui-y": "450"
305- "telscale-load-balancer":
306+ to: lxc:clearwater-bono=0
307+ telscale-load-balancer:
308 charm: "cs:~thomnico/trusty/telscale-load-balancer"
309 num_units: 1
310 expose: true
311@@ -83,14 +87,16 @@
312 annotations:
313 "gui-x": "-500.8215242215981"
314 "gui-y": "698.5485784445332"
315- sipml5:
316+ to: lxc:telscale-load-balancer=0
317+ sipml5:
318 charm: "cs:~thomnico/trusty/sipml5"
319 num_units: 1
320 expose: true
321 annotations:
322 "gui-x": "1383.4697265625"
323 "gui-y": "423.10858154296875"
324- "telscale-restcomm":
325+ to: lxc:clearwater-bono=0
326+ telscale-restcomm:
327 charm: "cs:~thomnico/trusty/telscale-restcomm"
328 num_units: 1
329 constraints: arch=amd64 mem=2G
330@@ -98,6 +104,7 @@
331 annotations:
332 "gui-x": "-500.625244140625"
333 "gui-y": "547.9537963867188"
334+ to: lxc:telscale-load-balancer=0
335 relations:
336 - - "clearwater-bono:scscf"
337 - "clearwater-sprout:pcscf"

Subscribers

People subscribed via source and target branches