Skip to content

Commit f5c2fba

Browse files
committed
test(guest): add Ubuntu 26 rootless Podman guest
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 7a00ead commit f5c2fba

7 files changed

Lines changed: 146 additions & 26 deletions

File tree

‎nix/test-guest/README.md‎

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ nix/test-guest/
3333
├── cache-lib.sh
3434
├── cache-seal.sh
3535
├── distros/
36-
│ ├── ubuntu.nix
36+
│ ├── ubuntu-24-04.nix
37+
│ ├── ubuntu-26-04.nix
3738
│ ├── centos.nix
3839
│ ├── fedora.nix
3940
│ └── rocky.nix
4041
└── configuration/
4142
├── docker.yml
43+
├── podman-rootless.yml
4244
├── podman.yml
4345
└── selinux.yml
4446
```
@@ -56,12 +58,13 @@ The root [`flake.nix`](../../flake.nix) exposes this directory as the `test-gues
5658

5759
## Supported configurations
5860

59-
| Distro | Docker | Podman | SELinux | Package format |
60-
| --- | --- | --- | --- | --- |
61-
| Ubuntu 24.04 | Yes | Yes | No | `.deb` |
62-
| CentOS Stream 10 | No | Yes | Yes | `.rpm` |
63-
| Fedora 44 | No | Yes | Yes | `.rpm` |
64-
| Rocky Linux 9 | Yes | Yes | Yes | `.rpm` |
61+
| Distro | Docker | Podman | Rootless Podman | SELinux | Package format |
62+
| --- | --- | --- | --- | --- | --- |
63+
| Ubuntu 24.04 | Yes | Yes | No | No | `.deb` |
64+
| Ubuntu 26.04 | Yes | Yes | Yes | No | `.deb` |
65+
| CentOS Stream 10 | No | Yes | No | Yes | `.rpm` |
66+
| Fedora 44 | No | Yes | No | Yes | `.rpm` |
67+
| Rocky Linux 9 | Yes | Yes | No | Yes | `.rpm` |
6568

6669
The `snapd` configuration is available for Ubuntu and prepares snapd for
6770
local Snap lifecycle experiments. It does not install Docker, because the Snap
@@ -70,8 +73,8 @@ interface rather than the host-package Docker configuration.
7073

7174
The Ubuntu 24.04 Podman configuration is available for runtime and packaging
7275
checks, but its Podman 4 release does not provide the `pasta` rootless network
73-
helper required by OpenShell sandbox callbacks. OpenShell Podman E2E runs use
74-
the Fedora guest, which provides Podman 5 and `pasta`.
76+
helper required by OpenShell sandbox callbacks. Rootless Podman E2E uses the
77+
Ubuntu 26.04 guest with `--with podman-rootless`.
7578

7679
List the available distros and configurations:
7780

@@ -84,13 +87,13 @@ nix run .#test-guest -- --list
8487
Boot a base Ubuntu VM:
8588

8689
```shell
87-
nix run .#test-guest -- --distro ubuntu
90+
nix run .#test-guest -- --distro ubuntu-24-04
8891
```
8992

9093
Apply the Docker configuration before opening the SSH session:
9194

9295
```shell
93-
nix run .#test-guest -- --distro ubuntu --with docker
96+
nix run .#test-guest -- --distro ubuntu-24-04 --with docker
9497
```
9598

9699
Other combinations use the same interface:
@@ -99,13 +102,14 @@ Other combinations use the same interface:
99102
nix run .#test-guest -- --distro rocky --with docker
100103
nix run .#test-guest -- --distro centos --with podman
101104
nix run .#test-guest -- --distro fedora --with podman
105+
nix run .#test-guest -- --distro ubuntu-26-04 --with podman-rootless
102106
```
103107

104108
Configurations are repeatable:
105109

106110
```shell
107111
nix run .#test-guest -- \
108-
--distro ubuntu \
112+
--distro ubuntu-24-04 \
109113
--with docker \
110114
--with podman
111115
```
@@ -138,7 +142,7 @@ The `test-guest-cache` app ensures a prepared disk exists for one exact distro,
138142

139143
```shell
140144
nix run .#test-guest-cache -- \
141-
--distro ubuntu \
145+
--distro ubuntu-24-04 \
142146
--with docker
143147
```
144148

@@ -147,7 +151,7 @@ backing cache:
147151

148152
```shell
149153
nix run .#test-guest-cache -- \
150-
--distro ubuntu \
154+
--distro ubuntu-24-04 \
151155
--with docker \
152156
--repository ghcr.io/nvidia/openshell/test-guest-cache \
153157
--digest sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
@@ -157,7 +161,7 @@ The command never publishes implicitly. Add `--push` after authenticating ORAS t
157161

158162
```shell
159163
nix run .#test-guest-cache -- \
160-
--distro ubuntu \
164+
--distro ubuntu-24-04 \
161165
--with docker \
162166
--repository ghcr.io/nvidia/openshell/test-guest-cache \
163167
--push
@@ -184,7 +188,7 @@ The default cache directory is `${XDG_CACHE_HOME:-$HOME/.cache}/openshell/test-g
184188
Cache command options:
185189

186190
```text
187-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
191+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
188192
--with NAME Apply docker, podman, or selinux; repeatable
189193
--repository REF OCI repository without a tag
190194
--digest DIGEST Trusted OCI manifest digest required for pulls
@@ -209,7 +213,7 @@ Install the package in an Ubuntu VM and run a command:
209213

210214
```shell
211215
nix run .#test-guest -- \
212-
--distro ubuntu \
216+
--distro ubuntu-24-04 \
213217
--with docker \
214218
--install artifacts/openshell_0.0.0-local_arm64.deb \
215219
-- openshell --version
@@ -226,7 +230,7 @@ guest file preserves the source's ordinary permission bits:
226230

227231
```shell
228232
nix run .#test-guest -- \
229-
--distro ubuntu \
233+
--distro ubuntu-24-04 \
230234
--copy ./openshell:/usr/local/bin/openshell \
231235
-- openshell --version
232236
```
@@ -241,7 +245,7 @@ gateway. On each failure it prints snapd and gateway journals.
241245

242246
```shell
243247
nix run .#test-guest -- \
244-
--distro ubuntu \
248+
--distro ubuntu-24-04 \
245249
--with snapd \
246250
--keep \
247251
--copy ./openshell_*.snap:/tmp/openshell.snap \
@@ -259,7 +263,7 @@ The destination must be an absolute guest path. Copied files are installed with
259263
## Runner options
260264

261265
```text
262-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
266+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
263267
--with NAME Apply docker, podman, or selinux; repeatable
264268
--install PATH Install a .deb or .rpm package; repeatable
265269
--copy SRC:DEST Copy a regular file into the guest, preserving its host mode;

‎nix/test-guest/cache.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Usage:
1212
nix run .#test-guest-cache -- --distro DISTRO [OPTIONS]
1313
1414
Options:
15-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
16-
--with NAME Apply a configuration; repeatable (docker, podman, selinux)
15+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
16+
--with NAME Apply a configuration; repeatable (docker, podman, podman-rootless, selinux)
1717
--repository REF OCI repository without a tag
1818
--digest DIGEST Trusted OCI manifest digest required for pulls
1919
--cache-dir PATH Override the local prepared-disk cache directory
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# PROTOTYPE: Configure rootless Podman in a disposable test guest.
6+
7+
- name: Configure rootless Podman
8+
hosts: test_vm
9+
become: true
10+
gather_facts: true
11+
12+
tasks:
13+
- name: Validate rootless Podman support
14+
ansible.builtin.assert:
15+
that:
16+
- ansible_facts.distribution == "Ubuntu"
17+
- ansible_facts.distribution_version is version("26.04", ">=")
18+
fail_msg: >-
19+
Rootless Podman requires Ubuntu 26.04 or newer, not
20+
{{ ansible_facts.distribution }} {{ ansible_facts.distribution_version }}.
21+
22+
- name: Refresh Ubuntu package metadata
23+
ansible.builtin.apt:
24+
update_cache: true
25+
26+
- name: Install Ubuntu rootless Podman
27+
ansible.builtin.apt:
28+
name:
29+
- apparmor
30+
- fuse-overlayfs
31+
- passt
32+
- podman
33+
- uidmap
34+
state: present
35+
36+
- name: Allow pasta to receive Podman stop signals
37+
ansible.builtin.lineinfile:
38+
path: /etc/apparmor.d/usr.bin.pasta
39+
insertafter: "^ include <abstractions/pasta>$"
40+
line: " signal (receive) peer=podman,"
41+
state: present
42+
register: pasta_apparmor_profile
43+
44+
- name: Reload pasta AppArmor profile
45+
ansible.builtin.command:
46+
argv:
47+
- apparmor_parser
48+
- --replace
49+
- /etc/apparmor.d/usr.bin.pasta
50+
when: pasta_apparmor_profile.changed
51+
changed_when: pasta_apparmor_profile.changed
52+
53+
- name: Enable the rootless Podman API socket
54+
ansible.builtin.systemd_service:
55+
name: podman.socket
56+
scope: user
57+
enabled: true
58+
state: started
59+
become: false
60+
61+
- name: Verify rootless Podman
62+
ansible.builtin.command:
63+
cmd: podman info
64+
become: false
65+
changed_when: false
66+
67+
- name: Verify rootless Podman mode
68+
ansible.builtin.command:
69+
argv:
70+
- podman
71+
- info
72+
- --format
73+
- "{% raw %}{{.Host.Security.Rootless}}{% endraw %}"
74+
become: false
75+
changed_when: false
76+
register: podman_rootless
77+
failed_when: podman_rootless.stdout != "true"
78+
79+
- name: Verify rootless Podman uses pasta
80+
ansible.builtin.command:
81+
argv:
82+
- podman
83+
- info
84+
- --format
85+
- "{% raw %}{{.Host.RootlessNetworkCmd}}{% endraw %}"
86+
become: false
87+
changed_when: false
88+
register: podman_rootless_network
89+
failed_when: podman_rootless_network.stdout != "pasta"

‎nix/test-guest/default.nix‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ let
1818
if isAarch64 then "${qemu}/bin/qemu-system-aarch64" else "${qemu}/bin/qemu-system-x86_64";
1919

2020
distros = {
21-
ubuntu = import ./distros/ubuntu.nix { inherit pkgs architecture; };
21+
ubuntu-24-04 = import ./distros/ubuntu-24-04.nix { inherit pkgs architecture; };
22+
ubuntu-26-04 = import ./distros/ubuntu-26-04.nix { inherit pkgs architecture; };
2223
centos = import ./distros/centos.nix { inherit pkgs architecture; };
2324
fedora = import ./distros/fedora.nix { inherit pkgs architecture; };
2425
rocky = import ./distros/rocky.nix { inherit pkgs architecture; };
@@ -27,6 +28,7 @@ let
2728
configurations = {
2829
docker = ./configuration/docker.yml;
2930
podman = ./configuration/podman.yml;
31+
podman-rootless = ./configuration/podman-rootless.yml;
3032
selinux = ./configuration/selinux.yml;
3133
snapd = ./configuration/snapd.yml;
3234
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{ pkgs, architecture }:
5+
6+
let
7+
imageArchitecture = if architecture == "aarch64" then "arm64" else "amd64";
8+
imageUrl = "https://cloud-images.ubuntu.com/releases/releases/26.04/release/ubuntu-26.04-server-cloudimg-${imageArchitecture}.img";
9+
imageHash =
10+
if architecture == "aarch64" then
11+
"sha256-PhE/3UHznhNyk3UXO7KueT+H3G20KU5SUf8kdpcXiLo="
12+
else
13+
"sha256-gZa+nXlYBZy1bGx1yA/fbO6KiIW8FJ6nkdfbHH75MDU=";
14+
in
15+
{
16+
osId = "ubuntu";
17+
osVersion = "26.04";
18+
packageFamily = "deb";
19+
inherit imageUrl imageHash;
20+
image = pkgs.fetchurl {
21+
name = "ubuntu-26.04-server-cloudimg-${imageArchitecture}.img";
22+
url = imageUrl;
23+
hash = imageHash;
24+
};
25+
}

‎nix/test-guest/run.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Usage:
1212
nix run .#test-guest -- --distro DISTRO [OPTIONS] [-- COMMAND...]
1313
1414
Options:
15-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
16-
--with NAME Apply a configuration; repeatable (docker, podman, selinux, snapd)
15+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
16+
--with NAME Apply a configuration; repeatable (docker, podman, podman-rootless, selinux, snapd)
1717
--install PATH Install a .deb or .rpm package; repeatable
1818
--copy SRC:DEST Copy a regular file to an absolute guest path, preserving
1919
its host mode; repeatable
@@ -49,7 +49,7 @@ preserved_file_mode() {
4949
local source_mode
5050

5151
if [ "$(uname -s)" = Darwin ]; then
52-
if ! source_mode=$(stat -f '%Lp' "${source_path}"); then
52+
if ! source_mode=$(/usr/bin/stat -f '%Lp' "${source_path}"); then
5353
echo "could not determine mode for --copy source: ${source_path}" >&2
5454
return 1
5555
fi

0 commit comments

Comments
 (0)