|
| 1 | +# Alternative Dockerfile from the GR00T repo: https://github.com/NVIDIA/Isaac-GR00T/blob/main/Dockerfile |
| 2 | +# Optimized Dockerfile for Isaac-GR00T using UV package manager |
| 3 | +FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 |
| 4 | + |
| 5 | +# Build argument to control GR00T version (stable vs latest) |
| 6 | +ARG USE_STABLE=true |
| 7 | +ARG STABLE_COMMIT=db107f03d165060998df166292578f1d7fb3c79a |
| 8 | + |
| 9 | +# Setting the frontend to be non-interactive |
| 10 | +# This is to avoid any user input required during the installation of packages |
| 11 | +ENV DEBIAN_FRONTEND=noninteractive |
| 12 | + |
| 13 | +# System dependencies - consolidated for better layer caching |
| 14 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 15 | + # Core utilities |
| 16 | + wget curl ca-certificates unzip \ |
| 17 | + # Git and version control |
| 18 | + git git-lfs \ |
| 19 | + # Build essentials |
| 20 | + build-essential cmake \ |
| 21 | + # Media processing |
| 22 | + ffmpeg \ |
| 23 | + # OpenCV dependencies |
| 24 | + libopencv-dev libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev \ |
| 25 | + # Python development |
| 26 | + python3.10 python3.10-dev python3.10-distutils python3-pip \ |
| 27 | + # Utilities for debugging |
| 28 | + vim less htop \ |
| 29 | + && rm -rf /var/lib/apt/lists/* |
| 30 | + |
| 31 | +# Install AWS CLI v2 (official AWS method) |
| 32 | +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ |
| 33 | + unzip awscliv2.zip && \ |
| 34 | + ./aws/install && \ |
| 35 | + rm -rf awscliv2.zip aws && \ |
| 36 | + rm -rf /usr/local/aws-cli/v2/*/dist/awscli/examples |
| 37 | + |
| 38 | +# Set Python 3.10 as default |
| 39 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \ |
| 40 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 |
| 41 | + |
| 42 | +# Install UV package manager (much faster than pip/conda) |
| 43 | +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv |
| 44 | + |
| 45 | +# Configure UV to use system Python |
| 46 | +ENV UV_SYSTEM_PYTHON=1 |
| 47 | +ENV PYTHONPATH=/workspace |
| 48 | + |
| 49 | +# ============================================================================ |
| 50 | +# Clone Isaac-GR00T repository |
| 51 | +# This layer changes when using --latest |
| 52 | +# ============================================================================ |
| 53 | +RUN git clone https://github.com/NVIDIA/Isaac-GR00T.git /workspace && \ |
| 54 | + cd /workspace && \ |
| 55 | + if [ "${USE_STABLE}" = "true" ]; then \ |
| 56 | + echo "Using stable commit: ${STABLE_COMMIT} (default)"; \ |
| 57 | + git checkout ${STABLE_COMMIT}; \ |
| 58 | + else \ |
| 59 | + echo "Using latest version from main branch"; \ |
| 60 | + fi && \ |
| 61 | + echo "GR00T version info:" && \ |
| 62 | + git log -1 --format="%H %ai %s" |
| 63 | + |
| 64 | +# Set working directory |
| 65 | +WORKDIR /workspace |
| 66 | + |
| 67 | +# Upgrade pip and setuptools using UV |
| 68 | +RUN uv pip install --upgrade pip setuptools wheel |
| 69 | + |
| 70 | +# Install GR00T base dependencies using UV (faster resolution and installation) |
| 71 | +RUN uv pip install --no-cache -e .[base] |
| 72 | + |
| 73 | +# Install flash-attention separately (requires build isolation disabled) |
| 74 | +RUN pip install --no-build-isolation flash-attn==2.7.1.post4 |
| 75 | + |
| 76 | +# Install additional utilities |
| 77 | +RUN uv pip install --no-cache notebook gpustat wandb |
| 78 | + |
| 79 | +# Install HuggingFace CLI and additional dependencies if necessary |
| 80 | +# RUN pip install huggingface_hub[cli] datasets |
| 81 | + |
| 82 | +# Copy the workflow scripts |
| 83 | +COPY finetune_gr00t.py /workspace/scripts/ |
| 84 | +COPY run_finetune_workflow.sh /workspace/scripts/ |
| 85 | +RUN chmod +x /workspace/scripts/run_finetune_workflow.sh |
| 86 | + |
| 87 | +# Set environment variables with defaults |
| 88 | +ENV DATASET_LOCAL_DIR="/workspace/train" |
| 89 | +ENV OUTPUT_DIR="/workspace/checkpoints" |
| 90 | + |
| 91 | +# If there is issue with the latest version, use tested checkpoint as of 09 July 2025 by commenting out the following two lines |
| 92 | +# RUN hf download nvidia/GR00T-N1.5-3B --revision 869830fc749c35f34771aa5209f923ac57e4564e --local-dir ./GR00T-N1.5-3B |
| 93 | +# ENV BASE_MODEL_PATH="./GR00T-N1.5-3B" |
| 94 | + |
| 95 | +# Create directories using environment variables |
| 96 | +RUN mkdir -p ${DATASET_LOCAL_DIR} ${OUTPUT_DIR} |
| 97 | + |
| 98 | +# Setting the Entrypoint and Command to /bin/bash whenever executed |
| 99 | +ENTRYPOINT ["/bin/bash"] |
| 100 | +# Default command to run the workflow, but can be overridden |
| 101 | +CMD ["/workspace/scripts/run_finetune_workflow.sh"] |
| 102 | +# CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] |
0 commit comments