Files
50230616d5 refactor(runtime): retire Community image dependencies (#3386)
* feat(sandbox): default to official Alpine sandbox image

default_sandbox_image() now returns docker.io/library/alpine:3.22, a generic
version-qualified official image, so a fresh install no longer depends on the
community sandbox image catalog. All compute drivers (docker, podman,
kubernetes, vm) inherit this fallback.

Part of #3116.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>

* feat(deploy): default deployment configs to the official Alpine sandbox image

Update the shared gateway default_image, Helm chart values, the standalone
Kubernetes manifest, and the dev gateway task scripts to use
docker.io/library/alpine:3.22 instead of the community base image, consistent
with default_sandbox_image(). GPU e2e image-build base is left unchanged (CUDA
needs a glibc base).

Part of #3116.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>

* feat(driver): default to numeric non-root identity for USER-less images

With the default sandbox image now Alpine, images that declare no OCI USER
must start instead of being rejected. When the image declares no USER and
the policy requests none, the Podman and Docker drivers now supply a numeric
non-root identity (DEFAULT_SANDBOX_UID/GID = 1000) instead of rejecting,
matching the numeric-identity behavior of the Kubernetes and VM drivers. The
supervisor's resolved-identity path runs the sandbox as a synthesized
non-root account without the account existing in the image. Images that
declare a USER keep the OCI resolution path unchanged.

Part of #3116.

Signed-off-by: Akram <akram.benaissi@gmail.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>

* test(conformance): use Alpine workload image

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* refactor(policy): drop community image /app path from default policy

The restrictive default policy granted read-only access to /app, a directory
that only existed in the community base image. A generic Alpine default has no
/app, so remove it. Landlock best-effort already ignores absent paths; this
just stops advertising a community-specific layout in the default.

Part of #3116.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>

* docs(config): document Alpine default images

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): report early sandbox termination

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): initialize rootless workspace ownership

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(sandbox): qualify NVIDIA Ubuntu default

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(podman): initialize rootful default workspace

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* feat(sftp): add native sandbox adapter

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sftp): gate runtime helper support to Linux

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sftp): support standard OpenSSH file operations

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sftp): harden rename and special file handling

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* refactor(runtime): remove community image dependencies

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* test(e2e): build provider readiness tool fixture

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(e2e): use a dedicated Noble fixture for Docker tests

Signed-off-by: Evan Lezar <elezar@nvidia.com>

---------

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Co-authored-by: Evan Lezar <elezar@nvidia.com>
Co-authored-by: Drew Newberry <anewberry@nvidia.com>
2026-09-22 14:43:51 +02:00

127 lines
4.9 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Setup E2E Podman
description: Configure the supported rootless Podman environment for E2E tests
inputs:
mise-version:
description: mise release to install
required: false
default: v2026.9.9
podman-major:
description: Expected Podman major version
required: true
podman-package-version:
description: Exact Ubuntu Podman package version
required: true
conmon-package-version:
description: Exact Ubuntu conmon package version
required: true
runs:
using: composite
steps:
- uses: ./.github/actions/setup-mise
with:
version: ${{ inputs.mise-version }}
- name: Install Podman and build dependencies
shell: bash
run: | # zizmor: ignore[github-env] persists only literal and trusted runner-derived paths
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
apparmor \
build-essential \
fuse-overlayfs \
libssl-dev \
openssh-client \
passt \
pkg-config \
"conmon=${INPUTS_CONMON_PACKAGE_VERSION}" \
"podman=${INPUTS_PODMAN_PACKAGE_VERSION}" \
uidmap
# Hosted runners can place newer binaries under /usr/local. Select the
# distro CLI and use Podman's supported final conmon-path override.
podman_config="${RUNNER_TEMP}/openshell-containers.conf"
printf '%s\n' \
'[engine]' \
'conmon_path = ["/usr/bin/conmon"]' \
> "${podman_config}"
echo "/usr/bin" >> "${GITHUB_PATH}"
echo "CONTAINERS_CONF_OVERRIDE=${podman_config}" >> "${GITHUB_ENV}"
env:
INPUTS_CONMON_PACKAGE_VERSION: ${{ inputs.conmon-package-version }}
INPUTS_PODMAN_PACKAGE_VERSION: ${{ inputs.podman-package-version }}
- name: Allow pasta to receive Podman stop signals
shell: bash
run: |
set -euo pipefail
# Ubuntu's packaged profile blocks this signal and makes Podman wait
# for its SIGKILL fallback.
profile=/etc/apparmor.d/usr.bin.pasta
rule=' signal (receive) peer=podman,'
if ! sudo grep -Fqx "${rule}" "${profile}"; then
sudo sed -i '\|^ include <abstractions/pasta>$|a\ signal (receive) peer=podman,' "${profile}"
fi
sudo grep -Fqx "${rule}" "${profile}"
sudo apparmor_parser --replace "${profile}"
- name: Configure rootless Podman
shell: bash
run: | # zizmor: ignore[github-env] runtime path is derived solely from the runner UID
set -euo pipefail
if ! grep -q "^${USER}:" /etc/subuid; then
sudo usermod --add-subuids 100000-165535 "$USER"
fi
if ! grep -q "^${USER}:" /etc/subgid; then
sudo usermod --add-subgids 100000-165535 "$USER"
fi
runtime_dir="/run/user/$(id -u)"
sudo install -d -m 0700 -o "$(id -u)" -g "$(id -g)" "$runtime_dir"
echo "XDG_RUNTIME_DIR=$runtime_dir" >> "$GITHUB_ENV"
- name: Verify rootless Podman environment
shell: bash
run: |
set -euo pipefail
podman_version="$(podman version --format '{{.Client.Version}}')"
case "$podman_version" in
"${INPUTS_PODMAN_MAJOR}".*) ;;
*) echo "ERROR: expected Podman ${INPUTS_PODMAN_MAJOR}.x, found $podman_version" >&2; exit 1 ;;
esac
test "$(dpkg-query -W -f='${Version}' podman)" = "${INPUTS_PODMAN_PACKAGE_VERSION}"
test "$(dpkg-query -W -f='${Version}' conmon)" = "${INPUTS_CONMON_PACKAGE_VERSION}"
test "$(command -v podman)" = "/usr/bin/podman"
test "$(podman info --format '{{.Host.Conmon.Path}}')" = "/usr/bin/conmon"
test "$(podman info --format '{{.Host.Security.Rootless}}')" = "true"
test "$(podman info --format '{{.Host.RootlessNetworkCmd}}')" = "pasta"
test "$(sudo sysctl -n kernel.apparmor_restrict_unprivileged_userns)" = "1"
echo "=== host ==="
uname -a
echo "=== AppArmor ==="
cat /proc/self/attr/current
sudo aa-status || true
echo "=== Podman ==="
podman version
podman info --debug
env:
INPUTS_PODMAN_MAJOR: ${{ inputs.podman-major }}
INPUTS_PODMAN_PACKAGE_VERSION: ${{ inputs.podman-package-version }}
INPUTS_CONMON_PACKAGE_VERSION: ${{ inputs.conmon-package-version }}
- name: Probe rootless capability bounding set
shell: bash
run: |
set -euo pipefail
probe="$RUNNER_TEMP/openshell-capbset-probe"
cc -static -O2 -Wall -Wextra -Werror \
e2e/support/capbset-probe.c \
-o "$probe"
podman run --rm \
--cap-add=SETPCAP \
--volume "$probe:/openshell-capbset-probe:ro" \
nvcr.io/nvidia/base/ubuntu:24.04 \
/openshell-capbset-probe