Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lost container preloading info #701

Merged
merged 1 commit into from
Apr 19, 2024
Merged
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 source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@
"reference-manual/linux/linux-building": "../../user-guide/lmp-customization/linux-building.html",
"reference-manual/linux/linux-extending": "../../user-guide/lmp-customization/linux-extending.html",
"reference-manual/qemu/qemu": "../../user-guide/qemu/qemu.html",
"reference-manual/linux/preloaded-images": "../../user-guide/containers-and-docker/container-preloading.html"
}

# Make external links open in a new tab.
Expand Down
77 changes: 77 additions & 0 deletions source/user-guide/containers-and-docker/container-preloading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,82 @@ Verify the ``compose-apps-early-start`` application status:

After the ``compose-apps-early-start`` service has been successfully run, ``docker ps`` will show that the preloaded apps are running.

Common Advanced Scenario
------------------------

More complex workflows are common.
For example, a Factory may have ``containers.git`` set up with multiple branches where each specifies a different set of apps.

Assume you have four branches with the following application:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume the 4 branches are: devel, experimental, main, production

it took me 3 seconds to understand "money-making-app" is not the branch name

I'm only saying, I don't know if anything should be changed.


.. code-block:: shell

# devel and experimental:
money-making-app - The "product"
debug-tools - A compose app with some tooling used for development
# main:
money-making-app - The "product"
fiotest - A compose-app that some devices run for QA.
# production:
money-making-app - The "product"

In this scenario, you can configure each Target individually to preload different applications in its image.

Configure this with additional variables for ``ref_options``.

.. code-block:: yaml

ref_options:
refs/heads/devel:
params:
APP_SHORTLIST: "<app1>,<app2>,<...>"
ASSEMBLE_SYSTEM_IMAGE: "<1|0> "

- ``APP_SHORTLIST`` - Overrides the list of application.
- ``ASSEMBLE_SYSTEM_IMAGE`` - To enable|disable preloading Apps.

Assume you want to produce the following types of Targets:

* ``devel`` preloaded with the ``money-making-app`` and ``debug-tools``.
* ``main`` and ``production`` preloaded with the ``money-making-app``.
* ``experiemental`` will not preload anything .

Configure this in ``factory-config.yml`` with:

.. code-block:: yaml

lmp:
tagging:
# Use a "production" branch, that may have some special platform
# features enabled/disabled. However, it still uses the containers
# from master for its apps:
refs/heads/production:
- tag: production
inherit: main
...

containers:
preloaded_images:
enabled: true
shortlist: "money-making-app"

tagging:
# Changes to containers main create both "main" and "production" tagged Targets.
refs/heads/main:
- tag: main
- tag: production
refs/heads/devel:
- tag: devel

ref_options:
refs/heads/devel:
params:
APP_SHORTLIST: "money-making-app,debug-tools"
refs/heads/experimental:
params:
# Don't produce a preloaded system image
ASSEMBLE_SYSTEM_IMAGE: "0"

With this configuration, the Factory will produce Targets with the correct apps preloaded and enabled by default.

.. _meta-lmp: https://github.com/foundriesio/meta-lmp/tree/main
Loading