CharmHub

CharmHub is the new replacement store for the existing CharmStore. Juju provides a more seamless integration with CharmHub store by offering new and improved commands for the Juju CLI to make it an all-in-one experience.

juju info

Juju info displays important and vital information about a given charm/bundle, including the various channels available for deployment. In conjunction with juju find , the Juju command line is now closer integrated with the store.

$ juju info mattermost
name: mattermost
summary: Mattermost is a flexible, open source messaging platform that enables secure
  team collaboration.
publisher: mattermost-charmers
supports: kubernetes
subordinate: false
store-url: https://charmhub.io/mattermost
description: |
  Mattermost is a flexible, open source messaging platform that enables
  secure team collaboration.
  https://mattermost.com
relations:
  provides: {}
  requires:
    db: pgsql
channels: |
  latest/stable:     12  2020-12-17  (12)  403kB
  latest/candidate:  ↑
  latest/beta:       ↑
  latest/edge:       ↑

juju find

find gives Juju the ability to search the CharmHub store directly from the command line. Supplying an empty query will attempt to perform a search against the whole store, convenient as a general overview of the store.

$ juju find mattermost
Name        Bundle  Version  Publisher            Summary
mattermost  -       12       mattermost-charmers  Mattermost is a flexible, open source messaging
                                                  platform that enables secure team collaboration.
mm-pd-bot   -       3        mm-pd-bot-charmers   MatterMost Pagerduty Bot charm

juju download

The download command allows you to download charms directly from the CharmHub store to your local file system. This should make it easier to customise a charm before deploying or fulfil any potential air-gapped strategies.

Supplying a custom charm-hub-url provides ways of targeting different store implementations.

juju download mysql --charm-hub-url="https://api.staging.snapcraft.io"

Using existing commands should be very similar to existing workflows, but there are a few changes:

Custom CharmHub URL

Customised CharmHub URLs can be supplied during bootstrapping or when adding a model. The CharmHub URL will update the model-config, allowing one controller to have multiple models with different CharmHub URLs, which was different from CharmStore, which only allowed a URL per controller.

$ juju bootstrap localhost --config charm-hub-url="https://api.snapcraft.io"

Using the add-model syntax:

$ juju add-model other --config charm-hub-url="https://api.snapcraft.io"

Viewing the current CharmHub URL of a given model can be done via:

$ juju model-config charm-hub-url
https://api.snapcraft.io

Architecture

Juju requires knowledge about a charm’s given architecture upfront. Placement of a charm ensures the charm lands on the correct unit (machine / container) for the given architecture. Charm authors submitting a charm to the CharmHub API will be asked to supply which architecture it will be supporting (default is all).

To customise the placement of a charm based on the architecture constraints during deployment can be used:

$ juju deploy ubuntu --constraints="arch=arm64"

The default architecture for a given charm is amd64, but you can supply a constraint when bootstrapping Juju to allow that to be used as the default:

$ juju bootstrap localhost --bootstrap-constraints arch=arm64

Heterogeneous deployments of the same application in a given model are currently not supported (LP: #1908521). Supplying a different name for an application when deploying a charm within the same model can be a solution/workaround for this or alternatively a different model and using Cross Model Relations.

$ juju deploy ubuntu ubuntu-arm64 --constraints="arch=arm64"
$ juju deploy ubuntu ubuntu-amd64 --constraints="arch=amd64"

Interoperability

CharmHub is the preferred way deploying your charms and bundles, which means the existing CharmStore has become deprecated. Although set for removal in the future, Juju still works with the CharmStore, but there are a few issues:

Fully qualified charm URLs

It is now expected that all CharmStore URLs are fully qualified. Previously you didn’t necessarily have to fully qualify the schema of the charm URL, it was seen as good practice to do so. The change is simple, adding a cs: prefix to your URLs will ensure that it comes from the CharmStore.

  • mattermost becomes cs:mattermost

This includes URLs within bundles as well.

Private charms

Currently private charms aren’t supported in the CharmHub store, this is actively being worked on.

CharmStore bundles

To aid with the transition, CharmStore charms can be placed with in CharmHub bundles, but not the other way around.

4 Likes