Fast first-time builds for charmcraft
Project description
charmcraftcache
Reinventing the wheel
Fast first-time builds for charmcraft—on a local machine or CI
Installation
Install pipx
: https://pipx.pypa.io/stable/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 container[^1]. 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.
[^1]: Unless --destructive-mode
is enabled
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file charmcraftcache-0.2.5.tar.gz
.
File metadata
- Download URL: charmcraftcache-0.2.5.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d2018e522265be3b15682a98aafe621f2485675e1233a7c7f475b5f60628183 |
|
MD5 | 7f88ec30d3e99bb2102b39c8f6189a33 |
|
BLAKE2b-256 | 5ee35ee18d24bf543637337e8bce974213cad3e351e570299fd77bccc37b3c7d |
File details
Details for the file charmcraftcache-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: charmcraftcache-0.2.5-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6492bd03f0415a985cf02f3b1dcf6e4287d90021d247d8ba9fb084ea3c3f92 |
|
MD5 | 7bdaca662c84e129b608eea8ed44dbfe |
|
BLAKE2b-256 | da60f29df630053b2867a43b91547416956ec7287fb76e2dbca4e3d9213b92fb |