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
charmplugin:charm-python-packagesto 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-packagesvery similar to the first one but allowing binary packages to be used -
updated the
craft-partslibrary to allow the packing of hook based charms (more information in the Pack a hook based charm with Charmcraft tutorial). -
introduced a new
reactiveplugin to pack charms using the legacycharmtool (see the Pack a reactive based charm with Charmcraft tutorial for more information) -
created two new linters to verify that mandatory
actions.yamlandconfig.yamlfiles exist and have a proper YAML format -
the building process now ignores the
venvdirectory in the project sources
-
-
The store-related functionality is now provided by the
craft-storelibrary, which uses a new authentication backend that allowed several benefits:-
there is a new
--exportoption in thelogincommand to save the obtained credentials to a file -
the content of that file can be given to
charmcraftthrough a newCHARMCRAFT_AUTHenvironment variable, which allows for easier integration with non-interactive environments (e.g. a CI/CD system) -
added options to the
logincommand to restrict the obtained credentials (shorter time to live, applies to specific charms, etc.) -
the
whoamicommand 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
loginphase. 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-keyringpackage.A combination of several of these new features can be found in the How to authenticate Charmcraft in remote environments tutorial.
-
-
The
craft-clilibrary handles the exposure of messages to the user, improving the UX in general, and in particular:-
added a new
--traceglobal 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_DEVELOPERenvironment variable is no longer mandatory to runcharmcraftfrom 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!
