-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add Newton-only Dockerfile for headless training without Isaac Sim #5150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,104 @@ | ||||||||||||||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||||||||||||||
| # All rights reserved. | ||||||||||||||
| # | ||||||||||||||
| # SPDX-License-Identifier: BSD-3-Clause | ||||||||||||||
|
|
||||||||||||||
| # Newton-only image for headless HPC training (no Omniverse/Isaac Sim). | ||||||||||||||
| # Designed for Singularity/Apptainer conversion on SLURM clusters. | ||||||||||||||
| # | ||||||||||||||
| # Build: | ||||||||||||||
| # docker build -t isaac-lab-newton -f docker/Dockerfile.newton . | ||||||||||||||
| # | ||||||||||||||
| # Run: | ||||||||||||||
| # docker run --rm --gpus all isaac-lab-newton \ | ||||||||||||||
| # python /workspace/isaaclab/scripts/reinforcement_learning/rsl_rl/train.py \ | ||||||||||||||
| # --task Isaac-Reach-Franka-v0 --num_envs 64 --headless \ | ||||||||||||||
| # env.sim.physics=newton --max_iterations 5 | ||||||||||||||
| # | ||||||||||||||
| # Singularity conversion: | ||||||||||||||
| # docker save isaac-lab-newton -o isaac-lab-newton.tar | ||||||||||||||
| # apptainer build isaac-lab-newton.sif docker-archive://isaac-lab-newton.tar | ||||||||||||||
|
|
||||||||||||||
| FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 | ||||||||||||||
|
|
||||||||||||||
| SHELL ["/bin/bash", "-c"] | ||||||||||||||
|
|
||||||||||||||
| LABEL description="Isaac Lab Newton-only image for headless HPC training (no Omniverse/Isaac Sim)." | ||||||||||||||
|
|
||||||||||||||
| ARG ISAACLAB_PATH_ARG=/workspace/isaaclab | ||||||||||||||
| ENV ISAACLAB_PATH=${ISAACLAB_PATH_ARG} | ||||||||||||||
|
|
||||||||||||||
| ENV LANG=C.UTF-8 | ||||||||||||||
| ENV DEBIAN_FRONTEND=noninteractive | ||||||||||||||
|
|
||||||||||||||
| # ---- System packages + Python 3.12 ---- | ||||||||||||||
| RUN apt-get update && \ | ||||||||||||||
| apt-get install -y --no-install-recommends software-properties-common && \ | ||||||||||||||
| add-apt-repository -y ppa:deadsnakes/ppa && \ | ||||||||||||||
| apt-get update && \ | ||||||||||||||
| apt-get install -y --no-install-recommends \ | ||||||||||||||
| python3.12 \ | ||||||||||||||
| python3.12-dev \ | ||||||||||||||
| python3.12-venv \ | ||||||||||||||
| build-essential \ | ||||||||||||||
| cmake \ | ||||||||||||||
| git \ | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Consider: For a headless training container, do you actually need |
||||||||||||||
| libglib2.0-0 \ | ||||||||||||||
| libgl1-mesa-glx \ | ||||||||||||||
| libusb-1.0-0 \ | ||||||||||||||
| ncurses-term \ | ||||||||||||||
| wget && \ | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Minor: |
||||||||||||||
| apt -y autoremove && apt clean autoclean && \ | ||||||||||||||
| rm -rf /var/lib/apt/lists/* | ||||||||||||||
|
Comment on lines
+51
to
+52
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Additionally,
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| # ---- Python virtual environment ---- | ||||||||||||||
| RUN python3.12 -m venv /opt/isaaclab-venv | ||||||||||||||
| ENV PATH="/opt/isaaclab-venv/bin:$PATH" | ||||||||||||||
|
Comment on lines
+54
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The venv is activated by prepending its
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel | ||||||||||||||
|
|
||||||||||||||
| # ---- Install PyTorch (CUDA 12.8) ---- | ||||||||||||||
| # Cached as a separate layer since it's ~2GB and rarely changes. | ||||||||||||||
| RUN pip install --no-cache-dir \ | ||||||||||||||
| torch==2.10.0+cu128 \ | ||||||||||||||
| torchvision==0.25.0+cu128 \ | ||||||||||||||
| --index-url https://download.pytorch.org/whl/cu128 | ||||||||||||||
|
|
||||||||||||||
| # ---- Copy Isaac Lab source tree ---- | ||||||||||||||
| COPY . ${ISAACLAB_PATH} | ||||||||||||||
| RUN chmod +x ${ISAACLAB_PATH}/isaaclab.sh | ||||||||||||||
|
Comment on lines
+68
to
+69
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All other Dockerfiles in this repo ( RUN find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} +If this image is built on Windows (Docker Desktop / WSL), The fix should be added between the |
||||||||||||||
|
|
||||||||||||||
| # ---- Install Isaac Lab packages via isaaclab.sh ---- | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Cache invalidation: This copies the entire repo in one shot. Suggested: COPY isaaclab.* environment.yml pyproject.toml ${ISAACLAB_PATH}/
COPY tools/ ${ISAACLAB_PATH}/tools/
COPY source/ ${ISAACLAB_PATH}/source/
RUN find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} +
RUN chmod +x ${ISAACLAB_PATH}/isaaclab.sh
RUN ${ISAACLAB_PATH}/isaaclab.sh -i
# Copy remaining files (scripts, docs, etc.)
COPY . ${ISAACLAB_PATH} |
||||||||||||||
| # This installs all extensions including Newton, RL frameworks, etc. | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Missing Windows line-ending fix: |
||||||||||||||
| RUN ${ISAACLAB_PATH}/isaaclab.sh -i | ||||||||||||||
|
Comment on lines
+68
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The other Dockerfiles ( # Stage 1: copy only files that drive the install (rarely change)
COPY isaaclab.* environment.yml pyproject.toml ${ISAACLAB_PATH}/
COPY tools/ ${ISAACLAB_PATH}/tools/
COPY source/ ${ISAACLAB_PATH}/source/
RUN find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} +
RUN chmod +x ${ISAACLAB_PATH}/isaaclab.sh
RUN ${ISAACLAB_PATH}/isaaclab.sh -i
# Stage 2: copy the rest (frequently changes, but cheap to redo)
COPY . ${ISAACLAB_PATH}This pattern ensures that iterating on scripts, tests, or documentation does not require re-downloading all Python dependencies. |
||||||||||||||
|
|
||||||||||||||
| # ---- Singularity/Apptainer compatibility ---- | ||||||||||||||
| RUN touch /bin/nvidia-smi && \ | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Missing pip cache mount: RUN --mount=type=cache,target=/root/.cache/pip ${ISAACLAB_PATH}/isaaclab.sh -iAlso, for consistency with |
||||||||||||||
| touch /bin/nvidia-debugdump && \ | ||||||||||||||
| touch /bin/nvidia-persistenced && \ | ||||||||||||||
| touch /bin/nvidia-cuda-mps-control && \ | ||||||||||||||
| touch /bin/nvidia-cuda-mps-server && \ | ||||||||||||||
| touch /etc/localtime && \ | ||||||||||||||
| mkdir -p /var/run/nvidia-persistenced && \ | ||||||||||||||
| touch /var/run/nvidia-persistenced/socket | ||||||||||||||
|
|
||||||||||||||
| RUN mkdir -p /root/.cache/pip && \ | ||||||||||||||
| mkdir -p /root/.cache/nvidia/GLCache && \ | ||||||||||||||
| mkdir -p /root/.nv/ComputeCache | ||||||||||||||
|
|
||||||||||||||
| # ---- Build-time verification ---- | ||||||||||||||
| RUN python -c "\ | ||||||||||||||
| import isaaclab; \ | ||||||||||||||
| import isaaclab_newton; \ | ||||||||||||||
| import newton; \ | ||||||||||||||
| import warp; \ | ||||||||||||||
| import torch; \ | ||||||||||||||
| print(f'torch {torch.__version__}, CUDA available: {torch.cuda.is_available()}'); \ | ||||||||||||||
| print('All Newton imports OK')" | ||||||||||||||
|
Comment on lines
+89
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This does not fail the build (since there's no assertion), but it will mislead users scanning build logs into thinking the CUDA setup is incorrect. Consider removing the CUDA availability check from the build-time verification, or adding a comment clarifying that |
||||||||||||||
|
|
||||||||||||||
| # ---- Shell convenience ---- | ||||||||||||||
| RUN echo "export ISAACLAB_PATH=${ISAACLAB_PATH}" >> /root/.bashrc && \ | ||||||||||||||
| echo "export PATH=/opt/isaaclab-venv/bin:\$PATH" >> /root/.bashrc && \ | ||||||||||||||
| echo "export TZ=$(date +%Z)" >> /root/.bashrc | ||||||||||||||
|
|
||||||||||||||
| WORKDIR ${ISAACLAB_PATH} | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Copyright year mismatch: All existing Dockerfiles on
developuse2022-2025. This file has2022-2026. This will likely fail the license/copyright CI check once approved. Please align with the repo convention.