containers / ai-lab-recipes

Examples for building and running LLM services and applications locally with Podman
Apache License 2.0
103 stars 106 forks source link

ilab-wrapper: don't map UIDs if we're already running as root #729

Closed omertuc closed 1 month ago

omertuc commented 1 month ago

Background

See df8885777d2257a6271ca1a6461673d1d96e99d6

Issue

Introduced a regression [1] where it's no longer possible to run the script as root, as the subuid map ends up being empty and this causes an error:

Error: invalid empty host id at UID map: [1  1]

Solution

Avoid UID mapping if we're already running as root.

Motivation

We want to also be able to run the script as root, for example as part of a systemd service.

[1] RHELAI-798

omertuc commented 1 month ago

cc @eranco74

omertuc commented 1 month ago

Force push reason: DCO

rhatdan commented 1 month ago

LGTM

omertuc commented 1 month ago

Forgot to update duplicated wrapper, followup (& additional fixes) here: https://github.com/containers/ai-lab-recipes/pull/730