Skip to content

Adjust location that uv creates venv#1982

Open
jdye64 wants to merge 5 commits intoNVIDIA:mainfrom
jdye64:dockerfile-tweaks
Open

Adjust location that uv creates venv#1982
jdye64 wants to merge 5 commits intoNVIDIA:mainfrom
jdye64:dockerfile-tweaks

Conversation

@jdye64
Copy link
Copy Markdown
Collaborator

@jdye64 jdye64 commented May 6, 2026

Description

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • If adjusting docker-compose.yaml environment variables have you ensured those are mimicked in the Helm values.yaml file.

@jdye64 jdye64 requested review from a team as code owners May 6, 2026 15:03
@jdye64 jdye64 requested a review from jperez999 May 6, 2026 15:04
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR relocates uv and its managed Python installs from the root home directory (/root/.local) into /opt/uv, making the Docker image layout more predictable and avoiding any dependency on root-home paths for non-root service users. A one-liner warning log is also added to a previously silent except block in ingest.py that falls back to total_pages=1 when PDF page counting fails.

  • Dockerfile: UV_UNMANAGED_INSTALL=/opt/uv/bin directs the uv installer to /opt/uv/bin; UV_PYTHON_INSTALL_DIR=/opt/uv/python moves uv-managed Pythons out of root home; the PATH in both install and service stages is updated accordingly; the now-redundant chmod -R a+rX /root/.local is removed; the editable install adds [all] extras.
  • ingest.py: logger.warning(..., exc_info=True) replaces a fully silent fallback, giving operators visibility into PDF parsing failures without changing the fall-back behaviour.

Confidence Score: 5/5

Safe to merge — changes are narrowly scoped to uv install paths in the Dockerfile and a one-line logging improvement in the ingest router.

The Dockerfile changes redirect uv and its Python installs to /opt, which is world-readable by default, so the non-root nemo user in the service stage can still access the venv's Python interpreter. The redundant chmod -R a+rX /root/.local is correctly dropped. The ingest.py change only adds observability to a pre-existing silent fallback without altering any logic.

No files require special attention.

Important Files Changed

Filename Overview
Dockerfile Relocates uv and its Python installs from /root/.local to /opt/uv; updates PATH in install and service stages accordingly; adds [all] extras to the editable install; removes now-unnecessary chmod on /root/.local.
nemo_retriever/src/nemo_retriever/service/routers/ingest.py Adds a warning log (with exc_info=True) to the previously silent except block that falls back to total_pages=1 when PDF page counting fails.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["docker build"] --> B["FROM base"]
    B --> B1["curl install uv → /opt/uv/bin"]
    B1 --> B2["ENV PATH=/opt/uv/bin:$PATH\nENV UV_PYTHON_INSTALL_DIR=/opt/uv/python"]
    B2 --> B3["uv python install 3.12\nuv venv /opt/retriever_runtime"]
    B3 --> B4["pip install openai, cuda-toolkit"]
    B4 --> C["FROM base AS install"]
    C --> C1["ENV VIRTUAL_ENV=/opt/retriever_runtime\nENV PATH=/opt/retriever_runtime/bin:/opt/uv/bin:$PATH"]
    C1 --> C2["uv pip install -e './nemo_retriever[all]'"]
    C2 --> D["FROM install AS service"]
    D --> D1["groupadd nemo; useradd nemo"]
    D1 --> D2["chown nemo:nemo /workspace /etc/nemo-retriever\n/var/lib/nemo-retriever /opt/retriever_runtime"]
    D2 --> D3["USER nemo"]
    D3 --> D4["CMD retriever service start"]
Loading

Reviews (3): Last reviewed commit: "log warning if count fails" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants