-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): add craft-parts common documentation (#1939)
This brings in the common documentation sets from craft-parts and adds some of the pages. It mostly exists to enable my next PR, where I'll document the `python` and `poetry` plugins.
- Loading branch information
Showing
8 changed files
with
162 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. _lifecycle: | ||
|
||
***************** | ||
Lifecycle details | ||
***************** | ||
|
||
Each part is built in :ref:`four separate steps <craft_parts_steps>`, each with | ||
its own input and output locations: | ||
|
||
#. ``PULL`` — The source and external dependencies (such as package | ||
dependencies) for the part are retrieved from their stated location and | ||
placed into a package cache area. | ||
#. ``BUILD`` — The part is built according to the particular part plugin and | ||
build override. | ||
#. ``STAGE`` — The specified outputs from the ``BUILD`` step are copied into | ||
a unified staging area for all parts. | ||
#. ``PRIME`` — The specified files are copied from the staging area to the | ||
priming area for use in the final payload. This is distinct from ``STAGE`` | ||
in that the ``STAGE`` step allows files that are used in the ``BUILD`` steps | ||
of dependent parts to be accessed, while the ``PRIME`` step occurs after all | ||
parts have been staged. | ||
|
||
.. note:: | ||
While craft-parts offers an ``OVERLAY`` step as well, charmcraft does not use it. | ||
This is a distinction between how Charmcraft and `Rockcraft`_ work. | ||
|
||
Step order | ||
---------- | ||
|
||
While each part's steps are guaranteed to run in the order above, they are | ||
not necessarily run immediately following each other, especially if multiple | ||
parts are included in a project. While specifics are implementation-dependent, | ||
the general rules for combining parts are: | ||
|
||
#. ``PULL`` all parts before running further steps. | ||
#. ``BUILD`` any unbuilt parts whose dependencies have been staged. If a part | ||
has no dependencies, this part is built in the first iteration. | ||
#. ``STAGE`` any newly-built parts. | ||
#. Repeat the ``BUILD`` and ``STAGE`` steps until all parts have been staged. | ||
#. ``PRIME`` all parts. | ||
|
||
Further Information | ||
------------------- | ||
|
||
Further information can be found in the `Craft-parts`_ documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _parts: | ||
|
||
Parts | ||
***** | ||
|
||
Parts, powered by :external+craft-parts:ref:`craft-parts <reference>`, power the build | ||
system that charmcraft uses. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/common/craft-parts/reference/part_properties | ||
/common/craft-parts/reference/parts_steps | ||
/common/craft-parts/reference/step_execution_environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.. _plugins: | ||
|
||
Parts plugins | ||
************* | ||
|
||
Most charms only need one, maybe two parts, typically consisting of one of Charmcraft's | ||
application-specific plugins such as the `charm plugin`_ or the `reactive plugin`_ and | ||
potentially the addition of further files using the :ref:`craft_parts_dump_plugin`. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
/common/craft-parts/reference/plugins/dump_plugin | ||
/common/craft-parts/reference/plugins/nil_plugin | ||
|
||
.. warning:: | ||
Other plugins are available from :external+craft-parts:ref:`craft-parts <plugins>`, | ||
but these are unsupported in Charmcraft and should be used with caution. | ||
|
||
These plugins may significantly increase the size of a packed charm, and they may | ||
not work as intended. Please file a `feature request`_ in Charmcraft if you have a | ||
use case for another craft-parts upstream plugin. | ||
|
||
.. _charm plugin: https://juju.is/docs/sdk/charmcraft-yaml#heading--the-charm-plugin | ||
.. _reactive plugin: https://juju.is/docs/sdk/charmcraft-yaml#heading--the-reactive-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. _Charmcraft: https://canonical-charmcraft.readthedocs-hosted.com | ||
.. _Chisel: https://github.com/canonical/chisel | ||
.. _`Chisel releases`: https://github.com/canonical/chisel-releases | ||
.. _`Craft-parts`: https://canonical-craft-parts.readthedocs-hosted.com | ||
.. _Docker: https://docs.docker.com/ | ||
.. _`feature request`: https://github.com/canonical/charmcraft/issues/new?assignees=&labels=Enhancement&projects=&template=task.yaml | ||
.. _`OCI archive format`: https://github.com/opencontainers/image-spec/blob/main/layer.md#distributable-format | ||
.. _OCI_image_spec: https://github.com/opencontainers/image-spec/blob/main/spec.md | ||
.. _`OCI layers`: https://github.com/opencontainers/image-spec/blob/main/layer.md | ||
.. _LXD: https://canonical.com/lxd | ||
.. _Multipass: https://multipass.run/docs | ||
.. _`Open Container Initiative`: https://opencontainers.org/ | ||
.. _Rockcraft: https://documentation.ubuntu.com/rockcraft/ | ||
.. _skopeo: https://github.com/containers/skopeo | ||
.. _Snapcraft: https://snapcraft.io/docs/snapcraft-overview | ||
|
||
.. Potentially use a glossary to create indirect references to explanations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters