Charms, layers, and Launchpad

Cory Johns cory.johns at canonical.com
Thu Dec 17 22:57:21 UTC 2015


Greetings, all.

I wanted to suggest a convention for managing layered charms with Launchpad.

Until the publish workflow is ready, the "built charm" (i.e., output from
`charm build`) must be checked in to Launchpad in a repo such as:

    lp:~user/charms/trusty/foo/trunk

The base path and branch are required to be charms/<series> and /trunk,
respectively, for the charm to be ingested into the store.

Launchpad isn't really set up to deal with charm layers, but I think we
could settle on a convention of using the branch /layer to denote the
source charm layer for the corresponding /trunk built charm.  The source
layer (under /layer) is what we would like to have submitted to the Review
Queue, and the /trunk branch could be used only for ingestion into the
store.

Note that interface and base layers would need to have their own project,
since they don't really fit into the charms/series project structure.  They
can also live outside of Launchpad and work just fine as long as they are
registered in http://interfaces.juju.solutions/ (which can be done by
anyone with Launchpad credentials) (eventually, the plan is for them to be
published to the store in a similar way to charms).

I'd also like to mention our recommendations for developing layered
charms.  Specifically, you should create a base Juju repository directory
(e.g., ~/charms) and subdirectories for "layers", "interfaces" (if you plan
to develop those), and any series directories such as "trusty".  Then, you
should ensure that the following variables are set in your environment:

    JUJU_REPOSITORY=~/charms
    LAYER_PATH=$JUJU_REPOSITORY/layers
    INTERFACE_PATH=$JUJU_REPOSITORY/interfaces  # optional

Many layer and interface repos are prefixed with "layer-" or "interface-"
to indicate their role (e.g.,
https://github.com/juju-solutions/layer-hadoop-base) but when cloned
locally to work on them, the directory name must match the layer or
interface name ("hadoop-base", in this case).  So, to clone that repo:

    git clone https://github.com/juju-solutions/layer-hadoop-base
$JUJU_REPOSITORY/layers/hadoop-base

This will ensure that `charm build` does the right thing, can find all of
your in-progress layers, and puts the built charm in the right place.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20151217/b2a290a0/attachment.html>


More information about the Juju mailing list