Charm 2.0 makes it even easier to publish charms

Tags: Charms , Juju

This article was last updated 8 years ago.


Discover the newly improved charm package and command features that offer a simpler publishing workflow, as well as many changes to charm-tools.

TL;DR

There is a new package (and command) called charm that compliments the previous charm-tools package and provides a new way forward for managing charms and bundles in the charm store! This can be used regardless of Juju version (so not dependent on 1.25 or 2.0) and will be the recommended way of interacting, publishing, and managing charms in the store going forward.

Installing

There are several means for installation, it is recommended to go through your distributions means instead of installing directly from upstream.

Please also check the caveats section if you’ve been using the charm command thus far.

Ubuntu

For everyone not on Xenial, first add ppa:juju/stable with sudo add-apt-repository ppa:juju/stable then:

sudo apt update
sudo apt install charm charm-tools

Homebrew

brew install charm charm-tools

Currently waiting for Homebrew/homebrew-core#350 to land

PIP & GO

The new charm command is a golang package, so it’ll need to be installed separately from pip

GO

go get launchpad.net/godeps/...
go get -v github.com/juju/charmstore-client/...
git --git-dir=$GOPATH/src/github.com/juju/charmstore-client/.git 
    --work-tree=$GOPATH/src/github.com/juju/charmstore-client checkout 2.1.1
godeps -u $GOPATH/src/github.com/juju/charmstore-client/dependencies.tsv
go get -v github.com/juju/charmstore-client/...

PIP

pip install -U charm-tools==2.1.2

Highlights

Here are a few key highlights from the release

BRAND NEW CHARM COMMAND!

The UI Engineering team and juju-core teams have done a FANTASTIC job on really iterating on user and author feedback to make the charm publishing workflow to the store dead simple and very powerful. This new charm command introduces several new features:

  • charm push: easily add charms to the charm store
  • charm publish: manage development and stable versions of charms
  • charm grant/revoke: share charms with other people – or the public
  • charm pull: download charms from the store for offline deployments
  • charm list: show a list of charms either you, or another user has

This is just a subset of the new commands available. All the new charm commands have been documented and are available at https://jujucharms.com/docs/devel/tools-charm-tools#usage

Channels and ACLs

Charms now can be pushed to the store and both published to channels or assigned ACLs. All of this has been documented in length at https://jujucharms.com/docs/devel/authors-charm-store

charm-tools are 2.0 ready

This includes updating proof for new fields (payloads, storage, series, min-juju-version, etc).

powershell charm template

You can now run charm create -t powershell to get the latest powershell charm template

charm pull-source

With the creation of a charm pull command, the removal of explicit VCS in the store, and the rise of layers we found it pertinent to add a pull-source command. This command will pull the layer used to build the charm, the charm itself, and understands both interface and layer prefixes to pull sources from the the Charm Layer index.

Changes

Outline of the changes that went into each release

charm

This is the first public release of the charmstore-client, as such no changes to report. Lots of new features though.

charm-tools

A LOT of changes happened between v1.11.1 and v2.1.2 (too many to enumerate in email). The full list can be found at the charm-tools repo.

charm-tools itself saw nearly 2,000 additions and 1500 deletions. Lots of cleaning up of code, user experience improvements, as well as updating to make sure charm 2.0 is a fantastic experience.

Caveats

This transition was a long time coming! As such its not without a few hitches.

I’ve already installed the charm command

Many of you may have installed early preview releases of the new charm command. The packaging for such was evolving quickly. There were two sources and two versions of the charm package that existed prior to today’s release. In order to figure out if you are affected by this please run:

 dpkg-query -W charm

If you have charm installed you’ll likely see the following

charm      VERSION

If your VERSION starts with the number 4, congratulations! You were a super early adopter, but have a very outdated package. Please first remove ppa:yellow/ppa from your machine: sudo add-apt-repository -r ppa:yellow/ppa, then remove the offending package: sudo apt purge charm, finally follow install instructions above.

If your version starts with 2:2 then you too were an early adopter but have an epoch package that will no longer be updated. Simply apt purge charm then follow the install instructions above.

If your version starts with 2.1 then you’re good to go! Thank you for installing the charm command.

Finally, if your version wasn’t represented above you’re very special, please email me with the precise version you have for removal instructions.

charm-tools won’t install because python-path.py

This is any issue for anyone who installed from the juju stable ppa. Make sure the stable ppa is added, sudo add-apt-repository ppa:juju/stable, issue a sudo apt update, then perform a sudo apt dist-upgrade. python-path.py has been replaced by python-path from Xenial and is a far superior package.

charm-tools 2.2

We’re already hard at work on the next version of charm-tools, due out in October. You can follow along the progress:

Support

Finally, if you have any questions, please feel free to email them to this list, juju@lists.ubuntu.com – report issues against either https://github.com/juju/charm-tools or https://github.com/juju/charmstore-client ask questions in #juju on freenode.net or on https://askubuntu.com

Ubuntu cloud

Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.

Newsletter signup

Get the latest Ubuntu news and updates in your inbox.

By submitting this form, I confirm that I have read and agree to Canonical's Privacy Policy.

Related posts

Kubernetes backups just got easier with the CloudCasa charm from Catalogic

For a native integration for Canonical’s Kubernetes platform, Juju was the perfect fit, and the charm makes consuming CloudCasa seamless for users.

What is a Kubernetes operator?

Kubernetes is the open source, industry-standard platform for deploying, managing and scaling containerized applications – and applications on Kubernetes are...

Operate popular open source on Kubernetes – Attend Operator Day at KubeCon EU 2024

Operate popular open source on Kubernetes – Attend Operator Day at KubeCon EU 2024