Charmcraft release 1.4.0 -- Call for testing!

Charmcraft supports the development of operators using the Charmed Operator Framework. It enables developers to build, upload and release operators on Charmhub and collaboration through charm libraries.

This new version was just released to candidate channel, we’d appreciate any tests on this, please report here any issues you find. Once we find this is solid enough, we will release it to stable.

It includes the following changes:

  • Several packing related improvements:

    • added two new properties to the default charm plugin: charm-python-packages to list Python packages to install from PyPI before installing requirements (these packages will be installed from sources and built locally at packing time) and charm-binary-python-packages very similar to the first one but allowing binary packages to be used

    • updated the craft-parts library to allow the packing of hook based charms (more information in the Pack a hook based charm with Charmcraft tutorial).

    • introduced a new reactive plugin to pack charms using the legacy charm tool (see the Pack a reactive based charm with Charmcraft tutorial for more information)

    • created two new linters to verify that mandatory actions.yaml and config.yaml files exist and have a proper YAML format

    • the building process now ignores the venv directory in the project sources

  • The store-related functionality is now provided by the craft-store library, which uses a new authentication backend that allowed several benefits:

    • there is a new --export option in the login command to save the obtained credentials to a file

    • the content of that file can be given to charmcraft through a new CHARMCRAFT_AUTH environment variable, which allows for easier integration with non-interactive environments (e.g. a CI/CD system)

    • added options to the login command to restrict the obtained credentials (shorter time to live, applies to specific charms, etc.)

    • the whoami command now shows the credentials restrictions

    Note that the new backend requires a working keyring in the system to be able to store the credentials in the login phase. If you’re seeing messages about no keyring being found in a desktop environment (not a container nor a remote machine), a low-effort solution is to install the lightweight gnome-keyring package.

    A combination of several of these new features can be found in the How to authenticate Charmcraft in remote environments tutorial.

  • The craft-cli library handles the exposure of messages to the user, improving the UX in general, and in particular:

    • added a new --trace global option that sets the Emitter level in TRACE, for debugging purposes

    • now a proper progress bar is used where uploading files is involved in different commands

  • The CHARMCRAFT_DEVELOPER environment variable is no longer mandatory to run charmcraft from alternative sources (i.e. not from the snap)

Use Charmcraft to:

We recommend the Charmed Operator Framework for charm development, but Charmcraft will help you publish charms written in any language. The Charmed Operator Framework enables the development of operators in a simple and straightforward way, using standard Python structures to allow for clean, maintainable, and reusable code.

Happy charming!

5 Likes

Just released this to stable. Happy charming!

1 Like

Hi Juju team,

I seem to have hit a snag… where I login… but then cannot seem to publish… saying I have not logged in … I just checked and it seems it’s on 1.4.0

EDIT: Sorry I just saw the github… will append log there https://github.com/canonical/charmcraft/issues/631

I can’t build charms with charmhelpers included in the requirements.txt

https://github.com/canonical/charmcraft/issues/632

This blocks me from using the nrpe parts from it.

Currently looking for something else to assist me in developing charms which is to use nrpe-external-master

Wonderful, will follow up there! Thanks for opening the issue.

1 Like

Thanks for opening the issue, will follow up there.

2 Likes

Do we need an update to this doc: Juju | How to configure Charmcraft to include the charm-binary-python-packages field and charm-python-packages field? :slight_smile: