From 3d4f05de5676d244220702b6196a2c8942d2b9c5 Mon Sep 17 00:00:00 2001 From: rtmadduri Date: Mon, 2 Nov 2026 13:21:33 -0600 Subject: [PATCH] Run ROCm images as root; suppress Trivy AVD-DS-0002 Revert the non-root user changes to docker/rocm/Dockerfile so existing docker run commands keep working, and add a time-limited AVD-DS-0002 suppression to the template's .github/scan_tools_configs/.trivyignore. Co-authored-by: Cursor --- .github/scan_tools_configs/.trivyignore | 4 ++++ docker/rocm/Dockerfile | 24 ++++-------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/scan_tools_configs/.trivyignore b/.github/scan_tools_configs/.trivyignore index 26da6acf4d8..a2a2f63147e 100644 --- a/.github/scan_tools_configs/.trivyignore +++ b/.github/scan_tools_configs/.trivyignore @@ -17,3 +17,7 @@ # This file sits beside the configured trivy.yml, so the scan uses it. # A .trivyignore at the repository root applies only when this file is # absent; the two are never merged. + +# The ROCm images run as root so the container can open the host GPU devices +# (/dev/kfd, /dev/dri) with the standard docker run flags. +AVD-DS-0002 exp:2027-05-01 diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index d41ffb8b5b2..c573869f4da 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -4,11 +4,6 @@ # library and install it in editable mode, so the build context must be the # repo root. Build locally (from the repo root) with: # docker build --network=host -f docker/rocm/Dockerfile --target warp_gfx942 -t . -# -# Both targets run as the unprivileged `warp` user. GPU access needs the host's -# GPU device groups, e.g.: -# docker run --device=/dev/kfd --device=/dev/dri \ -# --group-add video --group-add render ARG ROCM_VERSION=7.2 ARG UBUNTU_VERSION=24.04 @@ -47,17 +42,12 @@ RUN pip install --break-system-packages \ ARG HIP_ARCH=gfx942 -RUN (getent group render || groupadd --system render) \ - && useradd --create-home --shell /bin/bash --groups video,render warp - -COPY --chown=warp:warp . /workspace/warp +COPY . /workspace/warp WORKDIR /workspace/warp RUN ROCM_PATH=/opt/rocm python build_lib.py --hip-arch=${HIP_ARCH} --hipcc-options="-Xarch_device -fno-inline" && \ - pip install -e . --break-system-packages && \ - find /workspace/warp ! -user warp -exec chown warp:warp {} + + pip install -e . --break-system-packages -USER warp # ROCm 10.1.0 / gfx950 image for the Mujoco Warp workload. @@ -121,14 +111,8 @@ RUN ln -sf /usr/bin/python3 /usr/local/bin/python ARG HIP_ARCH=gfx950 -RUN (getent group render || groupadd --system render) \ - && useradd --create-home --shell /bin/bash --groups video,render warp - -COPY --chown=warp:warp . /workspace/warp +COPY . /workspace/warp WORKDIR /workspace/warp RUN ROCM_PATH=/opt/rocm python build_lib.py --hip-arch=${HIP_ARCH} --hipcc-options="-Xarch_device -fno-inline" && \ - pip install -e . --break-system-packages && \ - find /workspace/warp ! -user warp -exec chown warp:warp {} + - -USER warp + pip install -e . --break-system-packages