Skip to content

Commit

Permalink
Merge pull request #979 from StanfordVL/docker-fixes
Browse files Browse the repository at this point in the history
Re-create dev docker image and remove requirements-dev.txt
  • Loading branch information
cgokmen authored Oct 16, 2024
2 parents 255a4e4 + 1d780c9 commit f786978
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 67 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
10 changes: 7 additions & 3 deletions docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ WORKDIR /omnigibson-src

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)
ARG DEV_MODE
ENV DEV_MODE=${DEV_MODE}
RUN if [ "$DEV_MODE" != "1" ]; then \
micromamba run -n omnigibson pip install -e .[dev]; \
fi

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

This file was deleted.

17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,22 @@
"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

0 comments on commit f786978

Please sign in to comment.