Skip to content

UV has no cache dir if init container runs as non-1000 UID #1308

@dan-fernandes

Description

@dan-fernandes

The init container uses UV to obtain python dependencies. This will cause UV to set up a cache dir, which defaults to this hierarchy:

  1. A temporary cache directory, if --no-cache was requested.
  2. The specific cache directory specified via --cache-dir, UV_CACHE_DIR, or tool.uv.cache-dir.
  3. A system-appropriate cache directory, e.g., $XDG_CACHE_HOME/uv or $HOME/.cache/uv on Unix and %LOCALAPPDATA%\uv\cache on Windows

With the current setup this defaults to $HOME/.cache/uv which if running as user 1000 resolves to /home/ubuntu/.cache/uv. If running as any other UID (e.g. 37889 for p49detector) the $HOME envar will not exist and UV will fail.

Acceptance Criteria

  • When a UID other than 1000 is used, the init container can successfully install all scratch dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions