Skip to content

Commit 107b72a

Browse files
authored
fix: Docker must redeclare args in multi-stage builds; fix path in docs (#916)
* Redeclare `ARG` after `FROM` stage to ensure visibility. * Fix path typo in documentation (should reference NeMo Agent toolkit rather than example) Closes nvbugs-5561420 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. ## Summary by CodeRabbit - New Features - Docker images now support configurable build-time versions for Python, UV, and NAT via build arguments. - UV binaries are bundled during build for faster, reproducible environments. - Build-time validation ensures NAT version is provided. - Chores - Standardized build-arg declarations across example Dockerfiles for consistency and easier parameterization. - Documentation - Updated example guides to reference the NeMo Agent toolkit repository. - Refreshed Docker build instructions to align with the new configurable build args. Authors: - Will Killian (https://github.com/willkill07) Approvers: - Eric Evans II (https://github.com/ericevans-nv) URL: #916
1 parent 4a7f2cf commit 107b72a

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed

docker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ARG NAT_VERSION
2222

2323
FROM --platform=$TARGETPLATFORM ${BASE_IMAGE_URL}:${BASE_IMAGE_TAG}
2424

25+
ARG PYTHON_VERSION
26+
ARG UV_VERSION
27+
ARG NAT_VERSION
28+
2529
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
2630

2731
ENV PYTHONDONTWRITEBYTECODE=1

examples/evaluation_and_profiling/email_phishing_analyzer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ARG NAT_VERSION
2222

2323
FROM ${BASE_IMAGE_URL}:${BASE_IMAGE_TAG}
2424

25+
ARG PYTHON_VERSION
26+
ARG UV_VERSION
27+
ARG NAT_VERSION
28+
2529
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
2630

2731
ENV PYTHONDONTWRITEBYTECODE=1

examples/evaluation_and_profiling/email_phishing_analyzer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ For a production deployment, use Docker:
225225

226226
Prior to building the Docker image ensure that you have followed the steps in the [Installation and Setup](#installation-and-setup) section, and you are currently in the NeMo Agent toolkit virtual environment.
227227

228-
From the root directory of the Simple Calculator repository, build the Docker image:
228+
From the root directory of the NeMo Agent toolkit repository, build the Docker image:
229229

230230
```bash
231231
docker build --build-arg NAT_VERSION=$(python -m setuptools_scm) -t email_phishing_analyzer -f examples/evaluation_and_profiling/email_phishing_analyzer/Dockerfile .

examples/frameworks/agno_personal_finance/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ARG NAT_VERSION
2222

2323
FROM ${BASE_IMAGE_URL}:${BASE_IMAGE_TAG}
2424

25+
ARG PYTHON_VERSION
26+
ARG UV_VERSION
27+
ARG NAT_VERSION
28+
2529
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
2630

2731
ENV PYTHONDONTWRITEBYTECODE=1

examples/getting_started/simple_calculator/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ARG NAT_VERSION
2222

2323
FROM ${BASE_IMAGE_URL}:${BASE_IMAGE_TAG}
2424

25+
ARG PYTHON_VERSION
26+
ARG UV_VERSION
27+
ARG NAT_VERSION
28+
2529
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
2630

2731
ENV PYTHONDONTWRITEBYTECODE=1

examples/getting_started/simple_calculator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ For a production deployment, use Docker:
8787

8888
Prior to building the Docker image ensure that you have followed the steps in the [Installation and Setup](#installation-and-setup) section, and you are currently in the NeMo Agent toolkit virtual environment.
8989

90-
From the root directory of the Simple Calculator repository, build the Docker image:
90+
From the root directory of the NeMo Agent toolkit repository, build the Docker image:
9191

9292
```bash
9393
docker build --build-arg NAT_VERSION=$(python -m setuptools_scm) -t simple_calculator -f examples/getting_started/simple_calculator/Dockerfile .

examples/getting_started/simple_web_query/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ARG NAT_VERSION
2222

2323
FROM ${BASE_IMAGE_URL}:${BASE_IMAGE_TAG}
2424

25+
ARG PYTHON_VERSION
26+
ARG UV_VERSION
27+
ARG NAT_VERSION
28+
2529
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/
2630

2731
ENV PYTHONDONTWRITEBYTECODE=1

0 commit comments

Comments
 (0)