Commit 1c88446c authored by jaczhangnv's avatar jaczhangnv Committed by Kelly Guo

Enables CloudXR OpenXR runtime container (#274)

# Description

This MR enables to run CloudXR OpenXR Runtime Container for Isaac Lab.
The main changes are:
- Added docker files to support run CloudXR OpenXR runtime container
with isaacLab container. To start both containers:
```
python docker/container.py start \
    --files docker-compose.runtime.patch.yaml \
    --env-file .env.runtime
```

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- New feature (non-breaking change which adds functionality)


## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Co-authored-by: 's avatarYanzi Zhu <yanziz@nvidia.com>
parent 7da1a99e
...@@ -60,3 +60,6 @@ _build ...@@ -60,3 +60,6 @@ _build
# Pre-Trained Checkpoints # Pre-Trained Checkpoints
/.pretrained_checkpoints/ /.pretrained_checkpoints/
# Teleop Recorded Dataset
datasets
###
# General settings
###
# Accept the NVIDIA Omniverse EULA by default
ACCEPT_EULA=Y
# NVIDIA CloudXR Runtime base image
CLOUDXR_RUNTIME_BASE_IMAGE_ARG=nvcr.io/nvidia/cloudxr-runtime
# NVIDIA CloudXR Runtime version to use (e.g. 0.1.0-isaac)
CLOUDXR_RUNTIME_VERSION_ARG=0.1.0-isaac
services:
cloudxr-runtime:
image: ${CLOUDXR_RUNTIME_BASE_IMAGE_ARG}:${CLOUDXR_RUNTIME_VERSION_ARG}
runtime: nvidia
ports:
- "48010:48010/tcp" # signaling
- "47998:47998/udp" # media
- "47999:47999/udp" # media
- "48000:48000/udp" # media
- "48005:48005/udp" # media
- "48008:48008/udp" # media
- "48012:48012/udp" # media
healthcheck:
test: ["CMD", "test", "-S", "/openxr/run/ipc_cloudxr"]
interval: 1s
timeout: 1s
retries: 10
start_period: 5s
environment:
- ACCEPT_EULA=${ACCEPT_EULA}
- NV_PACER_FIXED_TIME_STEP_MS=32
volumes:
- openxr-volume:/openxr:rw
isaac-lab-base:
runtime: nvidia
environment:
- XDG_RUNTIME_DIR=/openxr/run
- XR_RUNTIME_JSON=/openxr/share/openxr/1/openxr_cloudxr.json
volumes:
- openxr-volume:/openxr:rw
depends_on:
- cloudxr-runtime
volumes:
openxr-volume:
...@@ -158,7 +158,7 @@ class ContainerInterface: ...@@ -158,7 +158,7 @@ class ContainerInterface:
if self.is_container_running(): if self.is_container_running():
print(f"[INFO] Stopping the launched docker container '{self.container_name}'...\n") print(f"[INFO] Stopping the launched docker container '{self.container_name}'...\n")
subprocess.run( subprocess.run(
["docker", "compose"] + self.add_yamls + self.add_profiles + self.add_env_files + ["down"], ["docker", "compose"] + self.add_yamls + self.add_profiles + self.add_env_files + ["down", "--volumes"],
check=False, check=False,
cwd=self.context_dir, cwd=self.context_dir,
env=self.environ, env=self.environ,
......
...@@ -50,6 +50,9 @@ needed to run Isaac Lab inside a Docker container. A subset of these are summari ...@@ -50,6 +50,9 @@ needed to run Isaac Lab inside a Docker container. A subset of these are summari
store frequently re-used resources compiled by Isaac Sim, such as shaders, and to retain logs, data, and documents. store frequently re-used resources compiled by Isaac Sim, such as shaders, and to retain logs, data, and documents.
* **.env.base**: Stores environment variables required for the ``base`` build process and the container itself. ``.env`` * **.env.base**: Stores environment variables required for the ``base`` build process and the container itself. ``.env``
files which end with something else (i.e. ``.env.ros2``) define these for `image extension <#isaac-lab-image-extensions>`_. files which end with something else (i.e. ``.env.ros2``) define these for `image extension <#isaac-lab-image-extensions>`_.
* **docker-compose.cloudxr-runtime.patch.yaml**: A patch file that is applied to enable CloudXR Runtime support for
streaming to compatible XR devices. It defines services and volumes for CloudXR Runtime and the base.
* **.env.cloudxr-runtime**: Environment variables for the CloudXR Runtime support.
* **container.py**: A utility script that interfaces with tools in ``utils`` to configure and build the image, * **container.py**: A utility script that interfaces with tools in ``utils`` to configure and build the image,
and run and interact with the container. and run and interact with the container.
...@@ -114,6 +117,23 @@ directories to the ``docker/artifacts`` directory. This is useful for copying th ...@@ -114,6 +117,23 @@ directories to the ``docker/artifacts`` directory. This is useful for copying th
./docker/container.py stop ./docker/container.py stop
CloudXR Runtime Support
~~~~~~~~~~~~~~~~~~~~~~~
To enable CloudXR Runtime for streaming to compatible XR devices, you need to apply the patch file
``docker-compose.cloudxr-runtime.patch.yaml`` to run CloudXR Runtime container. The patch file defines services and
volumes for CloudXR Runtime and base. The environment variables required for CloudXR Runtime are specified in the
``.env.cloudxr-runtime`` file. To start or stop the CloudXR runtime container with base, use the following command:
.. code:: bash
# Start CloudXR Runtime container with base.
./docker/container.py start --files docker-compose.cloudxr-runtime.patch.yaml --env-file .env.cloudxr-runtime
# Stop CloudXR Runtime container and base.
./docker/container.py stop --files docker-compose.cloudxr-runtime.patch.yaml --env-file .env.cloudxr-runtime
X11 forwarding X11 forwarding
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
......
...@@ -109,7 +109,8 @@ def main(): ...@@ -109,7 +109,8 @@ def main():
ViewportCameraController(env, viewer) ViewportCameraController(env, viewer)
else: else:
raise ValueError( raise ValueError(
f"Invalid device interface '{args_cli.teleop_device}'. Supported: 'keyboard', 'spacemouse''handtracking'." f"Invalid device interface '{args_cli.teleop_device}'. Supported: 'keyboard', 'spacemouse', 'gamepad',"
" 'handtracking'."
) )
# add teleoperation key for env reset # add teleoperation key for env reset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment