mojo should have a phase to upgrade charms

Bug #1530831 reported by Tom Haddon
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju
Confirmed
Low
Unassigned

Bug Description

Currently in some specification repositories we have custom scripts to upgrade charms in the running environment. Mojo should provide a phase for this. It could look something like this in a manifest file:

# Specify name of charm(s) to upgrade
juju-upgrade-charm charm-names=apache2,postgresql
# Specify name of service(s) to upgrade
juju-upgrade-charm service-names=my-frontend-service

Tom Haddon (mthaddon)
Changed in mojo:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Tom Haddon (mthaddon) wrote :

Note that we should check for steady state in the environment between each charm upgrade

Revision history for this message
Wes Mason (wesmason) wrote :
Revision history for this message
Robin Winslow (nottrobin) wrote :

We have code to upgrade charms if they've changed in mojo-comms-maas-io, here:
https://bazaar.launchpad.net/~canonical-is/canonical-mojo-specs/mojo-comms-maas-io/view/head:/comms/shared/scripts/lib/mojo_helpers.py#L109

In case it's any help.

Revision history for this message
Robin Winslow (nottrobin) wrote :

Apologies for the private link. Here's a public paste of the relevant part of that code - "update_deployed_services".

http://pastebin.ubuntu.com/14687410/

It does the following:

- Back-up existing local charms
- Go through each service and
  > Upgrade its charm if it changed
  > Update its settings if they've changed

It does the charm-upgrade and the settings-update (mentioned here: https://bugs.launchpad.net/mojo/+bug/1524872) together, because in some situations you may have new settings which only work with the new charm version and would break the old one, or the new charm might not work without some additional settings - so updating the two as close to each other as possible seems safest.

Revision history for this message
Paul Gear (paulgear) wrote :

This would be a very nice feature to have. Until such time as it's implemented, it would be really great if we could get mojo to:

export JUJU_REPOSITORY=/srv/mojo/$MOJO_PROJECT/$MOJO_SERIES/$MOJO_WORKSPACE/charms

Mojo knows where the charms are, since it just copied them there, so it should be able to automatically configure juju to look in the right place rather than consumers doing it in the charm upgrade scripts.

Revision history for this message
Paul Gear (paulgear) wrote :

Also, it was pointed out to me that $MOJO_REPO_DIR is already a thing, so it should be used in place of that rather convoluted setting.

Alvaro Uria (aluria)
tags: added: 4010 canonical-bootstack
Michał Ajduk (majduk)
tags: removed: 4010
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.