From 257b0d21ddf445113250fe233eb40b22d5ee5cba Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Sat, 20 Jan 2024 16:18:46 +0100 Subject: [PATCH 1/6] Update badges Signed-off-by: Andrej Orsula --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6c0a7f9..203895a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # isaac_sim_rs

- crates.io - Rust - - codecov + crates.io + + Rust + + deps.rs + codecov.io +

Rust interface for NVIDIA [Isaac Sim](https://developer.nvidia.com/isaac-sim). From d9c46de58ec67b36099555047d5c98bfb72053ca Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Thu, 25 Jan 2024 00:25:18 +0100 Subject: [PATCH 2/6] Bump derive_builder to 0.13 Signed-off-by: Andrej Orsula --- Cargo.lock | 39 +++++++++++++++++++++++++++++++++++---- Cargo.toml | 2 +- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaf193c..693bad3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -508,7 +508,16 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "660047478bc508c0fde22c868991eec0c40a63e48d610befef466d48e2bee574" +dependencies = [ + "derive_builder_macro 0.13.0", ] [[package]] @@ -523,13 +532,35 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b217e6dd1011a54d12f3b920a411b5abd44b1716ecfe94f5f2f2f7b52e08ab7" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder_macro" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.12.0", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5f77d7e20ac9153428f7ca14a88aba652adfc7a0ef0a06d654386310ef663b" +dependencies = [ + "derive_builder_core 0.13.0", "syn 1.0.109", ] @@ -916,7 +947,7 @@ dependencies = [ "autocxx", "builder_derive_more", "ctor", - "derive_builder", + "derive_builder 0.13.0", "derive_more", "omniverse", "pxr", @@ -1171,7 +1202,7 @@ dependencies = [ "cpp", "cpp_build", "cxx", - "derive_builder", + "derive_builder 0.12.0", "once_cell", "pxr", "python-config-rs", diff --git a/Cargo.toml b/Cargo.toml index 35f7856..b2c66ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } From e69b0d5561f6b5da381b126fef7f15fdbb7bbd46 Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Thu, 25 Jan 2024 00:25:27 +0100 Subject: [PATCH 3/6] Update Dockerfile Signed-off-by: Andrej Orsula --- .../src/build_scripts/build_usd.py.patch | 51 ++++++++ Dockerfile | 112 ++++++++++++++---- 2 files changed, 141 insertions(+), 22 deletions(-) create mode 100644 .docker/internal/pxr_sys/patches/src/build_scripts/build_usd.py.patch diff --git a/.docker/internal/pxr_sys/patches/src/build_scripts/build_usd.py.patch b/.docker/internal/pxr_sys/patches/src/build_scripts/build_usd.py.patch new file mode 100644 index 0000000..fda840b --- /dev/null +++ b/.docker/internal/pxr_sys/patches/src/build_scripts/build_usd.py.patch @@ -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 \n", "#include \n#include \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 \n", "#include \n#include \n")], ++ ) ++ PatchFile( ++ "src/draco/io/parser_utils.cc", ++ [("#include \n", "#include \n#include \n")], ++ ) + cmakeOptions = [ + '-DBUILD_USD_PLUGIN=ON', + ] diff --git a/Dockerfile b/Dockerfile index d60802a..be609f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" @@ -40,6 +105,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 \ @@ -53,12 +121,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 && \ @@ -79,26 +167,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}" From d800e0674e4d8e7d2b3bea4451f20b7bc81885ff Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Mon, 29 Jan 2024 14:22:56 +0100 Subject: [PATCH 4/6] Dockerfile: Unset `$PYTHONEXE` Signed-off-by: Andrej Orsula --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be609f5..3b76663 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,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 From 58b67f0c86fc7fccbab16c91dbe71c93d2e85cc5 Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Sat, 9 Mar 2024 16:02:45 +0100 Subject: [PATCH 5/6] Update Rust CI Signed-off-by: Andrej Orsula --- .github/workflows/rust.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index efd093c..8c68cc8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,6 +14,7 @@ concurrency: cancel-in-progress: true env: + MSRV: "1.70" CARGO_TERM_COLOR: always LIB_PACKAGE_NAME: isaac_sim @@ -37,7 +38,7 @@ jobs: fail-fast: false matrix: toolchain: - - "1.70" # Minimal supported Rust version (MSRV) + - MSRV - stable - beta env: @@ -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 @@ -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 From 02dbd937829df0677fbf203f9dfb34f2a16a1729 Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Sat, 9 Mar 2024 16:03:02 +0100 Subject: [PATCH 6/6] CI: Add Dependabot automation Signed-off-by: Andrej Orsula --- .github/workflows/dependabot.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..b8349c1 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -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"