Skip to main content

The main tool to build, upload, and develop in general the Juju charms.

Project description

What is charmcraft?

Charmcraft provides a streamlined, powerful, opinionated, and flexible tool to develop, package, and manage the lifecycle of Juju charm publication, focused particularly on charms written within the Operator Framework.

It is still in heavy, initial development and so a lot is still To Be Done. However it is already useful, and already simplifies the life of the charmer.

How do I install it?

The easiest way to install charmcraft is by doing

sudo snap install --beta charmcraft

(more options are available as per snap info charmcraft) but some people with more esoteric needs not covered by the snap might need to instead go via pip3 install --user charmcraft.

What can it do for me today?

It can build your charm! No need for git submodules nor pesky hook symlinks, you can concentrate on your charm being pure python code (plus the required juju metadata), and charmcraft will fill in the boring bits for you.

For example, given a charm that consists exclusively of

my-charm
├── metadata.yaml
├── requirements.txt
└── src/
    └── charm.py

(and assuming ops is in requirements.txt), then running charmcraft build will produce a charm that looks like

my-charm
├── dispatch
├── hooks
│   ├── install -> ../dispatch
│   ├── start -> ../dispatch
│   └── upgrade-charm -> ../dispatch
├── metadata.yaml
├── src/
│   └── charm.py
└── venv/
    ├── ops/
    │   ├── ...
    └── yaml/
        └── ...

which should be all you need to juju deploy the charm!

How do I run it from source?

git clone https://github.com/canonical/charmcraft.git
cd charmcraft
virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
python -m charmcraft

If you would like to run the tests you can do so with

pip install -r requirements-dev.txt
./run_tests

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

charmcraft-0.5.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

charmcraft-0.5.0-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file charmcraft-0.5.0.tar.gz.

File metadata

  • Download URL: charmcraft-0.5.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for charmcraft-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2a7494b00c41d21d24df03b15a0259bbf9519c4732f9006559d9a955d2b8078c
MD5 51b479df35e58b6cb3b59cb7375e2233
BLAKE2b-256 767ed287f7b89eadc35c15039ad87a4db3131e6ea9870c40acbc5cf32ed78e73

See more details on using hashes here.

File details

Details for the file charmcraft-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: charmcraft-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for charmcraft-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2bab6130a566215eeb699188b36a8a87f71534cdc5c824ff574e1e8c4cd8cf
MD5 be372ea31dc229dd8a3bdcd537c08a0b
BLAKE2b-256 2cbc5bab3b73e8a0745c51c3c3a40cc544695d98915e7e19a7aa8c02cc5fc01e

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