Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions tools/check_missing_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ INCLUDE_PATTERNS=(
"*.hpp"
"*.cu"
"*.cpp"
"Dockerfile*"
)

# Directories to explicitly exclude
Expand Down
41 changes: 41 additions & 0 deletions workflows/robotic_surgery/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# syntax=docker/dockerfile:1.4

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM nvcr.io/nvidia/isaac-lab:2.0.2

# This line enables SSH access for the following RUN command
RUN apt-get update && apt-get install -y git openssh-client

# Add GitHub to known hosts to avoid "host key verification failed"
RUN mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts

WORKDIR /workspace/robotic_surgery/scripts

# Fix livestream public endpoint address issue in 2.0.2/2.1.0
RUN sed -i '/--\/app\/livestream\/publicEndpointAddress=/d' /workspace/isaaclab/source/isaaclab/isaaclab/app/app_launcher.py

COPY workflows/robotic_surgery/scripts .

ENV PYTHONPATH=/workspace/robotic_surgery/scripts

RUN --mount=type=ssh /workspace/isaaclab/_isaac_sim/python.sh -m pip install --no-deps git+ssh://[email protected]/isaac-for-healthcare/[email protected]

RUN /workspace/isaaclab/_isaac_sim/python.sh -m pip install toml

RUN /workspace/isaaclab/_isaac_sim/python.sh -m pip install --no-build-isolation -e /workspace/robotic_surgery/scripts/simulation/exts/robotic.surgery.assets

RUN /workspace/isaaclab/_isaac_sim/python.sh -m pip install --no-build-isolation -e /workspace/robotic_surgery/scripts/simulation/exts/robotic.surgery.tasks
56 changes: 56 additions & 0 deletions workflows/robotic_surgery/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Simulation LiveStream from Remote Docker Container

This document describes how to run the simulation in a remote docker container and stream the simulation to a local machine.

## Prerequisites

Please refer to [Livestream Clients Guide in Isaac Sim](https://docs.isaacsim.omniverse.nvidia.com/latest/installation/manual_livestream_clients.html#isaac-sim-short-webrtc-streaming-client) and download [Isaac Sim WebRTC Streamiing Client](https://docs.isaacsim.omniverse.nvidia.com/latest/installation/download.html#isaac-sim-latest-release)

## Build Docker Image

To build the docker image, you will need to set up the SSH agent and add your SSH key to the agent, so that the docker build process can access the private repository.

```bash
export DOCKER_BUILDKIT=1
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519 # Replace with your SSH key
docker build --ssh default -f workflows/robotic_surgery/docker/Dockerfile -t robotic_surgery:latest .
```

## Prepare the I4H Asset Locally

Please refer to the [Environment Setup](../README.md#environment-setup) for instructions to prepare the I4H assets locally.

This will create a directory `~/.cache/i4h-assets/<sha256>` containing the I4H assets, which will be mounted to the docker container.

## Run the Container

```bash
docker run --name isaac-sim --entrypoint bash -it --runtime=nvidia --gpus all -e "ACCEPT_EULA=Y" --rm --network=host \
-e "PRIVACY_CONSENT=Y" \
-v ~/docker/isaac-sim/cache/kit:/isaac-sim/kit/cache:rw \
-v ~/docker/isaac-sim/cache/ov:/root/.cache/ov:rw \
-v ~/docker/isaac-sim/cache/pip:/root/.cache/pip:rw \
-v ~/docker/isaac-sim/cache/glcache:/root/.cache/nvidia/GLCache:rw \
-v ~/docker/isaac-sim/cache/computecache:/root/.nv/ComputeCache:rw \
-v ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw \
-v ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw \
-v ~/docker/isaac-sim/documents:/root/Documents:rw \
-v ~/.cache/i4h-assets:/root/.cache/i4h-assets:rw \
robotic_surgery:latest
```

### Run the Simulation

In the container, run the simulation with `--livestream 2` to stream the simulation to the local machine. For example, to run the `reach_psm_sm.py` script, run the following command:

```bash
python simulation/scripts/environments/state_machine/reach_psm_sm.py --livestream 2
```

Please refer to the [simulation README](../scripts/simulation/README.md) for other examples.


### Open the WebRTC Client

Wait for the simulation to start (you should see the message "Resetting the state machine" when the simulation is ready), and open the WebRTC client to view the simulation.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(headless=args_cli.headless)
app_launcher = AppLauncher(headless=args_cli.headless, livestream=args_cli.livestream)
simulation_app = app_launcher.app

"""Rest everything else."""
Expand Down
Loading