Skip to content

Enhance Docker workflow with unified mount system and improved cluster operations #56

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
docker/artifacts/
*.tmp

# Docker user-specific files
docker/.env.ext_template
docker/.env.ext_template-dev
docker/.mount.config
docker/docker-compose.override.yaml
docker/.container.cfg

# Isaac-Sim packman
_isaac_sim*
_repo
Expand Down
8 changes: 0 additions & 8 deletions docker/.env.base

This file was deleted.

42 changes: 42 additions & 0 deletions docker/.env.ext_template-dev.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# =========================
# Extension Configuration
# =========================
EXTENSION_NAME=ext_template
EXTENSION_FOLDER=/path/to/your/project/folder
EXT_PATH=$EXTENSION_FOLDER/$EXTENSION_NAME
DOCKER_EXT_PATH=/workspace/$EXTENSION_NAME

# =========================
# Docker User Configuration
# =========================
HOST_HOME=/home/your_username
DOCKER_USER_NAME=your_username
DOCKER_USER_HOME=/home/your_username

# =========================
# Isaac Sim Configuration
# =========================
DOCKER_ISAACSIM_ROOT_PATH=/isaac-sim

# =========================
# Built-in IsaacLab Configuration
# =========================
# The built-in IsaacLab is always at /workspace/isaaclab
DOCKER_ISAACLAB_PATH=/workspace/isaaclab

# =========================
# External Codebase Mounting
# =========================
# External mounts are now configured via the unified mount system.
# Run './container.sh mount-setup' to configure optional mounts for IsaacLab and RSL-RL.

# =========================
# NVIDIA Configuration
# =========================
ACCEPT_EULA=Y

# =========================
# WANDB Configuration (Optional)
# =========================
# WANDB_API_KEY=your_wandb_api_key
# WANDB_USERNAME=your_wandb_username
40 changes: 40 additions & 0 deletions docker/.env.ext_template.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# =========================
# Extension Configuration
# =========================
EXTENSION_NAME=ext_template
EXT_PATH=/path/to/your/extension
DOCKER_EXT_PATH=/workspace/$EXTENSION_NAME

# =========================
# Docker User Configuration
# =========================
DOCKER_USER_NAME=root
DOCKER_USER_HOME=/root

# =========================
# Isaac Sim Configuration
# =========================
DOCKER_ISAACSIM_ROOT_PATH=/isaac-sim

# =========================
# Built-in IsaacLab Configuration
# =========================
# The built-in IsaacLab is always at /workspace/isaaclab
DOCKER_ISAACLAB_PATH=/workspace/isaaclab

# =========================
# External Codebase Mounting
# =========================
# External mounts are now configured via the unified mount system.
# Run './container.sh mount-setup' to configure optional mounts for IsaacLab and RSL-RL.

# =========================
# NVIDIA Configuration
# =========================
ACCEPT_EULA=Y

# =========================
# WANDB Configuration (Optional)
# =========================
# WANDB_API_KEY=your_wandb_api_key
# WANDB_USERNAME=your_wandb_username
22 changes: 22 additions & 0 deletions docker/.mount.config.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"mounts": {
"isaaclab": {
"enabled": false,
"local_path": "/path/to/your/isaaclab",
"cluster_path": "",
"container_path": "/workspace/isaaclab",
"mount_type": "source",
"sync_to_cluster": true,
"description": "External IsaacLab installation (mounts only source/ subdirectory to preserve container's Python environment)"
},
"rsl_rl": {
"enabled": false,
"local_path": "/path/to/your/rsl_rl",
"cluster_path": "",
"container_path": "/workspace/isaaclab/_isaac_sim/kit/python/lib/python3.10/site-packages/rsl_rl",
"mount_type": "full",
"sync_to_cluster": true,
"description": "External RSL-RL installation (completely overrides built-in version)"
}
}
}
21 changes: 0 additions & 21 deletions docker/Dockerfile

This file was deleted.

63 changes: 63 additions & 0 deletions docker/Dockerfile.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# we use the basic isaaclab image as the base
FROM isaac-lab-base AS base

# Declare build arguments
ARG EXTENSION_NAME_ARG
ARG DOCKER_EXT_PATH_ARG
ARG DOCKER_USER_NAME_ARG
ARG DOCKER_USER_HOME_ARG

# Set environment variables
ENV EXTENSION_NAME=${EXTENSION_NAME_ARG}
ENV DOCKER_EXT_PATH=${DOCKER_EXT_PATH_ARG}
ENV DOCKER_USER_NAME=${DOCKER_USER_NAME_ARG}
ENV DOCKER_USER_HOME=${DOCKER_USER_HOME_ARG}

# Set the home directory for the user
ENV HOME=${DOCKER_USER_HOME}

# Create necessary directories for the extension with proper permissions
RUN mkdir -p ${DOCKER_EXT_PATH}/data && \
mkdir -p ${DOCKER_EXT_PATH}/logs && \
chmod -R 777 ${DOCKER_EXT_PATH}


# Copy the entire extension directory
COPY --chown=root:root . ${DOCKER_EXT_PATH}

# Install required build dependencies
RUN --mount=type=cache,target=/root/.cache/pip \
/workspace/isaaclab/isaaclab.sh -p -m pip install toml setuptools wheel build

# Install extension with explicit setup dependencies
RUN --mount=type=cache,target=/root/.cache/pip \
cd ${DOCKER_EXT_PATH} && \
/workspace/isaaclab/isaaclab.sh -p -m pip install -e source/${EXTENSION_NAME} --no-build-isolation



# (Do not remove the DOCKER_EXT_PATH folder; keep it for the bind mount)

# Minimal system packages for container functionality
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gosu && \
rm -rf /var/lib/apt/lists/*

#==
# Environment
#==
COPY docker/bashrc /home/bash.bashrc
RUN chmod a+rwx /home/bash.bashrc
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Set up Python alias
RUN echo "alias python3='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /home/bash.bashrc && \
echo "alias python='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /home/bash.bashrc

# Set working directory
WORKDIR ${DOCKER_USER_HOME}

# Set the entry point
ENTRYPOINT ["/entrypoint.sh"]
123 changes: 123 additions & 0 deletions docker/Dockerfile.ext-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Unified Development Container with ROS2 and Dual-Mode Support
# Supports both root and rootless operation modes
FROM isaac-lab-ros2 AS base

# =========================
# Build Arguments and ENV
# =========================
ARG EXTENSION_NAME_ARG
ARG EXT_PATH_ARG
ARG DOCKER_EXT_PATH_ARG
ARG DOCKER_USER_NAME_ARG
ARG DOCKER_USER_HOME_ARG

ENV EXT_PATH=${EXT_PATH_ARG} \
EXTENSION_NAME=${EXTENSION_NAME_ARG} \
DOCKER_EXT_PATH=${DOCKER_EXT_PATH_ARG} \
DOCKER_USER_NAME=${DOCKER_USER_NAME_ARG} \
DOCKER_USER_HOME=${DOCKER_USER_HOME_ARG} \
HOME=${DOCKER_USER_HOME}

# =========================
# Create User (for root mode)
# =========================
RUN useradd -d ${DOCKER_USER_HOME} -s /bin/bash ${DOCKER_USER_NAME} || true

# =========================
# Install Minimal System Dependencies
# =========================
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gosu \
git \
git-lfs \
curl \
python3-colcon-common-extensions && \
rm -rf /var/lib/apt/lists/*

# =========================
# Configure Git LFS
# =========================
RUN git lfs install

# =========================
# Install Colcon Mixin
# =========================
RUN colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
colcon mixin update default

# =========================
# Install Minimal Python Dependencies
# =========================
# Users should add their own dependencies as needed

# =========================
# Install Basic Development Tools
# =========================
RUN ${ISAACLAB_PATH}/_isaac_sim/python.sh -m pip install --no-cache-dir \
pytest \
ruff


# =========================
# ROS2 Core Packages Only
# =========================
# Users should install additional ROS2 packages as needed
# Example: apt-get install ros-humble-xacro ros-humble-tf2

# =========================
# Setup Extension Directories
# =========================
RUN mkdir -p ${DOCKER_EXT_PATH}/data ${DOCKER_EXT_PATH}/logs && \
chmod -R 777 ${DOCKER_EXT_PATH}

# =========================
# Copy and Install Extension
# =========================
COPY --chown=root:root source/${EXTENSION_NAME} ${DOCKER_EXT_PATH}/source/${EXTENSION_NAME}
RUN --mount=type=cache,target=/root/.cache/pip \
cd ${DOCKER_EXT_PATH} && \
${ISAACLAB_PATH}/isaaclab.sh -p -m pip install -e source/${EXTENSION_NAME}

# =========================
# Clean Up Extension Directory
# =========================
RUN rm -rf ${DOCKER_EXT_PATH}/source/${EXTENSION_NAME}



# =========================
# Set Ownership and Permissions
# =========================
# Make kit directory accessible to all users
RUN chmod -R 777 /isaac-sim/kit

# Create alternative home for rootless mode
RUN mkdir -p /root/project && chmod 777 /root/project

# =========================
# Environment Setup
# =========================
COPY docker/bashrc /home/bash.bashrc
RUN chmod a+rwx /home/bash.bashrc

# Copy bashrc also to root for rootless mode
RUN cp /home/bash.bashrc /root/.bashrc

# Dynamic entrypoint that handles both modes
COPY docker/dynamic_entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# =========================
# Set Up Python Aliases
# =========================
RUN echo "alias python3='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /home/bash.bashrc && \
echo "alias python='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /home/bash.bashrc && \
echo "alias python3='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /root/.bashrc && \
echo "alias python='${ISAACLAB_PATH}/isaaclab.sh -p'" >> /root/.bashrc

# =========================
# Final Configuration
# =========================
WORKDIR ${DOCKER_USER_HOME}
ENTRYPOINT ["/entrypoint.sh"]
Loading