charmcraftcache
Reinventing the wheel
Fast first-time builds for charmcraft—on a local machine or CI
Installation
Install pipx: https://pipx.pypa.io/latest/installation/
pipx install charmcraftcache
Usage
ccc add
ccc pack
For best results, add charm-strict-dependencies: true to your charmcraft.yaml.
How it works
Why are charmcraft builds slow?
Instead of downloading wheels from PyPI (which pip does by default), charmcraft builds Python package wheels from source (i.e. with pip install --no-binary).
Caching mechanism
charmcraft builds each charm base in a separate LXC container1. Within each container, pip has an internal cache for wheels built from source & for HTTP responses.
charmcraft 2.5 moved the pip internal cache to the LXC host machine, so that one pip cache is used for all LXC containers. (This increases the chance of a cache hit—a faster build.)
However, charmcraft builds are still slow the first time the wheel is built. This happens on CI runners, when you update dependencies, use a new machine/VM, or contribute to a new charm.
charmcraftcache solves the slow first build.
charmcraftcache-hub maintains a list of charms. For each charm, every Python dependency is built from source & uploaded to a GitHub release.
ccc pack downloads these pre-built wheels to charmcraft's pip cache (and then runs charmcraft pack).
Isn't this just a worse version of PyPI?
Pretty much. The only difference is charmcraftcache-hub wheels are built from source on our runners, instead of built by the package maintainer.
-
Unless
--destructive-modeis enabled ↩
Release files for charmcraftcache 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| charmcraftcache-0.2.1.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| charmcraftcache-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / charmcraftcache-0.2.1.tar.gz
| Download URL | charmcraftcache-0.2.1.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c52916db15d520d1a450e1db8e4708a1ec55cb1cec7e54dd59a906897a332131
|
|
BLAKE2b-256 checksum How to use checksums |
299f97bd47d14942088cb7370b983e25a7972900ab0e87f0436752525b96737d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / charmcraftcache-0.2.1-py3-none-any.whl
| Download URL | charmcraftcache-0.2.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98fc334c1c33c49ac6e756d971fe8378c6e65df968c077cafb7db67c837462c4
|
|
BLAKE2b-256 checksum How to use checksums |
378b27c6937808df84df1efd0da8b439ad01125a68efbc93734f009ed573abab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|