Skip to content

sysext: add built-in Incus sysext image #1655

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

Merged
merged 20 commits into from
May 19, 2025
Merged

sysext: add built-in Incus sysext image #1655

merged 20 commits into from
May 19, 2025

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Feb 13, 2024

In this PR, we add Incus support as opt-out built-in sysext.

Note for reviewers:

  • Most of this PR is adding new packages into portage-stable
  • One commit must be upstreamed: app-containers/incus: fix cross-compilation issue (app-containers/incus: fix cross-compilation issue gentoo/gentoo#42095)
  • With this sysext, we're adding new groups and users - I tried to leverage userdb to dynamically load and unload those groups when we load and unload the sysext image (note: it seems a soft reboot might still be necessary)
  • I have one concern for the static-libs useflag enabled for sys-libs/libcap as it seems we don't use this flag for the generic image but for the SDK - that said, the CI output does not show any change regarding the libcap.
  • documentation: incus: initial documentation flatcar-website#423

How to use

(This is optional to use ZFS)

---
variant: flatcar
version: 1.1.0
storage:
  files:
    - path: /etc/flatcar/enabled-sysext.conf
      contents:
        inline: |
          incus
          zfs
  links:
    - path: /etc/extensions/docker-flatcar.raw
      target: /dev/null
      overwrite: true
    - path: /etc/extensions/containerd-flatcar.raw
      target: /dev/null
      overwrite: true

Once on the instance, you can use a preseed or follow the interactive incus admin init:

core@localhost ~ $ systemctl status incus
● incus.service - Incus - main daemon
     Loaded: loaded (/usr/lib/systemd/system/incus.service; indirect; preset: disabled)
     Active: active (running) since Thu 2025-05-15 07:54:30 UTC; 40s ago
...
core@localhost ~ $ incus admin init
core@localhost ~ $ incus launch images:ubuntu/22.04 ubuntu-01
Launching ubuntu-01
core@localhost ~ $ incus list
+-----------+---------+----------------------+------+-----------+-----------+
|   NAME    |  STATE  |         IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+-----------+---------+----------------------+------+-----------+-----------+
| ubuntu-01 | RUNNING | 10.126.29.162 (eth0) |      | CONTAINER | 0         |
+-----------+---------+----------------------+------+-----------+-----------+
core@localhost ~ $ incus exec ubuntu-01 cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
core@localhost ~ $ incus storage list
+---------+--------+-------------+---------+---------+
|  NAME   | DRIVER | DESCRIPTION | USED BY |  STATE  |
+---------+--------+-------------+---------+---------+
| default | zfs    |             | 3       | CREATED |
+---------+--------+-------------+---------+---------+
core@localhost ~ $ zpool list
NAME      SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
default  4.50G   264M  4.24G        -         -     1%     5%  1.00x    ONLINE  -

Closes: flatcar/Flatcar#1319

@tormath1

This comment was marked as outdated.

Copy link

github-actions bot commented Mar 13, 2024

@tormath1 tormath1 moved this from ⚒️ In Progress to ✅ Testing / in Review in Flatcar tactical, release planning, and roadmap May 15, 2025
@tormath1 tormath1 requested a review from a team May 15, 2025 13:25
@@ -0,0 +1,3 @@
cros_pre_src_compile_pkgconfig() {
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a fix candidate for upstream, no?

tormath1 and others added 20 commits May 19, 2025 11:24
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
Incus build uses pkg-config support in Go to link against some library.
This needs the correct sysroot version of PKG_CONFIG to be exported.

Signed-off-by: Jeremi Piotrowski <[email protected]>
Co-Authored-By: Mathieu Tortuyaux <[email protected]>
Sort the sysext entries as well.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
this is required when loading the sysext image to dynamically load /
unload the groups provided by the image.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
This requests the `incus.service` for the multi-user.target

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
While building on `amd64`:
```bash
dosbin: _dist/bin/linux_amd64/incusd does not exist
```

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 merged commit 886b997 into main May 19, 2025
2 of 4 checks passed
@tormath1 tormath1 deleted the tormath1/exp-incus branch May 19, 2025 15:24
@github-project-automation github-project-automation bot moved this from ✅ Testing / in Review to Implemented in Flatcar tactical, release planning, and roadmap May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

New Package Request: LXD
4 participants