Podman update proposal

Description

The Podman Update Module handles the Podman images that shall be running in the device. A deployment with this module will stop all currently running Podman containers in the device, and start new containers with the provided list of Podman images in the Mender Artifact.

In case of an unforeseen error during the process, the module will use the rollback mechanism of the Mender client to restore the previously running Podman containers.

Specification

Specification
Module name podman
Supports rollback yes
Requires reboot no
Artifact generation script yes
Full operating system updater no
Source code pull request
Maintainer Community

Prepare the device

This section describes how to setup your target device, i.e. the device to be updated. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.

Prerequisites

This update module has the following prerequisites for the device environment:

This Update Module has the following prerequisites for the development environment:

Install the Update Module

Download the latest version of this Update Module by running:

mkdir -p /usr/share/mender/modules/v3 && wget -P /usr/share/mender/modules/v3 https://raw.githubusercontent.com/mendersoftware/mender-update-modules/7a95d23bd8c1a44b877ff5400e693d95e4122b56/podman/module/podman

Prepare the development environment on your workstation

This section describes how to set up your development environment on your workstation.

All commands outlined in this section should be run in the development environment.

Prerequisites

This Update Modules has the following prerequisites for the development environment:

Create Mender Artifacts

Download the podman artifact generator:

wget https://raw.githubusercontent.com/mendersoftware/mender-update-modules/7a95d23bd8c1a44b877ff5400e693d95e4122b56/podman/module-artifact-gen/podman-artifact-gen

Make it executable:

chmod +x podman-artifact-gen

Now generate a Mender Artifact using the following command:

ARTIFACT_NAME="my-container-update-1.0"
DEVICE_TYPE="my-device-type"
OUTPUT_PATH=my-container-update-1.0.mender
DOCKER_IMAGES="podman-image-1 podman-image2"
PLATFORM="linux/amd64"
./podman-artifact-gen -n ${ARTIFACT_NAME} --platform ${PLATFORM} -t ${DEVICE_TYPE} -o ${OUTPUT_PATH} ${DOCKER_IMAGES}
  • ARTIFACT_NAME - The name of the Mender Artifact
  • DEVICE_TYPE - The compatible device type of this Mender Artifact
  • OUTPUT_PATH - The path where to place the output Mender Artifact. This should always have a .mender suffix
  • DOCKER_IMAGES - The list of Docker images that we want the target to run. Each item can be any valid name for Docker to pull images from (tags or digests). For example debian, debian:jessie, debian:latest, debian:sha256@…, etc
  • PLATFORM - the CPU type it should be created for. For instance, using linux/arm64 makes it generate an artifact for any arm64 target.

Note that the actual image id that will be added in the Artifact is the digest (sha256 hash) of the image, regardless of the tag used to pull it in. This will ensure that the device will pull the exact same version of each image than the generation tool used when preparing the Artifact.

You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.