Merge lp:~dweaver/orange-box/orange-box-robust-sync-charmstore into lp:orange-box

Proposed by Darryl Weaver
Status: Merged
Merged at revision: 489
Proposed branch: lp:~dweaver/orange-box/orange-box-robust-sync-charmstore
Merge into: lp:orange-box
Diff against target: 34 lines (+17/-5)
1 file modified
usr/bin/orange-box-sync-charmstore (+17/-5)
To merge this branch: bzr merge lp:~dweaver/orange-box/orange-box-robust-sync-charmstore
Reviewer Review Type Date Requested Status
Dustin Kirkland  (community) Needs Fixing
Review via email: mp+236755@code.launchpad.net

Description of the change

Make orange-box-sync-charmstore more robust and test for charms before enabling as local charm store.

To post a comment you must log in.
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hmm, I think I'd rather see something more like a for loop, over a *bunch* (all?) charms, to make sure that we have what we need. This feels a little brittle, and incomplete...

review: Needs Fixing
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I wonder if we can check with the Eco team, for a way to *verify* that we have a complete local copy of the charm store...

Revision history for this message
Darryl Weaver (dweaver) wrote :

It was a quick fix for the charms not downloading correctly over bzr.
I would also prefer a better way of syncing the charmstore and verifying the sync.
However, this broke for me, because I have my launchpad user set for the ubuntu user on the OB in order to be able to download the private repos, which I need a user and key.
When using sudo to run the script this persists and causes a permission denied error as there is no matching key.
So, I was introducing basic checks to make sure:
1) I fixed the error that causes the bzr login mismatch and forces an anonymous download (just using sudo -i).
2) Check that at least some charms were downloaded to catch the error again and exit before changing all the links to a charmstore that doesn't exist, which breaks the bootstrap.
Juju-gui was a good one to check as that one takes the longest to download and is a good indicator that the sync completed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'usr/bin/orange-box-sync-charmstore'
2--- usr/bin/orange-box-sync-charmstore 2014-08-22 22:11:37 +0000
3+++ usr/bin/orange-box-sync-charmstore 2014-10-01 17:24:20 +0000
4@@ -31,13 +31,25 @@
5 mkdir -p /srv/charmstore/snapshot-$DATE
6
7 echo Mirroring the Charmstore ...
8-cd /srv/charmstore/
9-run-one charm getall snapshot-$DATE 2>/dev/null
10+cd /srv/charmstore/snapshot-$DATE
11+sudo -i run-one charm getall /srv/charmstore/snapshot-$DATE 2>/dev/null
12+#check some base charms are there:
13+if [ ! -d juju-gui ]; then
14+ echo "Juju-gui charm is missing - exiting"
15+ exit
16+elif [ ! -d nova-cloud-controller ]; then
17+ echo "nova-cloud-controller charm is missing - exiting"
18+ exit
19+elif [ ! -d mongodb ]; then
20+ echo "mongodb charm is missing - exiting"
21+ exit
22+fi
23+
24 #Branch the Landscape charm - required for Landscape demo to minimise network dependencies
25-cd snapshot-$DATE
26-bzr branch lp:~landscape/landscape-charm/stable landscape >/dev/null 2>&1 || (cd landscape && bzr pull >/dev/null 2>&1)
27+sudo -i bzr branch lp:~landscape/landscape-charm/stable /srv/charmstore/snapshot-$DATE/landscape >/dev/null 2>&1 || (cd /srv/charmstore/snapshot-$DATE/landscape && bzr pull >/dev/null 2>&1)
28 #Branch the cinder-ceph charm - required for openstack
29-bzr branch lp:charms/cinder-ceph >/dev/null 2>&1 || (cd cinder-ceph && bzr pull >/dev/null 2>&1)
30+sudo -i bzr branch lp:charms/cinder-ceph /srv/charmstore/snapshot-$DATE/cinder-ceph >/dev/null 2>&1 || (cd /srv/charmstore/snapshot-$DATE/cinder-ceph && bzr pull >/dev/null 2>&1)
31+
32 #Link directories for service aliases
33 ln -s quantum-gateway neutron-gateway
34 ln -s rabbitmq-server rabbitmq

Subscribers

People subscribed via source and target branches