-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
184 additions
and
4 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
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,85 @@ | ||
# Ref: https://docs.docker.com/build/ci/github-actions/ | ||
name: Build Docker Image for omni-farm-isaaclab | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
paths: | ||
- .github/workflows/build_isaaclab.yaml | ||
- thirdparty/** | ||
- scripts/docker/run.sh | ||
- Dockerfile.isaaclab | ||
- .dockerignore | ||
|
||
jobs: | ||
docker: | ||
if: github.repository == 'j3soon/omni-farm-isaac' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
build-mount-path: /var/lib/docker/ | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
remove-codeql: 'true' | ||
remove-docker-images: 'true' | ||
- | ||
name: Restart docker | ||
run: sudo service docker restart | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
# Ref: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-a-registry-using-a-personal-access-token | ||
name: Prepare tag name as environment variable | ||
run: | | ||
# This strips the git ref prefix from the version. | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# This strips the "v" prefix from the tag name. | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# This uses the Docker `latest` tag convention. | ||
[ "$VERSION" == "master" ] && VERSION=latest | ||
# Output the environment variable | ||
# Ref: https://stackoverflow.com/a/57989070 | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- | ||
name: Docker meta | ||
id: meta | ||
# Ref: https://github.com/docker/metadata-action | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# Link: https://hub.docker.com/repository/docker/j3soon/omni-farm-isaaclab/tags | ||
images: ${{ secrets.DOCKERHUB_USERNAME }}/omni-farm-isaaclab | ||
tags: | | ||
type=raw,value={{date 'YYYYMMDD'}} | ||
type=raw,value=${{ env.VERSION }} | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Login to nvcr.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: nvcr.io | ||
username: ${{ secrets.NVCRIO_USERNAME }} | ||
password: ${{ secrets.NVCRIO_TOKEN }} | ||
- | ||
name: Pull Isaac Sim Docker Image | ||
run: docker pull nvcr.io/nvidia/isaac-sim:4.1.0 | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile.isaaclab | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
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,69 @@ | ||
# A lightweight Docker image for running Isaac Lab 1.1.0 | ||
# Please refer to the official documentation for the officlal docker usages. | ||
FROM nvcr.io/nvidia/isaac-sim:4.1.0 | ||
|
||
# Install Conda | ||
# Ref: https://github.com/conda-forge/miniforge-images/blob/484f385f409e75a194dbe48633d8662d389ad748/ubuntu/Dockerfile | ||
# > Starting with the 22.11 PyTorch NGC container, miniforge is removed and all Python packages are installed in the default Python environment... | ||
# > See: https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-01.html | ||
ARG MINIFORGE_NAME=Miniforge3 | ||
ARG MINIFORGE_VERSION=24.3.0-0 | ||
ARG TARGETPLATFORM | ||
|
||
ENV CONDA_DIR=/opt/conda | ||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | ||
ENV PATH=${CONDA_DIR}/bin:${PATH} | ||
|
||
# 1. Install just enough for conda to work | ||
# 2. Keep $HOME clean (no .wget-hsts file), since HSTS isn't useful in this context | ||
# 3. Install miniforge from GitHub releases | ||
# 4. Apply some cleanup tips from https://jcrist.github.io/conda-docker-tips.html | ||
# Particularly, we remove pyc and a files. The default install has no js, we can skip that | ||
# 5. Activate base by default when running as any *non-root* user as well | ||
# Good security practice requires running most workloads as non-root | ||
# This makes sure any non-root users created also have base activated | ||
# for their interactive shells. | ||
# 6. Activate base by default when running as root as well | ||
# The root user is already created, so won't pick up changes to /etc/skel | ||
RUN apt-get update > /dev/null && \ | ||
apt-get install --no-install-recommends --yes \ | ||
wget bzip2 ca-certificates \ | ||
git \ | ||
tini \ | ||
> /dev/null && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/${MINIFORGE_NAME}-${MINIFORGE_VERSION}-Linux-$(uname -m).sh -O /tmp/miniforge.sh && \ | ||
/bin/bash /tmp/miniforge.sh -b -p ${CONDA_DIR} && \ | ||
rm /tmp/miniforge.sh && \ | ||
conda clean --tarballs --index-cache --packages --yes && \ | ||
find ${CONDA_DIR} -follow -type f -name '*.a' -delete && \ | ||
find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete && \ | ||
conda clean --force-pkgs-dirs --all --yes && \ | ||
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> /etc/skel/.bashrc && \ | ||
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD [ "/bin/bash" ] | ||
|
||
# Install and Setup Isaac Lab 1.1.0 | ||
# Ref: https://isaac-sim.github.io/IsaacLab/source/setup/installation/binaries_installation.html | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
cmake \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN git clone https://github.com/isaac-sim/IsaacLab.git ~/IsaacLab \ | ||
&& cd ~/IsaacLab \ | ||
&& git checkout v1.1.0 | ||
WORKDIR /root/IsaacLab | ||
RUN ln -s /isaac-sim _isaac_sim | ||
RUN ./isaaclab.sh --conda | ||
RUN . /opt/conda/etc/profile.d/conda.sh \ | ||
&& conda activate isaaclab \ | ||
&& ./isaaclab.sh --install | ||
RUN echo "conda activate isaaclab" >> ~/.bashrc | ||
|
||
# Tools and scripts for Omniverse Farm | ||
COPY thirdparty/omnicli /omnicli | ||
COPY scripts/docker/run.sh /run.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
cd "$DIR/../.." | ||
docker build -f Dockerfile.isaaclab -t j3soon/omni-farm-isaaclab:local . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_container.html#container-deployment | ||
docker run --name isaac-sim -it --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 "$DIR/../..":/workspace:rw \ | ||
j3soon/omni-farm-isaaclab:local |