diff --git a/docs/.custom_wordlist.txt b/docs/.custom_wordlist.txt index f0c8560387..9630a161ce 100644 --- a/docs/.custom_wordlist.txt +++ b/docs/.custom_wordlist.txt @@ -50,6 +50,7 @@ dvipng drwxr-xr-x drwxrwxrwx emacs +enablement FIGlet Filesets? filetrees? diff --git a/docs/how-to/crafting/index.rst b/docs/how-to/crafting/index.rst index f983e99227..744785caaf 100644 --- a/docs/how-to/crafting/index.rst +++ b/docs/how-to/crafting/index.rst @@ -22,6 +22,7 @@ Software dependencies Much of the work of making a snap is in determining and adding its dependencies. - :ref:`how-to-manage-dependencies` +- :ref:`how-to-pack-a-pro-snap` User settings and data @@ -78,3 +79,4 @@ with APT. reuse-packages-between-builds create-a-component enable-classic-confinement + pack-a-pro-snap diff --git a/docs/how-to/crafting/pack-a-pro-snap.rst b/docs/how-to/crafting/pack-a-pro-snap.rst new file mode 100644 index 0000000000..fcca056b92 --- /dev/null +++ b/docs/how-to/crafting/pack-a-pro-snap.rst @@ -0,0 +1,83 @@ +.. meta:: + :description: Pack a snap that contains extended security patches or meets regulatory compliance needs, powered by Ubuntu Pro. + +.. |app| replace:: Snapcraft +.. |app-command| replace:: snapcraft +.. |artifact| replace:: snap +.. |an-artifact| replace:: a snap +.. |app-min-pro-version| replace:: 9.1 +.. |app-link| replace:: https://snapcraft.io/snapcraft + +.. _how-to-pack-a-pro-snap: + +Pack a Pro-compliant snap +========================= + +.. include:: ../../common/craft-application/how-to-guides/pack-a-pro-artifact.rst + :start-after: .. Begin overview + :end-before: .. End overview + +Core24 and higher +~~~~~~~~~~~~~~~~~~~ + +.. include:: ../../common/craft-application/how-to-guides/pack-a-pro-artifact.rst + :start-after: .. End overview + +Core22 +~~~~~~~ + +Core22 snaps use a legacy mechanism to pack Pro-compliant snaps. The mechanism uses the +term *Ubuntu Advantage* (UA) instead of *Ubuntu Pro*. + +Prerequisites +------------- + +- An Ubuntu Pro token (https://ubuntu.com/pro) + +Identify the required Pro services +---------------------------------- + +First, determine which Pro services fit your needs: + +- ``esm-apps`` or ``esm-infra``: If your goal is to pack a snap for an application + and include the latest security patches for a base that is no longer under Standard + Security Maintenance. +- ``fips``, ``fips-updates`` or ``fips-preview``: If you need to deploy a snap in a + highly regulated environment that processes sensitive data. + +The desired Pro services must be available. On a system with your Pro token +attached, run ``pro status`` and check the ``ENTITLED`` column for available +services. The Ubuntu Pro Client documentation has `detailed information on each service +`__. + +Add a ``ua-services`` key to your snap, and list the services: + +.. code-block:: yaml + :caption: snapcraft.yaml + + ua-services: + - esm-apps + - esm-infra + +Pack the snap +------------- + +Now you can pack the snap with the desired services by passing the Pro token: + +.. code-block:: bash + :substitutions: + + snapcraft pack --ua-token --enable-experimental-ua-services + +The Pro token can also be provided as an environment variable: + +.. code-block:: bash + :substitutions: + + SNAPCRAFT_UA_TOKEN= snapcraft pack --enable-experimental-ua-services + +As Pro enablement is an experimental feature, ``--enable-experimental-ua-services`` is +needed in either case. + +Snapcraft will automatically attach the Pro subscription and enable the requested +services in the build environment while packing the snap. diff --git a/pyproject.toml b/pyproject.toml index 6e28a99223..0b4444b932 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ dynamic = ["version"] dependencies = [ "catkin-pkg==1.1.0; sys_platform == 'linux'", "click>=8.3.3", - "craft-application[remote]>=7.1.0", + "craft-application[remote] @ git+https://github.com/canonical/craft-application@work/CRAFT-5237/pro-docs", "craft-archives>=2.2.0", "craft-cli>=3.4.0", "craft-grammar>=2.3.0", diff --git a/uv.lock b/uv.lock index b492b47291..828d23ea96 100644 --- a/uv.lock +++ b/uv.lock @@ -491,8 +491,8 @@ toml = [ [[package]] name = "craft-application" -version = "7.1.0" -source = { registry = "https://pypi.org/simple" } +version = "7.1.0.post24+g9e89e3a" +source = { git = "https://github.com/canonical/craft-application?rev=work%2FCRAFT-5237%2Fpro-docs#9e89e3a116c2772508fa16b2ef888a2a04926c4e" } dependencies = [ { name = "annotated-types" }, { name = "craft-archives" }, @@ -513,10 +513,6 @@ dependencies = [ { name = "snap-http" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6b/c3/be96c01c1b92a7a7eb6cafa881ccd09a6b9e1db1355835fc98f001680cc3/craft_application-7.1.0.tar.gz", hash = "sha256:e0a3fb2080bf1dd6daf8b570262716f79a5f307a87d3ed2b986eaca50e07efed", size = 663202, upload-time = "2026-07-07T22:02:40.491Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/ce/169bdacdfbda0fe8a880d914be0794fc5379b7ec577546444f1572f4762d/craft_application-7.1.0-py3-none-any.whl", hash = "sha256:3319310644d1d935fd7e2fb285fa38bc87c490f3d4fb72fed934e6202164b7bc", size = 212571, upload-time = "2026-07-07T22:02:38.317Z" }, -] [package.optional-dependencies] remote = [ @@ -2519,7 +2515,7 @@ types = [ requires-dist = [ { name = "catkin-pkg", marker = "sys_platform == 'linux'", specifier = "==1.1.0" }, { name = "click", specifier = ">=8.3.3" }, - { name = "craft-application", extras = ["remote"], specifier = ">=7.1.0" }, + { name = "craft-application", extras = ["remote"], git = "https://github.com/canonical/craft-application?rev=work%2FCRAFT-5237%2Fpro-docs" }, { name = "craft-archives", specifier = ">=2.2.0" }, { name = "craft-cli", specifier = ">=3.4.0" }, { name = "craft-grammar", specifier = ">=2.3.0" },