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) andcharm-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 legacycharm
tool (see the Pack a reactive based charm with Charmcraft tutorial for more information) -
created two new linters to verify that mandatory
actions.yaml
andconfig.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 thelogin
command to save the obtained credentials to a file -
the content of that file can be given to
charmcraft
through a newCHARMCRAFT_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 lightweightgnome-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 runcharmcraft
from alternative sources (i.e. not from the snap)
Use Charmcraft to:
- Initialise a new charm and directory structure
- Build your Charmed Operator into a charm for distribution
- Register your charm name on Charmhub
- Upload your charms to Charmhub
- Release your charms into channels
- Publish and fetch charm libraries
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!