From a29e74ae0a9709b8ef639e1112318726ce0ee982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= <1408354+cgokmen@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:37:24 -0800 Subject: [PATCH 01/27] New pip install & dockerfile setup with torch, cuda, curobo and ompl --- .github/workflows/examples-as-test.yml | 4 +- .github/workflows/profiling.yml | 2 +- .github/workflows/tests.yml | 2 +- docker/prod.Dockerfile | 53 +++++++++++++------------- setup.py | 6 ++- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/.github/workflows/examples-as-test.yml b/.github/workflows/examples-as-test.yml index 7d595ae85..39d9cb51c 100644 --- a/.github/workflows/examples-as-test.yml +++ b/.github/workflows/examples-as-test.yml @@ -28,7 +28,7 @@ jobs: - name: Install working-directory: omnigibson-src - run: pip install -e .[dev] + run: pip install -e .[dev,primitives] - name: Generate example tests working-directory: omnigibson-src @@ -76,7 +76,7 @@ jobs: - name: Install working-directory: omnigibson-src - run: pip install -e .[dev] + run: pip install -e .[dev,primitives] - name: Run tests working-directory: omnigibson-src diff --git a/.github/workflows/profiling.yml b/.github/workflows/profiling.yml index a6ccba29f..d9a687c9c 100644 --- a/.github/workflows/profiling.yml +++ b/.github/workflows/profiling.yml @@ -34,7 +34,7 @@ jobs: - name: Install working-directory: omnigibson-src - run: pip install -e .[dev] + run: pip install -e .[dev,primitives] - name: Run performance benchmark run: bash scripts/profiling.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c1f8eef0..ff1508e7f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: - name: Install working-directory: omnigibson-src - run: pip install -e .[dev] + run: pip install -e .[dev,primitives] - name: Print env run: printenv diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index e30aaf5ee..1b6db8c87 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -23,6 +23,32 @@ ENV MAMBA_ROOT_PREFIX /micromamba RUN micromamba create -n omnigibson -c conda-forge python=3.10 RUN micromamba shell init --shell=bash +# Install evdev, which is a dependency of telemoma. It cannot be +# installed afterwards because it depends on some C compilation that +# fails if kernel headers ("sysroot") is present inside the conda env. +# The CUDA installation will add the kernel headers to the conda env. +# So we install evdev before installing CUDA. +RUN micromamba run -n omnigibson pip install evdev + +# Remove the ml-archive extension. It includes a version of torch +# that we don't want to use. +RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive + +# Install CUDA and torch +RUN micromamba run -n omnigibson micromamba install \ + pytorch torchvision pytorch-cuda=12.1 cuda=12.1.0 \ + -c pytorch -c nvidia -c conda-forge + +# Install curobo. This can normally be installed when OmniGibson is pip +# installed, but we need to install it beforehand here so that it doesn't +# have to happen on every time a CI action is run (otherwise it's just +# very slow) +# Here we also compile this such that it is compatible with GPU architectures +# Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. +# TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6;8.7;8.9;7.5+PTX;8.0+PTX;8.6+PTX;8.7+PTX;8.9+PTX' +RUN TORCH_CUDA_ARCH_LIST='7.5+PTX' \ + micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation + # Make sure isaac gets properly sourced every time omnigibson gets called ARG CONDA_ACT_FILE="/micromamba/envs/omnigibson/etc/conda/activate.d/env_vars.sh" RUN mkdir -p "/micromamba/envs/omnigibson/etc/conda/activate.d" @@ -33,31 +59,6 @@ RUN echo "source /isaac-sim/setup_conda_env.sh" >> $CONDA_ACT_FILE RUN echo "micromamba activate omnigibson" >> /root/.bashrc -# Prepare to build OMPL -ENV CXX="g++" -ENV MAKEFLAGS="-j `nproc`" -RUN micromamba run -n omnigibson micromamba install -c conda-forge boost && \ - micromamba run -n omnigibson pip install pyplusplus && \ - git clone https://github.com/ompl/ompl.git /ompl && \ - mkdir -p /ompl/build/Release && \ - sed -i "s/find_program(PYPY/# find_program(PYPY/g" /ompl/CMakeModules/Findpypy.cmake - -# Build and install OMPL -RUN micromamba run -n omnigibson /bin/bash --login -c 'source /isaac-sim/setup_conda_env.sh && (which python > /root/PYTHON_EXEC) && (echo $PYTHONPATH > /root/PYTHONPATH)' && \ - cd /ompl/build/Release && \ - micromamba run -n omnigibson cmake ../.. \ - -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ - -DBOOST_ROOT="$CONDA_PREFIX" \ - -DPYTHON_EXEC=$(cat /root/PYTHON_EXEC) \ - -DPYTHONPATH=$(cat /root/PYTHONPATH) && \ - micromamba run -n omnigibson make -j 4 update_bindings && \ - micromamba run -n omnigibson make -j 4 && \ - cd py-bindings && \ - micromamba run -n omnigibson make install - -# Test OMPL -RUN micromamba run -n omnigibson python -c "from ompl import base" - # Copy over omnigibson source ADD . /omnigibson-src WORKDIR /omnigibson-src @@ -72,7 +73,7 @@ ENV DEV_MODE=${DEV_MODE} ARG WORKDIR_PATH=/omnigibson-src RUN if [ "$DEV_MODE" != "1" ]; then \ echo "OMNIGIBSON_NO_OMNIVERSE=1 python omnigibson/download_datasets.py" >> /root/.bashrc; \ - micromamba run -n omnigibson pip install -e .[dev]; \ + micromamba run -n omnigibson pip install -e .[dev,primitives]; \ else \ WORKDIR_PATH=/; \ cd / && rm -rf /omnigibson-src; \ diff --git a/setup.py b/setup.py index 9d7f8d331..45a13272b 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,11 @@ "mkdocs-section-index", "mkdocs-literate-nav", "telemoma~=0.1.2", - ] + ], + "primitives": [ + "nvidia-curobo @ git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5", + "ompl @ https://storage.googleapis.com/gibson_scenes/ompl-1.6.0-cp310-cp310-manylinux_2_28_x86_64.whl", + ], }, tests_require=[], python_requires=">=3", From 1f6d74bc7743185dc27fd788e5e3d9879d41c4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= <1408354+cgokmen@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:57:49 -0800 Subject: [PATCH 02/27] Be more conservative when removing prebundled torch --- docker/prod.Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 1b6db8c87..85776a7df 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/gym* +RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/torch* RUN rm -rf /isaac-sim/kit/extscore/omni.kit.pip_archive/pip_prebundle/numpy* RUN /isaac-sim/python.sh -m pip install click~=8.1.3 @@ -30,10 +31,6 @@ RUN micromamba shell init --shell=bash # So we install evdev before installing CUDA. RUN micromamba run -n omnigibson pip install evdev -# Remove the ml-archive extension. It includes a version of torch -# that we don't want to use. -RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive - # Install CUDA and torch RUN micromamba run -n omnigibson micromamba install \ pytorch torchvision pytorch-cuda=12.1 cuda=12.1.0 \ From 2eddd246b084a4ceca47ced6858438e226261a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= <1408354+cgokmen@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:20:03 -0800 Subject: [PATCH 03/27] Lower our cuda version --- docker/prod.Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 85776a7df..a549919c9 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/gym* RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/torch* +RUN rm -rf /isaac-sim/exts/omni.isaac.ml_archive/pip_prebundle/functorch* RUN rm -rf /isaac-sim/kit/extscore/omni.kit.pip_archive/pip_prebundle/numpy* RUN /isaac-sim/python.sh -m pip install click~=8.1.3 @@ -33,7 +34,7 @@ RUN micromamba run -n omnigibson pip install evdev # Install CUDA and torch RUN micromamba run -n omnigibson micromamba install \ - pytorch torchvision pytorch-cuda=12.1 cuda=12.1.0 \ + pytorch torchvision pytorch-cuda=11.8 cuda=11.8.0 \ -c pytorch -c nvidia -c conda-forge # Install curobo. This can normally be installed when OmniGibson is pip @@ -43,7 +44,7 @@ RUN micromamba run -n omnigibson micromamba install \ # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. # TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6;8.7;8.9;7.5+PTX;8.0+PTX;8.6+PTX;8.7+PTX;8.9+PTX' -RUN TORCH_CUDA_ARCH_LIST='7.5+PTX' \ +RUN TORCH_CUDA_ARCH_LIST='7.5,8.0;8.6;8.7;8.9+PTX' \ micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation # Make sure isaac gets properly sourced every time omnigibson gets called From 7e91c3a16e0879c8446158fea1b64c3ccd42bb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= <1408354+cgokmen@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:35:25 -0800 Subject: [PATCH 04/27] Update prod.Dockerfile --- docker/prod.Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index a549919c9..8bd49c78d 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -32,11 +32,17 @@ RUN micromamba shell init --shell=bash # So we install evdev before installing CUDA. RUN micromamba run -n omnigibson pip install evdev -# Install CUDA and torch +# Install torch RUN micromamba run -n omnigibson micromamba install \ - pytorch torchvision pytorch-cuda=11.8 cuda=11.8.0 \ + pytorch torchvision pytorch-cuda=11.8 \ -c pytorch -c nvidia -c conda-forge +# Install cuda for compiling curobo +RUN wget -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ + sh /cuda.run --silent --toolkit && rm /cuda.run +ENV PATH=/usr/local/cuda-11.8/bin:$PATH +ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH + # Install curobo. This can normally be installed when OmniGibson is pip # installed, but we need to install it beforehand here so that it doesn't # have to happen on every time a CI action is run (otherwise it's just @@ -44,7 +50,7 @@ RUN micromamba run -n omnigibson micromamba install \ # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. # TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6;8.7;8.9;7.5+PTX;8.0+PTX;8.6+PTX;8.7+PTX;8.9+PTX' -RUN TORCH_CUDA_ARCH_LIST='7.5,8.0;8.6;8.7;8.9+PTX' \ +RUN TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' \ micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation # Make sure isaac gets properly sourced every time omnigibson gets called From 457f678697df3367c4d53a85718afec821c1028f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= <1408354+cgokmen@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:41:23 -0800 Subject: [PATCH 05/27] Update prod.Dockerfile --- docker/prod.Dockerfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 8bd49c78d..0b9a99fc8 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -25,13 +25,6 @@ ENV MAMBA_ROOT_PREFIX /micromamba RUN micromamba create -n omnigibson -c conda-forge python=3.10 RUN micromamba shell init --shell=bash -# Install evdev, which is a dependency of telemoma. It cannot be -# installed afterwards because it depends on some C compilation that -# fails if kernel headers ("sysroot") is present inside the conda env. -# The CUDA installation will add the kernel headers to the conda env. -# So we install evdev before installing CUDA. -RUN micromamba run -n omnigibson pip install evdev - # Install torch RUN micromamba run -n omnigibson micromamba install \ pytorch torchvision pytorch-cuda=11.8 \ @@ -49,7 +42,6 @@ ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH # very slow) # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. -# TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6;8.7;8.9;7.5+PTX;8.0+PTX;8.6+PTX;8.7+PTX;8.9+PTX' RUN TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' \ micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation From ad022b767140a4261397713ad34dd83c4937ee29 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 12:31:40 -0800 Subject: [PATCH 06/27] fix torch compiled transform utils --- omnigibson/utils/transform_utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/omnigibson/utils/transform_utils.py b/omnigibson/utils/transform_utils.py index 2bbdfc598..f666b4912 100644 --- a/omnigibson/utils/transform_utils.py +++ b/omnigibson/utils/transform_utils.py @@ -273,8 +273,8 @@ def quat_slerp(quat0, quat1, frac, shortestpath=True, eps=1.0e-15): # type: (Tensor, Tensor, Tensor, bool, float) -> Tensor # reshape quaternion quat_shape = quat0.shape - quat0 = unit_vector(quat0.reshape(-1, 4), dim=-1) - quat1 = unit_vector(quat1.reshape(-1, 4), dim=-1) + quat0 = unit_vector(quat0.reshape(-1, 4), dim=-1, out=None) + quat1 = unit_vector(quat1.reshape(-1, 4), dim=-1, out=None) # Check for endpoint cases where_start = frac <= 0.0 @@ -481,8 +481,8 @@ def vec2quat(vec: torch.Tensor, up: torch.Tensor = torch.tensor([0.0, 0.0, 1.0]) if up.dim() == 1: up = up.unsqueeze(0) - vec_n = torch.nn.functional.normalize(vec, dim=-1) - up_n = torch.nn.functional.normalize(up, dim=-1) + vec_n = torch.nn.functional.normalize(vec, dim=-1, eps=1e-10) + up_n = torch.nn.functional.normalize(up, dim=-1, eps=1e-10) s_n = torch.cross(up_n, vec_n, dim=-1) u_n = torch.cross(vec_n, s_n, dim=-1) @@ -1141,8 +1141,8 @@ def vecs2axisangle(vec0, vec1): vec1 (torch.tensor): (..., 3) (x,y,z) 3D vector, possibly unnormalized """ # Normalize vectors - vec0 = normalize(vec0, dim=-1) - vec1 = normalize(vec1, dim=-1) + vec0 = normalize(vec0, dim=-1, eps=1e-10) + vec1 = normalize(vec1, dim=-1, eps=1e-10) # Get cross product for direction of angle, and multiply by arcos of the dot product which is the angle return torch.linalg.cross(vec0, vec1) * torch.arccos((vec0 * vec1).sum(-1, keepdim=True)) @@ -1162,8 +1162,8 @@ def vecs2quat(vec0: torch.Tensor, vec1: torch.Tensor, normalized: bool = False) """ # Normalize vectors if requested if not normalized: - vec0 = normalize(vec0, dim=-1) - vec1 = normalize(vec1, dim=-1) + vec0 = normalize(vec0, dim=-1, eps=1e-10) + vec1 = normalize(vec1, dim=-1, eps=1e-10) # Half-way Quaternion Solution -- see https://stackoverflow.com/a/11741520 cos_theta = torch.sum(vec0 * vec1, dim=-1, keepdim=True) From c229994419a09ca6c198c493637960e75c65716c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 12:40:00 -0800 Subject: [PATCH 07/27] Install cuda before torch in an effort to save disk space --- docker/prod.Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 0b9a99fc8..444dc1785 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -19,6 +19,12 @@ ENV OMNIGIBSON_ASSET_PATH /data/assets ENV GIBSON_DATASET_PATH /data/g_dataset ENV OMNIGIBSON_KEY_PATH /data/omnigibson.key +# Install cuda for compiling curobo +RUN wget -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ + sh /cuda.run --silent --toolkit && rm /cuda.run +ENV PATH=/usr/local/cuda-11.8/bin:$PATH +ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH + # 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 @@ -30,12 +36,6 @@ RUN micromamba run -n omnigibson micromamba install \ pytorch torchvision pytorch-cuda=11.8 \ -c pytorch -c nvidia -c conda-forge -# Install cuda for compiling curobo -RUN wget -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ - sh /cuda.run --silent --toolkit && rm /cuda.run -ENV PATH=/usr/local/cuda-11.8/bin:$PATH -ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH - # Install curobo. This can normally be installed when OmniGibson is pip # installed, but we need to install it beforehand here so that it doesn't # have to happen on every time a CI action is run (otherwise it's just From c08e8e21d9415d0f3d7bc2e7e78a015ceca2b1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 12:40:14 -0800 Subject: [PATCH 08/27] Enable container build on this branch for testing --- .github/workflows/build-push-containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 099f02060..6b832527f 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'og-develop' + - 'docker-cuda-install-first' jobs: docker: From f223c46848efe244ca79072553c5e3f9ad98eee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 13:40:44 -0800 Subject: [PATCH 09/27] Update build-push-containers.yml --- .github/workflows/build-push-containers.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 6b832527f..3da872329 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -49,6 +49,8 @@ jobs: name: Check disk space run: | df . -h + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Checkout uses: actions/checkout@v4 From 19dc94b99f7ec779e1b87de1e605ff88b35050e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 13:57:16 -0800 Subject: [PATCH 10/27] Remove some extra stuff --- .github/workflows/build-push-containers.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 3da872329..cd1d22787 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -23,7 +23,7 @@ jobs: sudo rm -rf \ /usr/share/dotnet /usr/local/lib/android /opt/ghc \ /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ - /usr/lib/jvm || true + /usr/lib/jvm /opt/hostedtoolcache/CodeQL || true echo "some directories deleted" sudo apt install aptitude -y >/dev/null 2>&1 sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ @@ -49,8 +49,6 @@ jobs: name: Check disk space run: | df . -h - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - name: Checkout uses: actions/checkout@v4 From 22b5b6e743b4336f3ec78012ef7f30b14c2b07e8 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 14:01:57 -0800 Subject: [PATCH 11/27] fix pos_kp --- omnigibson/controllers/ik_controller.py | 5 +++-- omnigibson/controllers/null_joint_controller.py | 5 +++-- setup.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/omnigibson/controllers/ik_controller.py b/omnigibson/controllers/ik_controller.py index fbcaf3aae..fa0e18b2a 100644 --- a/omnigibson/controllers/ik_controller.py +++ b/omnigibson/controllers/ik_controller.py @@ -175,8 +175,9 @@ def limiter(target_pos: Array[float], target_quat: Array[float], control_dict: D control_freq=control_freq, control_limits=control_limits, dof_idx=dof_idx, - kp=kp, - damping_ratio=damping_ratio, + pos_kp=pos_kp, + pos_damping_ratio=pos_damping_ratio, + vel_kp=vel_kp, motor_type="position", use_delta_commands=False, use_impedances=use_impedances, diff --git a/omnigibson/controllers/null_joint_controller.py b/omnigibson/controllers/null_joint_controller.py index f51921499..4c92cbf9a 100644 --- a/omnigibson/controllers/null_joint_controller.py +++ b/omnigibson/controllers/null_joint_controller.py @@ -68,8 +68,9 @@ def __init__( dof_idx=dof_idx, command_input_limits=command_input_limits, command_output_limits=command_output_limits, - kp=kp, - damping_ratio=damping_ratio, + pos_kp=pos_kp, + pos_damping_ratio=pos_damping_ratio, + vel_kp=vel_kp, use_impedances=use_impedances, use_delta_commands=False, ) diff --git a/setup.py b/setup.py index 991ac00db..9d7f8d331 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,6 @@ "rtree>=1.2.0", "graphviz>=0.20", "matplotlib>=3.0.0", - "nvidia-curobo @ git+https://github.com/StanfordVL/curobo@main", ], extras_require={ "dev": [ From dab42771669e806435ada9589920e308579b0124 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 14:02:54 -0800 Subject: [PATCH 12/27] fix controller subsume minor bugs --- omnigibson/configs/tiago_primitives.yaml | 2 +- omnigibson/objects/controllable_object.py | 11 +++++++---- omnigibson/utils/python_utils.py | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/omnigibson/configs/tiago_primitives.yaml b/omnigibson/configs/tiago_primitives.yaml index 9b03932a0..10dec2e7c 100644 --- a/omnigibson/configs/tiago_primitives.yaml +++ b/omnigibson/configs/tiago_primitives.yaml @@ -51,13 +51,13 @@ robots: name: JointController arm_left: name: JointController + subsume_controllers: [trunk] motor_type: position command_input_limits: null command_output_limits: null use_delta_commands: false arm_right: name: JointController - subsume_controllers: [trunk] motor_type: position command_input_limits: null command_output_limits: null diff --git a/omnigibson/objects/controllable_object.py b/omnigibson/objects/controllable_object.py index dc996f99b..8feb77008 100644 --- a/omnigibson/objects/controllable_object.py +++ b/omnigibson/objects/controllable_object.py @@ -226,6 +226,9 @@ def _load_controllers(self): # Generate the controller config self._controller_config = self._generate_controller_config(custom_config=self._controller_config) + # We copy the controller config here because we add/remove some keys in-place that shouldn't persist + _controller_config = deepcopy(self._controller_config) + # Store dof idx mapping to dof name self.dof_names_ordered = list(self._joints.keys()) @@ -237,8 +240,8 @@ def _load_controllers(self): subsume_names = set() for name in self._raw_controller_order: # Make sure we have the valid controller name specified - assert_valid_key(key=name, valid_keys=self._controller_config, name="controller name") - cfg = self._controller_config[name] + assert_valid_key(key=name, valid_keys=_controller_config, name="controller name") + cfg = _controller_config[name] subsume_controllers = cfg.pop("subsume_controllers", []) # If this controller subsumes other controllers, it cannot be subsumed by another controller # (i.e.: we don't allow nested / cyclical subsuming) @@ -262,11 +265,11 @@ def _load_controllers(self): # If this controller is subsumed by another controller, simply skip it if name in subsume_names: continue - cfg = self._controller_config[name] + cfg = _controller_config[name] # If we subsume other controllers, prepend the subsumed' dof idxs to this controller's idxs if name in controller_subsumes: for subsumed_name in controller_subsumes[name]: - subsumed_cfg = self._controller_config[subsumed_name] + subsumed_cfg = _controller_config[subsumed_name] cfg["dof_idx"] = th.concatenate([subsumed_cfg["dof_idx"], cfg["dof_idx"]]) # If we're using normalized action space, override the inputs for all controllers diff --git a/omnigibson/utils/python_utils.py b/omnigibson/utils/python_utils.py index 301d68191..ad6ed3d7f 100644 --- a/omnigibson/utils/python_utils.py +++ b/omnigibson/utils/python_utils.py @@ -151,9 +151,9 @@ def create_object_from_init_info(init_info): def safe_equal(a, b): if isinstance(a, th.Tensor) and isinstance(b, th.Tensor): - return (a == b).all().item() + return a.shape == b.shape and (a == b).all().item() elif isinstance(a, (list, tuple)) and isinstance(b, (list, tuple)): - return all(safe_equal(a_item, b_item) for a_item, b_item in zip(a, b)) + return len(a) == len(b) and all(safe_equal(a_item, b_item) for a_item, b_item in zip(a, b)) else: return a == b From 0ceda2b177897a298172376885c22956e2a20360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 14:29:41 -0800 Subject: [PATCH 13/27] Undo builds on feature branch --- .github/workflows/build-push-containers.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index cd1d22787..334f2bf47 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -7,7 +7,6 @@ on: branches: - 'main' - 'og-develop' - - 'docker-cuda-install-first' jobs: docker: From 15b987c695542b4a12a4f3258e5b018f47673172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 14:34:55 -0800 Subject: [PATCH 14/27] Update prod.Dockerfile --- docker/prod.Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 444dc1785..c3c08c66b 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -20,7 +20,7 @@ ENV GIBSON_DATASET_PATH /data/g_dataset ENV OMNIGIBSON_KEY_PATH /data/omnigibson.key # Install cuda for compiling curobo -RUN wget -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ +RUN wget --no-verbose -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ sh /cuda.run --silent --toolkit && rm /cuda.run ENV PATH=/usr/local/cuda-11.8/bin:$PATH ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH @@ -42,8 +42,11 @@ RUN micromamba run -n omnigibson micromamba install \ # very slow) # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. +# We also suppress the output of the installation to avoid the log limit. RUN TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' \ - micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation + micromamba run -n omnigibson pip install \ + git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo \ + --no-build-isolation > /dev/null # Make sure isaac gets properly sourced every time omnigibson gets called ARG CONDA_ACT_FILE="/micromamba/envs/omnigibson/etc/conda/activate.d/env_vars.sh" From 5eaaa0c7e197e739f87d4906aea9ddbe33a19079 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 14:55:00 -0800 Subject: [PATCH 15/27] fix more tests --- omnigibson/utils/transform_utils.py | 4 ++-- tests/test_robot_states_flatcache.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/omnigibson/utils/transform_utils.py b/omnigibson/utils/transform_utils.py index f666b4912..fadbc0f6a 100644 --- a/omnigibson/utils/transform_utils.py +++ b/omnigibson/utils/transform_utils.py @@ -481,8 +481,8 @@ def vec2quat(vec: torch.Tensor, up: torch.Tensor = torch.tensor([0.0, 0.0, 1.0]) if up.dim() == 1: up = up.unsqueeze(0) - vec_n = torch.nn.functional.normalize(vec, dim=-1, eps=1e-10) - up_n = torch.nn.functional.normalize(up, dim=-1, eps=1e-10) + vec_n = normalize(vec, dim=-1, eps=1e-10) + up_n = normalize(up, dim=-1, eps=1e-10) s_n = torch.cross(up_n, vec_n, dim=-1) u_n = torch.cross(vec_n, s_n, dim=-1) diff --git a/tests/test_robot_states_flatcache.py b/tests/test_robot_states_flatcache.py index 82d42db7f..10c4a4c45 100644 --- a/tests/test_robot_states_flatcache.py +++ b/tests/test_robot_states_flatcache.py @@ -61,7 +61,7 @@ def camera_pose_test(flatcache): relative_pose_transform(sensor_world_pos, sensor_world_ori, robot_world_pos, robot_world_ori) ) - sensor_world_pos_gt = th.tensor([150.1620, 149.9999, 101.2193]) + sensor_world_pos_gt = th.tensor([150.1628, 149.9993, 101.3773]) sensor_world_ori_gt = th.tensor([-0.2952, 0.2959, 0.6427, -0.6421]) assert th.allclose(sensor_world_pos, sensor_world_pos_gt, atol=1e-3) From af22859c33bc04be3d0b8e7f201a26c66dc9bad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 15:26:49 -0800 Subject: [PATCH 16/27] Do cuda install, curobo build, and cuda uninstall in a single step --- docker/prod.Dockerfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index c3c08c66b..94eb92e0b 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -19,12 +19,6 @@ ENV OMNIGIBSON_ASSET_PATH /data/assets ENV GIBSON_DATASET_PATH /data/g_dataset ENV OMNIGIBSON_KEY_PATH /data/omnigibson.key -# Install cuda for compiling curobo -RUN wget --no-verbose -O /cuda.run https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \ - sh /cuda.run --silent --toolkit && rm /cuda.run -ENV PATH=/usr/local/cuda-11.8/bin:$PATH -ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH - # 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 @@ -39,14 +33,20 @@ RUN micromamba run -n omnigibson micromamba install \ # Install curobo. This can normally be installed when OmniGibson is pip # installed, but we need to install it beforehand here so that it doesn't # have to happen on every time a CI action is run (otherwise it's just -# very slow) +# very slow). +# This also allows us to uninstall the cuda toolkit after curobo is built +# to save space (meaning curobo will not be able to be rebuilt at runtime). # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. # We also suppress the output of the installation to avoid the log limit. -RUN TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' \ - micromamba run -n omnigibson pip install \ - git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo \ - --no-build-isolation > /dev/null +RUN wget --no-verbose -O /cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i /cuda-keyring.deb && rm /cuda-keyring.deb && apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y cuda-toolkit-11-8 && \ + TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' PATH=/usr/local/cuda-11.8/bin:$PATH LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH \ + micromamba run -n omnigibson pip install \ + git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo \ + --no-build-isolation > /dev/null && \ + apt-get remove -y cuda-toolkit && apt-get autoremove -y && apt-get autoclean -y && rm -rf /var/lib/apt/lists/* # Make sure isaac gets properly sourced every time omnigibson gets called ARG CONDA_ACT_FILE="/micromamba/envs/omnigibson/etc/conda/activate.d/env_vars.sh" From 2d6eca3e5920fc8159ed79d0c22222c04d98f2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 15:34:35 -0800 Subject: [PATCH 17/27] Keep running builds on branch for testing --- .github/workflows/build-push-containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 334f2bf47..cd1d22787 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -7,6 +7,7 @@ on: branches: - 'main' - 'og-develop' + - 'docker-cuda-install-first' jobs: docker: From 5e06cb736c8702ccd2ea171cb13c05571ee72a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 15:57:20 -0800 Subject: [PATCH 18/27] Update prod.Dockerfile --- docker/prod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 94eb92e0b..7c1ad24e3 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -46,7 +46,7 @@ RUN wget --no-verbose -O /cuda-keyring.deb https://developer.download.nvidia.com micromamba run -n omnigibson pip install \ git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo \ --no-build-isolation > /dev/null && \ - apt-get remove -y cuda-toolkit && apt-get autoremove -y && apt-get autoclean -y && rm -rf /var/lib/apt/lists/* + apt-get remove -y cuda-toolkit-11-8 && apt-get autoremove -y && apt-get autoclean -y && rm -rf /var/lib/apt/lists/* # Make sure isaac gets properly sourced every time omnigibson gets called ARG CONDA_ACT_FILE="/micromamba/envs/omnigibson/etc/conda/activate.d/env_vars.sh" From 0de5cabb587a1414fea3e057d670b810f902f580 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 16:33:00 -0800 Subject: [PATCH 19/27] updated curobo version to include voxelization improvements --- docker/prod.Dockerfile | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index 0b9a99fc8..bd3329d62 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -43,7 +43,7 @@ ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH # Here we also compile this such that it is compatible with GPU architectures # Turing, Ampere, and Ada; which correspond to 20, 30, and 40 series GPUs. RUN TORCH_CUDA_ARCH_LIST='7.5;8.0;8.6+PTX' \ - micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5#egg=nvidia_curobo --no-build-isolation + micromamba run -n omnigibson pip install git+https://github.com/StanfordVL/curobo@6a4eb2ca8677829b0f57451ad107e0a3186525e9#egg=nvidia_curobo --no-build-isolation # Make sure isaac gets properly sourced every time omnigibson gets called ARG CONDA_ACT_FILE="/micromamba/envs/omnigibson/etc/conda/activate.d/env_vars.sh" diff --git a/setup.py b/setup.py index 45a13272b..bdc985bf5 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ "telemoma~=0.1.2", ], "primitives": [ - "nvidia-curobo @ git+https://github.com/StanfordVL/curobo@06d8c79b660db60c2881e9319e60899cbde5c5b5", + "nvidia-curobo @ git+https://github.com/StanfordVL/curobo@6a4eb2ca8677829b0f57451ad107e0a3186525e9", "ompl @ https://storage.googleapis.com/gibson_scenes/ompl-1.6.0-cp310-cp310-manylinux_2_28_x86_64.whl", ], }, From c76a9efe368b7161eb752374092e8bfd786e0e70 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 16:34:04 -0800 Subject: [PATCH 20/27] only bypass_physics=True for test_curobo (set joint positions, rather than executing) --- tests/test_curobo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_curobo.py b/tests/test_curobo.py index 756edafaf..90090ca75 100644 --- a/tests/test_curobo.py +++ b/tests/test_curobo.py @@ -386,7 +386,8 @@ def test_curobo(): [0.01 if joint.joint_type == "PrismaticJoint" else 3.0 / 180.0 * math.pi for joint in robot.joints.values()] ) - for bypass_physics in [True, False]: + # for bypass_physics in [True, False]: + for bypass_physics in [True]: for traj_idx, (success, traj_path) in enumerate(zip(successes, traj_paths)): if not success: continue From f1a210ed8b2979df90e88260c69ef36dd3983472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 17:04:58 -0800 Subject: [PATCH 21/27] Improve caching by putting the cache on a shared tag on the registry --- .github/workflows/build-push-containers.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index cd1d22787..7122abf03 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -108,8 +108,8 @@ jobs: tags: ${{ steps.meta-prod.outputs.tags }} labels: ${{ steps.meta-prod.outputs.labels }} file: docker/prod.Dockerfile - cache-from: type=registry,ref=stanfordvl/omnigibson:og-develop - cache-to: type=inline + cache-from: type=registry,ref=stanfordvl/omnigibson:build-cache + cache-to: type=registry,ref=stanfordvl/omnigibson:build-cache,mode=max - name: Build and push dev image @@ -122,8 +122,8 @@ jobs: tags: ${{ steps.meta-dev.outputs.tags }} labels: ${{ steps.meta-dev.outputs.labels }} file: docker/prod.Dockerfile - cache-from: type=registry,ref=stanfordvl/omnigibson:og-develop # OK to share cache here. - cache-to: type=inline + cache-from: type=registry,ref=stanfordvl/omnigibson:build-cache # OK to share cache here. + cache-to: type=registry,ref=stanfordvl/omnigibson:build-cache,mode=max - name: Update vscode image Dockerfile with prod image tag run: | From afcc44e624fe053e3e6af3fde0fc5abe19c3cfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 17:16:57 -0800 Subject: [PATCH 22/27] Add the actions image to also be built by github actions. Inception! --- .github/workflows/build-push-containers.yml | 33 +++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 7122abf03..f17f34112 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -98,6 +98,15 @@ jobs: tags: | type=ref,event=branch type=semver,pattern={{version}} + - + name: Metadata for actions Image + id: meta-actions + uses: docker/metadata-action@v5 + # The actions image should only be built if the push is to og-develop + if: github.ref == 'refs/heads/og-develop' + with: + images: | + stanfordvl/omnigibson-gha - name: Build and push prod image id: build-prod @@ -138,5 +147,25 @@ jobs: tags: ${{ steps.meta-vscode.outputs.tags }} labels: ${{ steps.meta-vscode.outputs.labels }} file: docker/vscode.Dockerfile - cache-from: type=registry,ref=stanfordvl/omnigibson:og-develop # OK to share cache here. - cache-to: type=inline + cache-from: type=registry,ref=stanfordvl/omnigibson:build-cache # OK to share cache here. + cache-to: type=registry,ref=stanfordvl/omnigibson:build-cache,mode=max + + - name: Update actions image Dockerfile with dev image tag + # The actions image should only be built if the push is to og-develop + if: github.ref == 'refs/heads/og-develop' + run: | + sed -i "s/omnigibson-dev:og-develop/omnigibson-dev@${{ steps.build-dev.outputs.digest }}/g" docker/gh-actions/Dockerfile && cat docker/gh-actions/Dockerfile + - + name: Build and push actions image + id: build-actions + uses: docker/build-push-action@v5 + # The actions image should only be built if the push is to og-develop + if: github.ref == 'refs/heads/og-develop' + with: + context: docker/gh-actions + push: true + tags: latest # here we only push from og-develop, and only to the `latest` tag + labels: ${{ steps.meta-actions.outputs.labels }} + file: docker/gh-actions/Dockerfile + cache-from: type=registry,ref=stanfordvl/omnigibson:build-cache # OK to share cache here. + cache-to: type=registry,ref=stanfordvl/omnigibson:build-cache,mode=max \ No newline at end of file From 45b740356c5b563c76c6f78752b6c25071cd91a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 17:46:53 -0800 Subject: [PATCH 23/27] Temporarily build the actions image too for testing --- .github/workflows/build-push-containers.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index f17f34112..64e945bc0 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -103,7 +103,7 @@ jobs: id: meta-actions uses: docker/metadata-action@v5 # The actions image should only be built if the push is to og-develop - if: github.ref == 'refs/heads/og-develop' + # if: github.ref == 'refs/heads/og-develop' with: images: | stanfordvl/omnigibson-gha @@ -152,7 +152,7 @@ jobs: - name: Update actions image Dockerfile with dev image tag # The actions image should only be built if the push is to og-develop - if: github.ref == 'refs/heads/og-develop' + # if: github.ref == 'refs/heads/og-develop' run: | sed -i "s/omnigibson-dev:og-develop/omnigibson-dev@${{ steps.build-dev.outputs.digest }}/g" docker/gh-actions/Dockerfile && cat docker/gh-actions/Dockerfile - @@ -160,7 +160,7 @@ jobs: id: build-actions uses: docker/build-push-action@v5 # The actions image should only be built if the push is to og-develop - if: github.ref == 'refs/heads/og-develop' + # if: github.ref == 'refs/heads/og-develop' with: context: docker/gh-actions push: true From c67bd6e7b24fcbe07dbffe60315e67601c311d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 18:57:01 -0800 Subject: [PATCH 24/27] Update build-push-containers.yml --- .github/workflows/build-push-containers.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index 64e945bc0..a41f18444 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -107,6 +107,9 @@ jobs: with: images: | stanfordvl/omnigibson-gha + tags: | + # We only push to the latest tag for the actions image + type=raw,value=latest - name: Build and push prod image id: build-prod @@ -164,7 +167,7 @@ jobs: with: context: docker/gh-actions push: true - tags: latest # here we only push from og-develop, and only to the `latest` tag + tags: ${{ steps.meta-actions.outputs.tags }} labels: ${{ steps.meta-actions.outputs.labels }} file: docker/gh-actions/Dockerfile cache-from: type=registry,ref=stanfordvl/omnigibson:build-cache # OK to share cache here. From 4ed25e9eae94d7668f493e6abf46e97d36351389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Thu, 21 Nov 2024 19:01:16 -0800 Subject: [PATCH 25/27] Get ready to productionize --- .github/workflows/build-push-containers.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-push-containers.yml b/.github/workflows/build-push-containers.yml index a41f18444..b415fbe37 100644 --- a/.github/workflows/build-push-containers.yml +++ b/.github/workflows/build-push-containers.yml @@ -7,7 +7,6 @@ on: branches: - 'main' - 'og-develop' - - 'docker-cuda-install-first' jobs: docker: @@ -103,7 +102,7 @@ jobs: id: meta-actions uses: docker/metadata-action@v5 # The actions image should only be built if the push is to og-develop - # if: github.ref == 'refs/heads/og-develop' + if: github.ref == 'refs/heads/og-develop' with: images: | stanfordvl/omnigibson-gha @@ -155,7 +154,7 @@ jobs: - name: Update actions image Dockerfile with dev image tag # The actions image should only be built if the push is to og-develop - # if: github.ref == 'refs/heads/og-develop' + if: github.ref == 'refs/heads/og-develop' run: | sed -i "s/omnigibson-dev:og-develop/omnigibson-dev@${{ steps.build-dev.outputs.digest }}/g" docker/gh-actions/Dockerfile && cat docker/gh-actions/Dockerfile - @@ -163,7 +162,7 @@ jobs: id: build-actions uses: docker/build-push-action@v5 # The actions image should only be built if the push is to og-develop - # if: github.ref == 'refs/heads/og-develop' + if: github.ref == 'refs/heads/og-develop' with: context: docker/gh-actions push: true From 6775c45a70c9da060a36ea45be6025b8268496e9 Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 19:22:26 -0800 Subject: [PATCH 26/27] reduce batch size for test_curobo to save gpu memory --- tests/test_curobo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_curobo.py b/tests/test_curobo.py index 90090ca75..de234ae3c 100644 --- a/tests/test_curobo.py +++ b/tests/test_curobo.py @@ -228,7 +228,7 @@ def test_curobo(): env.scene.reset() # Create CuRobo instance - batch_size = 10 + batch_size = 2 n_samples = 30 cmg = CuRoboMotionGenerator( From 8799c6002999e48f7afeb9c7de129a8528ce7a9d Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Thu, 21 Nov 2024 22:37:41 -0800 Subject: [PATCH 27/27] fix test curobo (R1 base is still too small, will fix later) --- tests/test_curobo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_curobo.py b/tests/test_curobo.py index de234ae3c..e0e3b45be 100644 --- a/tests/test_curobo.py +++ b/tests/test_curobo.py @@ -229,7 +229,7 @@ def test_curobo(): # Create CuRobo instance batch_size = 2 - n_samples = 30 + n_samples = 20 cmg = CuRoboMotionGenerator( robot=robot,