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
=== modified file 'usr/bin/orange-box-sync-charmstore'
--- usr/bin/orange-box-sync-charmstore 2014-08-22 22:11:37 +0000
+++ usr/bin/orange-box-sync-charmstore 2014-10-01 17:24:20 +0000
@@ -31,13 +31,25 @@
31mkdir -p /srv/charmstore/snapshot-$DATE31mkdir -p /srv/charmstore/snapshot-$DATE
3232
33echo Mirroring the Charmstore ...33echo Mirroring the Charmstore ...
34cd /srv/charmstore/34cd /srv/charmstore/snapshot-$DATE
35run-one charm getall snapshot-$DATE 2>/dev/null35sudo -i run-one charm getall /srv/charmstore/snapshot-$DATE 2>/dev/null
36#check some base charms are there:
37if [ ! -d juju-gui ]; then
38 echo "Juju-gui charm is missing - exiting"
39 exit
40elif [ ! -d nova-cloud-controller ]; then
41 echo "nova-cloud-controller charm is missing - exiting"
42 exit
43elif [ ! -d mongodb ]; then
44 echo "mongodb charm is missing - exiting"
45 exit
46fi
47
36#Branch the Landscape charm - required for Landscape demo to minimise network dependencies48#Branch the Landscape charm - required for Landscape demo to minimise network dependencies
37cd snapshot-$DATE49sudo -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)
38bzr branch lp:~landscape/landscape-charm/stable landscape >/dev/null 2>&1 || (cd landscape && bzr pull >/dev/null 2>&1)
39#Branch the cinder-ceph charm - required for openstack50#Branch the cinder-ceph charm - required for openstack
40bzr branch lp:charms/cinder-ceph >/dev/null 2>&1 || (cd cinder-ceph && bzr pull >/dev/null 2>&1)51sudo -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)
52
41#Link directories for service aliases53#Link directories for service aliases
42ln -s quantum-gateway neutron-gateway54ln -s quantum-gateway neutron-gateway
43ln -s rabbitmq-server rabbitmq55ln -s rabbitmq-server rabbitmq

Subscribers

People subscribed via source and target branches