-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfiles for building and running OmniGibson images (#72)
* Prepare for Docker release * Lowercase needed * Executable perms * Try another installation order * Add Omniverse EULA stuff * Yes or no * Spacing * Update Dockerfile * Remove mamba * Another attempt * Reditch Mamba * Fix accidental paste * Remove sudo * Apt call -y * Get pip * Better pip install * Revert "Better pip install" This reverts commit f5d4479. * Revert "Get pip" This reverts commit 61f872d. * Revert "Apt call -y" This reverts commit 5823393. * Revert "Remove sudo" This reverts commit 7e22f80. * Revert "Fix accidental paste" This reverts commit d5be8d9. * Revert "Reditch Mamba" This reverts commit 67cd60a. * Another attempt * Activate before pip * Init shell for mamba * Do stuff in a shell * Fix typo * Ignore docker in docker * Dont install for now * Fix install * Better micromamba * Change shell * Launch in login shell * Upgrade numpy * Remove prebundled numpy * Better job removing prebuilt * Run from web * Be nice towards xhost. * Fix script paths
- Loading branch information
Showing
15 changed files
with
157 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
gibson/assets/dataset | ||
omnigibson/data | ||
docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM nvcr.io/nvidia/isaac-sim:2022.1.1 | ||
|
||
# Set up all the prerequisites. | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN echo "bash /isaac-sim/vulkan_check.sh" >> /root/.bashrc | ||
RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/gym | ||
RUN rm -rf /isaac-sim/kit/extscore/omni.kit.pip_archive/pip_prebundle/numpy | ||
|
||
# Add OmniGibson | ||
ADD . /omnigibson | ||
WORKDIR /omnigibson | ||
|
||
# Mount the data directory | ||
VOLUME ["/data"] | ||
ENV OMNIGIBSON_DATASET_PATH /data/og_dataset | ||
ENV OMNIGIBSON_ASSETS_PATH /data/assets | ||
ENV GIBSON_DATASET_PATH /data/g_dataset | ||
ENV OMNIGIBSON_KEY_PATH /data/omnigibson.key | ||
|
||
# Install Mamba (light conda alternative) | ||
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj -C / bin/micromamba | ||
ENV MAMBA_ROOT_PREFIX /micromamba | ||
RUN micromamba create -n omnigibson -c conda-forge python=3.7 | ||
RUN micromamba shell init --shell=bash --prefix=/micromamba | ||
RUN echo "micromamba activate omnigibson" >> /root/.bashrc | ||
RUN echo "source /isaac-sim/setup_conda_env.sh" >> /root/.bashrc | ||
|
||
# Install some additional niceties for working with notebooks | ||
SHELL ["micromamba", "run", "-n", "omnigibson", "/bin/bash", "--login", "-c"] | ||
RUN micromamba install -c conda-forge opencv | ||
|
||
# Install OmniGibson | ||
RUN pip install -e . | ||
|
||
ENTRYPOINT [] | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Requirements | ||
|
||
- Modern Linux distribution (Ubuntu 20.04, Fedora 36, etc.) | ||
- RTX capable Nvidia graphics card (20 series or newer,) | ||
- Up-to-date NVIDIA drivers | ||
|
||
# Usage | ||
|
||
**The below instructions concern the usage of OmniGibson containers with self-built images. Please see the BEHAVIOR-1K docs for instructions on how to pull and run a cloud image.** | ||
|
||
1. Set up the NVIDIA Docker Runtime and login to the NVIDIA Container Registry | ||
See [here](https://www.pugetsystems.com/labs/hpc/how-to-setup-nvidia-docker-and-ngc-registry-on-your-workstation-part-4-accessing-the-ngc-registry-1115/) for details. | ||
|
||
2. Build the container. **From the OmniGibson root**, run: `./docker/build_docker.sh` | ||
|
||
3. Run the container | ||
* To get a shell inside a container with GUI: `./docker/run_docker_gui.sh` | ||
* To get a jupyter notebook: `./docker/run_docker_notebook.sh` | ||
* To get access to a shell inside a headless container `./docker/run_docker.sh` | ||
|
||
# Development | ||
To push a Docker container, run: `./docker/push_docker.sh` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker build \ | ||
-t stanfordvl/omnigibson:latest \ | ||
-t stanfordvl/omnigibson:$(sed -ne "s/.*version= *['\"]\([^'\"]*\)['\"] *.*/\1/p" setup.py) \ | ||
-f docker/Dockerfile \ | ||
. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker push stanfordvl/omnigibson:latest | ||
docker push stanfordvl/omnigibson:$(sed -ne "s/.*version= *['\"]\([^'\"]*\)['\"] *.*/\1/p" setup.py) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
DATA_PATH=${1:-'~/omnigibson-data'} | ||
|
||
echo "The NVIDIA Omniverse License Agreement (EULA) must be accepted before" | ||
echo "Omniverse Kit can start. The license terms for this product can be viewed at" | ||
echo "https://docs.omniverse.nvidia.com/app_isaacsim/common/NVIDIA_Omniverse_License_Agreement.html" | ||
|
||
while true; do | ||
read -p "Do you accept the Omniverse EULA? [yn] " yn | ||
case $yn in | ||
[Yy]* ) break;; | ||
[Nn]* ) exit;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done | ||
|
||
docker run \ | ||
--gpus all \ | ||
--privileged \ | ||
-e DISPLAY \ | ||
-e OMNIGIBSON_HEADLESS=1 \ | ||
-v DATA_PATH:/data \ | ||
--network=host --rm -it stanfordvl/omnigibson:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
DATA_PATH=${1:-'~/omnigibson-data'} | ||
|
||
echo "The NVIDIA Omniverse License Agreement (EULA) must be accepted before" | ||
echo "Omniverse Kit can start. The license terms for this product can be viewed at" | ||
echo "https://docs.omniverse.nvidia.com/app_isaacsim/common/NVIDIA_Omniverse_License_Agreement.html" | ||
|
||
while true; do | ||
read -p "Do you accept the Omniverse EULA? [yn] " yn | ||
case $yn in | ||
[Yy]* ) break;; | ||
[Nn]* ) exit;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done | ||
|
||
xhost +local:root | ||
docker run \ | ||
--gpus all \ | ||
--privileged \ | ||
-e DISPLAY=${DISPLAY} \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | ||
-v DATA_PATH:/data \ | ||
--network=host --rm -it stanfordvl/omnigibson:latest | ||
xhost -local:root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
DATA_PATH=${1:-'~/omnigibson-data'} | ||
|
||
echo "The NVIDIA Omniverse License Agreement (EULA) must be accepted before" | ||
echo "Omniverse Kit can start. The license terms for this product can be viewed at" | ||
echo "https://docs.omniverse.nvidia.com/app_isaacsim/common/NVIDIA_Omniverse_License_Agreement.html" | ||
|
||
while true; do | ||
read -p "Do you accept the Omniverse EULA? [yn] " yn | ||
case $yn in | ||
[Yy]* ) break;; | ||
[Nn]* ) exit;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done | ||
|
||
docker run \ | ||
--gpus all \ | ||
--privileged \ | ||
-e DISPLAY \ | ||
-e OMNIGIBSON_HEADLESS=1 \ | ||
-v DATA_PATH:/data \ | ||
--network=host --rm -it stanfordvl/omnigibson bash -c "source ~/.bashrc && jupyter lab --allow-root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters