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

readme: add example to use release artifacts #18

Merged
merged 1 commit into from
Aug 3, 2023
Merged
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
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,74 @@ To add the automatic systemd unit loading to your distribution, store [`ensure-s

The tools normally generate squashfs images not only because of the compression benefits but also because it doesn't need root permissions and loop device mounts.

### Consuming the published images

There is a Github Action to build current recipes and to publish the built images as release artifacts. It's possible to directly consume the latest release from a Butane/Ignition configuration, example:
```yaml
# butane < config.yaml > config.json
# ./flatcar_production_qemu.sh -i ./config.json
variant: flatcar
version: 1.0.0
storage:
files:
- path: /opt/extensions/docker/docker-24.0.5.raw
contents:
source: https://github.com/flatcar/sysext-bakery/releases/download/20230803/docker-24.0.5.raw
- path: /opt/extensions/kubernetes/kubernetes-v1.27.4.raw
contents:
source: https://github.com/flatcar/sysext-bakery/releases/download/20230803/kubernetes-v1.27.4.raw
- path: /etc/systemd/system-generators/torcx-generator
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's a "hack" around the torcx-generator to prevent it to run. Otherwise Torcx unpacks containerd.service and docker.{service,socket} under /run/systemd/system/ which takes precedence over /usr/lib/systemd/system/docker.{service,socket} and /usr/lib/systemd/system/containerd.service merged by systemd-sysext.

Which leads to this weird situation:

$ docker version
Client:
 Version:           24.0.5
 API version:       1.41 (downgraded from 1.43)
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:34:32 2023
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          20.10.24
  API version:      1.41 (minimum version 1.12)
...

links:
- target: /opt/extensions/docker/docker-24.0.5.raw
path: /etc/extensions/docker.raw
hard: false
- target: /opt/extensions/kubernetes/kubernetes-v1.27.4.raw
path: /etc/extensions/kubernetes.raw
hard: false
```

In the generated artifacts, there is a `SHA256SUMS` holding the list of built images with their respective SHA256 digest. It allows to use `https://github.com/flatcar/sysext-bakery/releases/latest/download/` in a [`systemd-sysupdate`](https://www.freedesktop.org/software/systemd/man/sysupdate.d.html) configuration file, example:
```yaml
# butane < config.yaml > config.json
# ./flatcar_production_qemu.sh -i ./config.json
variant: flatcar
version: 1.0.0
storage:
files:
- path: /etc/sysupdate.kubernetes.d/kubernetes.conf
contents:
inline: |
[Transfer]
Verify=false

[Source]
Type=url-file
Path=https://github.com/flatcar/sysext-bakery/releases/latest/download/
[email protected]

[Target]
InstancesMax=3
Type=regular-file
Path=/opt/extensions/kubernetes
CurrentSymlink=/etc/extensions/kubernetes.raw
- path: /etc/sysupdate.docker.d/docker.conf
contents:
inline: |
[Transfer]
Verify=false

[Source]
Type=url-file
Path=https://github.com/flatcar/sysext-bakery/releases/latest/download/
[email protected]

[Target]
InstancesMax=3
Type=regular-file
Path=/opt/extensions/docker
CurrentSymlink=/etc/extensions/docker.raw
```
pothos marked this conversation as resolved.
Show resolved Hide resolved

### Creating a custom Docker sysext image

The Docker releases publish static binaries including containerd and the only missing piece are the systemd units.
Expand Down