Skip to content

Commit

Permalink
Merge branch 'fix/contact-checking' of https://github.com/StanfordVL/…
Browse files Browse the repository at this point in the history
…OmniGibson into fix/contact-checking
  • Loading branch information
hang-yin committed Oct 21, 2024
2 parents 3e0e78d + a0b86c5 commit 8fb9fdf
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 92 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/build-push-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ jobs:
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
-
name: Metadata for dev Image
id: meta-dev
uses: docker/metadata-action@v5
with:
images: |
stanfordvl/omnigibson-dev
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
-
name: Metadata for vscode Image
id: meta-vscode
Expand All @@ -97,8 +107,22 @@ jobs:
tags: ${{ steps.meta-prod.outputs.tags }}
labels: ${{ steps.meta-prod.outputs.labels }}
file: docker/prod.Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=min
cache-from: type=registry,ref=stanfordvl/omnigibson:og-develop
cache-to: type=inline

-
name: Build and push dev image
id: build-dev
uses: docker/build-push-action@v5
with:
context: .
build-args: "DEV_MODE=1"
push: true
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

- name: Update vscode image Dockerfile with prod image tag
run: |
Expand All @@ -113,5 +137,5 @@ jobs:
tags: ${{ steps.meta-vscode.outputs.tags }}
labels: ${{ steps.meta-vscode.outputs.labels }}
file: docker/vscode.Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=min
cache-from: type=registry,ref=stanfordvl/omnigibson:og-develop # OK to share cache here.
cache-to: type=inline
24 changes: 5 additions & 19 deletions .github/workflows/examples-as-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,10 @@ jobs:
with:
submodules: true
path: omnigibson-src

# These are temporarily disabled due to some errors they cause where some
# unknown important dependency has its version changed and Isaac Sim will
# no longer launch properly. The result is that if dependencies change,
# the tests will stop working. This is a temporary fix until we can figure
# out how to fix this issue.

# - name: Install dev requirements
# working-directory: omnigibson-src
# run: pip install -r requirements-dev.txt

# - name: Install
# working-directory: omnigibson-src
# run: pip install -e .

- name: Install
working-directory: omnigibson-src
run: pip install -e .[dev]

- name: Generate example tests
working-directory: omnigibson-src
Expand Down Expand Up @@ -84,13 +74,9 @@ jobs:
submodules: true
path: omnigibson-src

- name: Install dev requirements
working-directory: omnigibson-src
run: pip install -r requirements-dev.txt

- name: Install
working-directory: omnigibson-src
run: pip install -e .
run: pip install -e .[dev]

- name: Run tests
working-directory: omnigibson-src
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,9 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3

# These are temporarily disabled due to some errors they cause where some
# unknown important dependency has its version changed and Isaac Sim will
# no longer launch properly. The result is that if dependencies change,
# the tests will stop working. This is a temporary fix until we can figure
# out how to fix this issue.

# - name: Install dev requirements
# working-directory: omnigibson-src
# run: pip install -r requirements-dev.txt

# - name: Install
# working-directory: omnigibson-src
# run: pip install -e .
- name: Install
working-directory: omnigibson-src
run: pip install -e .[dev]

- name: Run performance benchmark
run: bash scripts/profiling.sh
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,9 @@ jobs:
submodules: true
path: omnigibson-src

# These are temporarily disabled due to some errors they cause where some
# unknown important dependency has its version changed and Isaac Sim will
# no longer launch properly. The result is that if dependencies change,
# the tests will stop working. This is a temporary fix until we can figure
# out how to fix this issue.

# - name: Install dev requirements
# working-directory: omnigibson-src
# run: pip install -r requirements-dev.txt

# - name: Install
# working-directory: omnigibson-src
# run: pip install -e .
- name: Install
working-directory: omnigibson-src
run: pip install -e .[dev]

- name: Print env
run: printenv
Expand Down
8 changes: 8 additions & 0 deletions docker/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ docker build \
-f docker/prod.Dockerfile \
.

# Pass the DEV_MODE=1 arg to the docker build command to build the development image
docker build \
-t stanfordvl/omnigibson-dev:latest \
-t stanfordvl/omnigibson-dev:$(sed -ne "s/.*version= *['\"]\([^'\"]*\)['\"] *.*/\1/p" setup.py) \
-f docker/prod.Dockerfile \
--build-arg DEV_MODE=1 \
.

docker build \
-t stanfordvl/omnigibson-vscode:latest \
-f docker/vscode.Dockerfile \
Expand Down
4 changes: 2 additions & 2 deletions docker/gh-actions/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stanfordvl/omnigibson:og-develop
FROM stanfordvl/omnigibson-dev:og-develop

ARG DUMB_INIT_VERSION="1.2.2"
ARG GIT_CORE_PPA_KEY="A1715D88E1DF1F24"
Expand Down Expand Up @@ -99,7 +99,7 @@ RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir -p /opt/hostedtoolcache

ARG GH_RUNNER_VERSION="2.311.0"
ARG GH_RUNNER_VERSION="2.320.0"

ARG TARGETPLATFORM

Expand Down
21 changes: 16 additions & 5 deletions docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,28 @@ RUN micromamba run -n omnigibson /bin/bash --login -c 'source /isaac-sim/setup_c
# Test OMPL
RUN micromamba run -n omnigibson python -c "from ompl import base"

# Add setup to be executed on bash launch
RUN echo "OMNIGIBSON_NO_OMNIVERSE=1 python omnigibson/download_datasets.py" >> /root/.bashrc

# Copy over omnigibson source
ADD . /omnigibson-src
WORKDIR /omnigibson-src

# Set the shell
SHELL ["micromamba", "run", "-n", "omnigibson", "/bin/bash", "--login", "-c"]

# Install OmniGibson
RUN micromamba run -n omnigibson pip install -e .
# Optionally install OmniGibson (e.g. unless the DEV_MODE flag is set) or
# remove the OmniGibson source code if we are in dev mode and change the workdir
ARG DEV_MODE
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]; \
else \
WORKDIR_PATH=/; \
cd / && rm -rf /omnigibson-src; \
fi

# Reset the WORKDIR based on whether or not we are in dev mode
WORKDIR ${WORKDIR_PATH}

ENTRYPOINT ["micromamba", "run", "-n", "omnigibson"]
CMD ["/bin/bash"]
12 changes: 0 additions & 12 deletions requirements-dev.txt

This file was deleted.

55 changes: 35 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,46 @@
"gymnasium>=0.28.1",
"numpy<2.0.0,>=1.23.5",
"scipy>=1.10.1",
"GitPython~=3.1.40",
"transforms3d~=0.4.1",
"networkx~=3.2.1",
"PyYAML~=6.0.1",
"addict~=2.4.0",
"ipython~=8.20.0",
"future~=0.18.3",
"trimesh~=4.0.8",
"h5py~=3.10.0",
"cryptography~=41.0.7",
"GitPython>=3.1.40",
"transforms3d>=0.4.1",
"networkx>=3.2.1",
"PyYAML>=6.0.1",
"addict>=2.4.0",
"ipython>=8.20.0",
"future>=0.18.3",
"trimesh>=4.0.8",
"h5py>=3.10.0",
"cryptography>=41.0.7",
"bddl~=3.5.0",
"opencv-python>=4.8.1",
"nest_asyncio~=1.5.8",
"imageio~=2.33.1",
"imageio-ffmpeg~=0.4.9",
"termcolor~=2.4.0",
"progressbar~=2.5",
"nest_asyncio>=1.5.6",
"imageio>=2.33.1",
"imageio-ffmpeg>=0.4.9",
"termcolor>=2.4.0",
"progressbar>=2.5",
"pymeshlab~=2022.2",
"click~=8.1.3",
"aenum~=3.1.15",
"rtree~=1.2.0",
"graphviz~=0.20",
"click>=8.1.3",
"aenum>=3.1.15",
"rtree>=1.2.0",
"graphviz>=0.20",
"matplotlib>=3.0.0",
],
extras_require={},
extras_require={
"dev": [
"pytest>=6.2.3",
"pytest-cov>=3.0.0",
"pytest_rerunfailures",
"mkdocs",
"mkdocs-autorefs",
"mkdocs-gen-files",
"mkdocs-material",
"mkdocs-material-extensions",
"mkdocstrings[python]",
"mkdocs-section-index",
"mkdocs-literate-nav",
"telemoma~=0.1.2",
]
},
tests_require=[],
python_requires=">=3",
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_quat_slerp(self):
key_rots = R.from_quat(np.stack([q1.cpu().numpy(), q2.cpu().numpy()]))
key_times = [0, 1]
slerp = Slerp(key_times, key_rots)
scipy_q_slerp = slerp(t).as_quat()[0].astype(NumpyTypes.FLOAT32)
scipy_q_slerp = slerp([t.item()]).as_quat()[0].astype(NumpyTypes.FLOAT32)

assert quaternions_close(q_slerp, th.from_numpy(scipy_q_slerp))
assert_close(th.norm(q_slerp), th.tensor(1.0))
Expand Down
21 changes: 18 additions & 3 deletions tests/test_transition_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,12 @@ def test_mixing_rule_failure_recipe_systems(env):
assert lemonade.n_particles == 0
assert sludge.n_particles == 0

tablespoon.set_position_orientation(position=[0.04, 0.0, 0.08], orientation=[0, 0, 0, 1])
# Move the tablespoon to touch the bowl
tablespoon.set_position_orientation(
position=[0.10, 0.0, 0.01], orientation=T.euler2quat(th.tensor([0.0, math.pi / 2, 0.0]))
)
tablespoon.keep_still()
tablespoon.set_linear_velocity(th.tensor([-1.0, 0.0, 0.0]))
og.sim.step()

assert tablespoon.states[Touching].get_value(bowl)
Expand Down Expand Up @@ -510,7 +515,12 @@ def test_mixing_rule_failure_nonrecipe_systems(env):
assert lemonade.n_particles == 0
assert sludge.n_particles == 0

tablespoon.set_position_orientation(position=[0.04, 0.0, 0.08], orientation=[0, 0, 0, 1])
# Move the tablespoon to touch the bowl
tablespoon.set_position_orientation(
position=[0.10, 0.0, 0.01], orientation=T.euler2quat(th.tensor([0.0, math.pi / 2, 0.0]))
)
tablespoon.keep_still()
tablespoon.set_linear_velocity(th.tensor([-1.0, 0.0, 0.0]))
og.sim.step()

assert tablespoon.states[Touching].get_value(bowl)
Expand Down Expand Up @@ -550,7 +560,12 @@ def test_mixing_rule_success(env):

assert lemonade.n_particles == 0

tablespoon.set_position_orientation(position=[0.04, 0.0, 0.08], orientation=[0, 0, 0, 1])
# Move the tablespoon to touch the bowl
tablespoon.set_position_orientation(
position=[0.10, 0.0, 0.01], orientation=T.euler2quat(th.tensor([0.0, math.pi / 2, 0.0]))
)
tablespoon.keep_still()
tablespoon.set_linear_velocity(th.tensor([-1.0, 0.0, 0.0]))
og.sim.step()

assert tablespoon.states[Touching].get_value(bowl)
Expand Down

0 comments on commit 8fb9fdf

Please sign in to comment.