Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.custom_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dvipng
drwxr-xr-x
drwxrwxrwx
emacs
enablement
FIGlet
Filesets?
filetrees?
Expand Down
2 changes: 2 additions & 0 deletions docs/how-to/crafting/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,3 +79,4 @@ with APT.
reuse-packages-between-builds
create-a-component
enable-classic-confinement
pack-a-pro-snap
83 changes: 83 additions & 0 deletions docs/how-to/crafting/pack-a-pro-snap.rst
Original file line number Diff line number Diff line change
@@ -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
<https://documentation.ubuntu.com/pro-client/en/v32/explanations/which_services/>`__.

Add a ``ua-services`` key to your snap, and list the services:

.. code-block:: yaml
:caption: snapcraft.yaml

ua-services:
- esm-apps
- esm-infra
Comment thread
mr-cal marked this conversation as resolved.

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 <pro-token> --enable-experimental-ua-services

The Pro token can also be provided as an environment variable:
Comment thread
mr-cal marked this conversation as resolved.

.. code-block:: bash
:substitutions:

SNAPCRAFT_UA_TOKEN=<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.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to bump before landing

Comment thread
mr-cal marked this conversation as resolved.
"craft-archives>=2.2.0",
"craft-cli>=3.4.0",
"craft-grammar>=2.3.0",
Expand Down
10 changes: 3 additions & 7 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading