Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charmcraftcache-0.3.4.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

charmcraftcache-0.3.4-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file charmcraftcache-0.3.4.tar.gz.

File metadata

  • Download URL: charmcraftcache-0.3.4.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for charmcraftcache-0.3.4.tar.gz
Algorithm Hash digest
SHA256 bccca6389eb2e6dee805125b2a1fb11263f2d25ec9434648e35a095f7540253f
MD5 9dc0a0cef702c08743daab2b4af07e50
BLAKE2b-256 b265a407a5495391361cb25baae6e6772085361c5ae6de49085d1ef9dbb8777a

See more details on using hashes here.

File details

Details for the file charmcraftcache-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for charmcraftcache-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 996215b80c62d9ae2bd753cf0a9a8d1bda9d5b2c9fd322c87a8ea0a71d93c98e
MD5 25c575202c99cc77a5054f48b7d7dac6
BLAKE2b-256 c2810ea6d0c39fc8fd63e821e80df53eca1dd4a75a83ce69c8ec81c51d6e0c3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page