Skip to content
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

Update Dockerfile and add Dependabot automation #1

Merged
merged 6 commits into from
Mar 9, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--- ./build_scripts/build_usd.py
+++ ./build_scripts/build_usd.py
@@ -695,7 +695,7 @@
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz"
BOOST_VERSION_FILE = "include/boost/version.hpp"
elif Linux():
- BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.gz"
+ BOOST_URL = "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.gz"
BOOST_VERSION_FILE = "include/boost/version.hpp"
elif Windows():
# The default installation of boost on Windows puts headers in a versioned
@@ -1166,6 +1166,10 @@

def InstallOpenEXR(context, force, buildArgs):
with CurrentWorkingDirectory(DownloadURL(OPENEXR_URL, context, force)):
+ PatchFile(
+ "OpenEXR/IlmImf/ImfTiledMisc.cpp",
+ [("#include <algorithm>\n", "#include <algorithm>\n#include <limits>\n")],
+ )
RunCMake(context, force,
['-DPYILMBASE_ENABLE=OFF',
'-DOPENEXR_VIEWERS_ENABLE=OFF',
@@ -1561,10 +1565,9 @@

def InstallAlembic(context, force, buildArgs):
with CurrentWorkingDirectory(DownloadURL(ALEMBIC_URL, context, force)):
- if MacOS():
- PatchFile("CMakeLists.txt",
- [("ADD_DEFINITIONS(-Wall -Werror -Wextra -Wno-unused-parameter)",
- "ADD_DEFINITIONS(-Wall -Wextra -Wno-unused-parameter)")])
+ PatchFile("CMakeLists.txt",
+ [("ADD_DEFINITIONS(-Wall -Werror -Wextra -Wno-unused-parameter)",
+ "ADD_DEFINITIONS(-Wall -Wextra -Wno-unused-parameter)")])
cmakeOptions = ['-DUSE_BINARIES=OFF', '-DUSE_TESTS=OFF']
if context.enableHDF5:
# HDF5 requires the H5_BUILT_AS_DYNAMIC_LIB macro be defined if
@@ -1589,6 +1592,14 @@

def InstallDraco(context, force, buildArgs):
with CurrentWorkingDirectory(DownloadURL(DRACO_URL, context, force)):
+ PatchFile(
+ "src/draco/core/hash_utils.h",
+ [("#include <functional>\n", "#include <functional>\n#include <cstddef>\n")],
+ )
+ PatchFile(
+ "src/draco/io/parser_utils.cc",
+ [("#include <iterator>\n", "#include <iterator>\n#include <limits>\n")],
+ )
cmakeOptions = [
'-DBUILD_USD_PLUGIN=ON',
]
27 changes: 27 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dependabot automation
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot_automation:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr merge --auto --merge "$PR_URL"
16 changes: 13 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:
cancel-in-progress: true

env:
MSRV: "1.70"
CARGO_TERM_COLOR: always
LIB_PACKAGE_NAME: isaac_sim

Expand All @@ -37,7 +38,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- "1.70" # Minimal supported Rust version (MSRV)
- MSRV
- stable
- beta
env:
Expand All @@ -48,9 +49,18 @@ jobs:
with:
save-if: ${{ github.event_name == 'push'}}
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain != 'MSRV' && matrix.toolchain != 'stable' }}
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain == 'MSRV' }}
with:
toolchain: ${{ env.MSRV }}
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain == 'stable' }}
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

## Install dependencies
- run: sudo apt-get update && sudo apt-get install -yq --no-install-recommends cmake libarchive-dev libgl-dev libglu-dev libilmbase-dev libssl-dev libx11-dev libxt-dev nvidia-cuda-dev pybind11-dev
Expand Down Expand Up @@ -104,7 +114,7 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
fail_ci_if_error: false

deny:
runs-on: ubuntu-latest
Expand Down
39 changes: 35 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version = "0.1.0"
autocxx = { version = "0.26" }
builder_derive_more = { version = "0.1" }
ctor = { version = "0.2" }
derive_builder = { version = "0.12" }
derive_builder = { version = "0.13" }
derive_more = { version = "0.99" }
omniverse = { version = "0.1" }
pxr = { version = "0.1" }
Expand Down
113 changes: 90 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,71 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo "#!/usr/bin/env bash" >> /entrypoint.bash && \
chmod +x /entrypoint.bash

### Build OpenUSD
ARG OPENUSD_VERSION="22.11"
COPY ./.docker/internal/pxr_sys/patches/src/build_scripts/build_usd.py.patch /tmp/build_usd.py.patch
# hadolint ignore=SC2016
RUN OPENUSD_DL_PATH="/tmp/OpenUSD-${OPENUSD_VERSION}.tar.gz" && \
OPENUSD_SRC_DIR="/tmp/OpenUSD-${OPENUSD_VERSION}" && \
OPENUSD_INSTALL_DIR="${HOME}/openusd" && \
echo -e "\n# OpenUSD ${OPENUSD_VERSION}" >> /entrypoint.bash && \
echo "export OPENUSD_PATH=\"${OPENUSD_INSTALL_DIR}\"" >> /entrypoint.bash && \
echo '# export PATH="${OPENUSD_PATH}/bin${PATH:+:${PATH}}"' >> /entrypoint.bash && \
echo '# export LD_LIBRARY_PATH="${OPENUSD_PATH}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"' >> /entrypoint.bash && \
echo '# export PYTHONPATH="${OPENUSD_PATH}/lib/python${PYTHONPATH:+:${PYTHONPATH}}"' >> /entrypoint.bash && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
ca-certificates \
clang \
cmake \
curl \
libarchive-dev \
libgl-dev \
libglfw3-dev \
libglib2.0-dev \
libglu-dev \
libglu1-mesa-dev \
libilmbase-dev \
libssl-dev \
libtbb2-dev \
libx11-dev \
libxt-dev \
pkg-config \
python3-dev \
python3-pip && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install --no-cache-dir PyOpenGL==3.1.7 pyside6==6.6.0 && \
curl --proto "=https" --tlsv1.2 -sSfL "https://github.com/PixarAnimationStudios/OpenUSD/archive/refs/tags/v${OPENUSD_VERSION}.tar.gz" -o "${OPENUSD_DL_PATH}" && \
mkdir -p "${OPENUSD_SRC_DIR}" && \
tar xf "${OPENUSD_DL_PATH}" -C "${OPENUSD_SRC_DIR}" --strip-components=1 && \
rm "${OPENUSD_DL_PATH}" && \
if [[ "${OPENUSD_VERSION}" = "22.11" ]]; then \
patch --unified --strip=1 --batch --follow-symlinks --ignore-whitespace --input=/tmp/build_usd.py.patch --directory="${OPENUSD_SRC_DIR}" ; \
fi && \
rm /tmp/build_usd.py.patch && \
python3 "${OPENUSD_SRC_DIR}/build_scripts/build_usd.py" \
--build-shared \
--build-variant=release --prefer-speed-over-safety \
--use-cxx11-abi=0 \
--build-args USD,"-DPXR_LIB_PREFIX=lib" \
--no-tests --no-examples --no-tutorials --no-tools --no-docs \
--usdview \
--python --no-debug-python \
--usd-imaging \
--no-ptex \
--openvdb \
--no-embree \
--no-prman \
--no-openimageio \
--no-opencolorio \
--alembic \
--no-hdf5 \
--draco \
--materialx \
"${OPENUSD_INSTALL_DIR}" && \
rm -rf "${OPENUSD_SRC_DIR}" "${OPENUSD_INSTALL_DIR}/src"

### Copy Isaac Sim into the base image
ARG ISAAC_SIM_PATH="/root/isaac_sim"
ARG CARB_APP_PATH="${ISAAC_SIM_PATH}/kit"
Expand All @@ -28,7 +93,6 @@ RUN ISAAC_SIM_VERSION="$(cut -d'-' -f1 < "${ISAAC_SIM_PATH}/VERSION")" && \
echo "export ISAAC_SIM_PATH=\"${ISAAC_SIM_PATH}\"" >> /entrypoint.bash && \
echo "export CARB_APP_PATH=\"${CARB_APP_PATH}\"" >> /entrypoint.bash && \
echo "export OMNI_SERVER=\"http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/${ISAAC_SIM_VERSION}\"" >> /entrypoint.bash && \
echo "export PYTHONEXE=\"$(which python3)\"" >> /entrypoint.bash && \
echo "export OMNI_KIT_ALLOW_ROOT=\"1\"" >> /entrypoint.bash && \
echo "# source \"${CARB_APP_PATH}/setup_python_env.sh\" --" >> /entrypoint.bash && \
echo "# source \"${ISAAC_SIM_PATH}/setup_python_env.sh\" --" >> /entrypoint.bash
Expand All @@ -40,6 +104,9 @@ ARG CARB_APP_REDOWNLOAD_VERSION="105.1.2"
ARG CARB_APP_REDOWNLOAD_BUILD_HASH="release.133510.b82c1e1e"
ARG CARB_APP_REDOWNLOAD_URL="https://d4i3qtqj3r0z5.cloudfront.net/kit-sdk%40${CARB_APP_REDOWNLOAD_VERSION}%2B${CARB_APP_REDOWNLOAD_BUILD_HASH}.tc.linux-x86_64.release.7z"
RUN if [[ "${CARB_APP_REDOWNLOAD,,}" = true ]]; then \
echo -e "\n# Carb app ${CARB_APP_REDOWNLOAD_VERSION}" >> /entrypoint.bash && \
echo "export CARB_APP_PATH=\"${CARB_APP_PATH}\"" >> /entrypoint.bash && \
echo "# source \"${CARB_APP_PATH}/setup_python_env.sh\" --" >> /entrypoint.bash && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
ca-certificates \
Expand All @@ -53,12 +120,32 @@ RUN if [[ "${CARB_APP_REDOWNLOAD,,}" = true ]]; then \
rm "${CARB_APP_DL_PATH}" ; \
fi

### Install dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
clang \
cmake \
libarchive-dev \
libgl-dev \
libglu-dev \
libilmbase-dev \
libssl-dev \
libx11-dev \
libxt-dev \
nvidia-cuda-dev \
pkg-config \
pybind11-dev \
python3-dev && \
rm -rf /var/lib/apt/lists/*

### Install Rust
ARG RUST_VERSION="1.74"
ARG RUST_VERSION="1.75"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
ca-certificates \
curl && \
curl \
mold && \
rm -rf /var/lib/apt/lists/* && \
curl --proto "=https" --tlsv1.2 -sSfL "https://sh.rustup.rs" | sh -s -- --no-modify-path -y --default-toolchain "${RUST_VERSION}" --profile default && \
echo -e "\n# Rust ${RUST_VERSION}" >> /entrypoint.bash && \
Expand All @@ -79,26 +166,6 @@ ARG WORKSPACE="/root/ws"
ENV WORKSPACE="${WORKSPACE}"
WORKDIR ${WORKSPACE}

### Install dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
clang \
cmake \
libarchive-dev \
libgl-dev \
libglu-dev \
libilmbase-dev \
libssl-dev \
libx11-dev \
libxt-dev \
mold \
nvidia-cuda-dev \
pkg-config \
pybind11-dev \
python3-dev && \
rm -rf /var/lib/apt/lists/*

### Copy the source
COPY . "${WORKSPACE}"

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# isaac_sim_rs

<p align="left">
<a href="https://crates.io/crates/isaac_sim"> <img alt="crates.io" src="https://img.shields.io/crates/v/isaac_sim.svg"></a>
<a href="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/rust.yml"> <img alt="Rust" src="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/rust.yml/badge.svg"></a>
<!-- <a href="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/docker.yml"> <img alt="Docker" src="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/docker.yml/badge.svg"></a> -->
<a href="https://codecov.io/gh/AndrejOrsula/isaac_sim_rs"> <img alt="codecov" src="https://codecov.io/gh/AndrejOrsula/isaac_sim_rs/branch/main/graph/badge.svg"></a>
<a href="https://crates.io/crates/isaac_sim"> <img alt="crates.io" src="https://img.shields.io/crates/v/isaac_sim.svg"></a>
<!-- <a href="https://docs.rs/isaac_sim"> <img alt="docs.rs" src="https://docs.rs/isaac_sim/badge.svg"></a> -->
<a href="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/rust.yml"> <img alt="Rust" src="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/rust.yml/badge.svg"></a>
<!-- <a href="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/docker.yml"> <img alt="Docker" src="https://github.com/AndrejOrsula/isaac_sim_rs/actions/workflows/docker.yml/badge.svg"></a> -->
<a href="https://deps.rs/repo/github/AndrejOrsula/isaac_sim_rs"> <img alt="deps.rs" src="https://deps.rs/repo/github/AndrejOrsula/isaac_sim_rs/status.svg"></a>
<a href="https://codecov.io/gh/AndrejOrsula/isaac_sim_rs"> <img alt="codecov.io" src="https://codecov.io/gh/AndrejOrsula/isaac_sim_rs/branch/main/graph/badge.svg"></a>

</p>

Rust interface for NVIDIA [Isaac Sim](https://developer.nvidia.com/isaac-sim).
Expand Down
Loading