transcriber service still runs as root (missed by #489 non-root hardening)

Open Beginner friendly
#492 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
docker, python

Research direction

Start with extern/transcriber.yaml and compare its transcriber service with the non-root vllm and reranker definitions described in the issue. Verify the transcriber uses the project-root Hugging Face cache and is covered by init-perms; done means it no longer writes under /root and matches the stack's non-root configuration.

Written by the indexing model from the issue text.

Description

severity:medium

Follow-up to #489 (Run OpenRAG as non-root (OpenShift compatible)).

The non-root hardening was applied to vllm (root compose), reranker (extern/reranker/infinity.yaml), etcd, minio, milvus, rdb, and openrag — but the transcriber service in extern/transcriber.yaml (included via ${TRANSCRIBER_COMPOSE}) was missed. It still runs as root and writes under /root.

Current state vs. its siblings
user: non-root HOME/HF_HOME/USER/LOGNAME cache mount depends_on: init-perms
vllm (root compose) ./.cache/huggingface/cache
reranker (extern/reranker/) ../../.cache/huggingface/cache
transcriber (extern/) /root/.cache/huggingface/root/.cache/huggingface
Impact
  • When the transcriber is enabled (TRANSCRIBER_COMPOSE=extern/transcriber.yaml), it runs as root while the rest of the stack runs non-root — defeating the "whole stack non-root" goal of #489.
  • It writes to /root/.cache/huggingface, so under OpenShift's restricted SCC (arbitrary UID, no write access to /root) the transcriber would fail to start.
  • Its cache bind-mount is never pre-chowned (depends_on: init-perms missing), and it doesn't share the project-root HF cache that vllm/reranker now use.
  • It's a vLLM-based image (Whisper), so it has the same getpass.getuser() crash the PR added USER/LOGNAME to vllm for.
Proposed fix (mirrors vllm)

Note the include-relative path: extern/transcriber.yaml lives in extern/, so the project-root cache is ../.cache/huggingface (vllm uses ./, reranker ../../).

services:
  transcriber:
    # Run unprivileged with a non-root user, matching the rest of the stack.
    user: "${PUID:-1000}:${PGID:-1000}"
    build:
      context: .
      dockerfile: ./vllm/Dockerfile.transcriber
    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    environment:
      - HUGGING_FACE_HUB_TOKEN
      - VLLM_MAX_AUDIO_CLIP_FILESIZE_MB=10000
      # Run unprivileged: point HOME and the HF cache at the writable mounted
      # volume so vllm never needs to write under root-owned /root.
      - HOME=/cache
      - HF_HOME=/cache/huggingface
      # vllm calls getpass.getuser(); set USER/LOGNAME so it resolves without
      # an /etc/passwd entry for the running UID.
      - USER=openrag
      - LOGNAME=openrag
    ipc: "host"
    volumes:
      # This file is `include`d, so a relative default resolves relative to
      # extern/. ../ points back at the project root so the cache matches
      # vllm's and the dir init-perms chowns.
      - ${VLLM_CACHE:-../.cache/huggingface}:/cache # HF + framework caches (HOME=/cache)
    depends_on:
      init-perms:
        condition: service_completed_successfully
    command: >
      --model ${TRANSCRIBER_MODEL:-openai/whisper-large-v3-turbo}
      --trust-remote-code
      --gpu_memory_utilization 0.2
    # ports:
    #   - ${TRANSCRIBER_PORT:-8002}:8000

cc @EnjoyBacon7

Dominant language
Python
Stars
248
Forks
57
Avg merge
2d 15h
Merged PRs (30d)
71

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linagora/openrag

All issues in linagora/openrag

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.