Upgrading applications

An application represents a deployed charm within a given model. Depending on the source of the application deployment dictates how an upgrade can be run.

Bundles are not upgrade-able themselves, as they are a collection of applications, that are not modelled by Juju itself.

To find out the source of the application deployment, you can utilise juju status via the ‘Store’ column.

Model    Controller  Cloud/Region  Version  SLA          Timestamp
default  test        lxd/default   2.9.4    unsupported  14:45:09+01:00

App           Version  Status   Scale  Charm         Store       Channel  Rev  OS      Message
juju-test              idle         0  juju-test     local                  0  ubuntu
ubuntu                 idle       0/1  ubuntu        charmhub    stable    18  ubuntu
ubuntu-cs              idle       0/1  ubuntu        charmstore  stable    18  ubuntu
...

Applications deployed via Charmhub

Refreshing Charmhub deployed application charms are done via channels (work to provide upgrades via revisions is ongoing). Conjoined with juju info <charm> it’s possible to inspect the current channels and revisions in each channel.

juju info ubuntu
name: ubuntu
charm-id: DksXQKAQTZfsUmBAGanZAhpoS4dpmXel
summary: A pristine Ubuntu Server
publisher: charmers
supports: focal, bionic, xenial, groovy
subordinate: false
store-url: https://charmhub.io/ubuntu
description: |
  This simply deploys the Ubuntu Cloud/Server image
channels: |
  latest/stable:     19  2021-06-07  (19)  828kB
  latest/candidate:  19  2021-06-07  (19)  828kB
  latest/beta:       19  2021-06-07  (19)  828kB
  latest/edge:       19  2021-06-07  (19)  828kB

From there it’s possible to use juju refresh ubuntu to upgrade the charm from revision 18 (that we can see in the above juju status output, to 19).

Moving between channels juju refresh ubuntu --channel="latest/edge" is also possible if the revision is a different value.

Applications deployed via charm-store charms

Charm-store charms are deployed from the older now deprecated charm store.

Refreshing charm-store charms can be done via channels or revisions, channels aren’t as expressive as those in charmhub charms, but can be used in a similar guise. Additionally juju info doesn’t support charm-store charms either, so looking up supported revisions and channels requires looking up the charm at Store | Juju or you can query for charm information, such as channels and revisions, with the charm utility, which is available via the Charm Tools software. See the Charm Tools page for guidance.

juju refresh cs:ubuntu-19

Applications deployed via local charm

Refreshing an existing local deployed application charm, requires the --path argument to the new charm.

juju refresh juju-test --path ./path/to/juju-test

As revision files are optional, it’s possible to refresh multiple times and a new revision is assigned to the upgrade each time.

Crossgrading (switch) an application

Crossgrading an application refers to upgrading an application by switching out the current charm and replacing it with a new local charm. This is accomplished by way of the --switch option. This differs from upgrading an existing charm locally (with the --path option) due to the charm being considered entirely new.

This type of upgrade should be a considered operation since Juju has only limited information with which to determine compatibility. The operation will succeed so long as the following conditions are met:

  • The new charm must support all relations that the application is currently participating in.

The new charm may add new relations and configuration settings.

Upgrade mechanics

Additional information of the low-level details can be found in the Charm developer guide.

Thank you for this doc. What I am missing is what triggers the upgrade. Sure I can do juju upgrade-charm wordpress but how would I know that a new revision is available? I think this info deserves to be part of the documentation even if it reads “it is up to the application to signal the existence of new releases”.

In the section "Applications deployed via Charmhub, you mention “juju info” as a command to use. Thjis command does not exist with juju 2.9.12 (latest/stable as of today). Did you mean “snap info” ?

The command “juju refresh” also does not exist. Can this doc be updated ?

I have juju 2.9.12 installed:

$ juju info slurmd
name: slurmd
charm-id: PNY1jWPbggzG1NZvpftYqLgg86qKyNtd
summary: |
  Slurmd, the compute node daemon of Slurm.
publisher: Omnivector Solutions
supports: focal, centos7
[...]

And juju refresh also exists (see juju refresh --help).

How do I upgrade the jujud image for a running application?