-
Notifications
You must be signed in to change notification settings - Fork 34
Change mapping image to debian #776
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
base: main
Are you sure you want to change the base?
Conversation
β¦ckerfile default
| # ========================= | ||
| # Runtime stage | ||
| FROM ubuntu:22.04 AS autocalibration-runtime | ||
| FROM python:3.11-slim-bookworm AS autocalibration-runtime |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Remediation tip: pin your Docker image by updating python:3.11-slim-bookworm to python:3.11-slim-bookworm@sha256:bcbbec29f7a3f9cbee891e3cd69d7fe4dec7e281daf36cbd415ddd8ee2ba0077
Click Remediation section below for further remediation help
|
|
||
| # ---------- Manager Runtime Stage ------------------ | ||
| FROM ubuntu:22.04 AS scenescape-manager-runtime | ||
| FROM python:3.11-slim-bookworm AS scenescape-manager-runtime |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Remediation tip: pin your Docker image by updating python:3.11-slim-bookworm to python:3.11-slim-bookworm@sha256:bcbbec29f7a3f9cbee891e3cd69d7fe4dec7e281daf36cbd415ddd8ee2ba0077
Click Remediation section below for further remediation help
| # STAGE 2: RUNTIME STAGE | ||
| # ========================= | ||
| FROM ubuntu:22.04 AS mapping-runtime | ||
| FROM python:3.11-slim-bookworm AS mapping-runtime |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Remediation tip: pin your Docker image by updating python:3.11-slim-bookworm to python:3.11-slim-bookworm@sha256:6e27de8d5ec0c03bfe010b6a1dac20366e5b4e3edd123d4c6f60e1c32f60db3f
Click Remediation section below for further remediation help
|
|
||
| # -------------- Common Base Stage -------------- | ||
| FROM ubuntu:22.04 AS scenescape-common-base | ||
| FROM python:3.11-slim-bookworm AS scenescape-common-base |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Remediation tip: pin your Docker image by updating python:3.11-slim-bookworm to python:3.11-slim-bookworm@sha256:bcbbec29f7a3f9cbee891e3cd69d7fe4dec7e281daf36cbd415ddd8ee2ba0077
Click Remediation section below for further remediation help
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r $SCENESCAPE_HOME/requirements_api.txt && \ | ||
| if [ "$MODEL_TYPE" = "mapanything" ]; then \ | ||
| cd /workspace/map-anything && \ | ||
| pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/vggt /workspace/mapping; \ | ||
| pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| elif [ "$MODEL_TYPE" = "vggt" ]; then \ | ||
| echo "Installing VGGT model..." && \ | ||
| cd /workspace/vggt && \ | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 torchaudio --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt && \ | ||
| pip install --no-cache-dir -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e . && \ | ||
| cd / && rm -rf /workspace/map-anything /workspace/mapping; \ | ||
| fi | ||
|
|
||
| # Copy on-demand model loader and dependencies | ||
| COPY mapping/tools/*.py /usr/local/bin/ | ||
|
|
||
| # Create directories and set permissions | ||
| RUN mkdir -p /workspace/model_weights $SCENESCAPE_HOME/outputs /workspace/.cache/torch /workspace/.cache/huggingface && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace && \ | ||
| chmod -R 1777 /workspace | ||
|
|
||
| # Create startup script that ensures model directory permissions and downloads models | ||
| WORKDIR $SCENESCAPE_HOME | ||
| pip install --no-cache-dir torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| pip install --no-cache-dir -r requirements.txt -r requirements_demo.txt && \ | ||
| pip install --no-cache-dir -e .; \ | ||
| fi && \ | ||
| rm -rf /usr/local/lib/python3.11/site-packages/torch/test \ | ||
| /usr/local/lib/python3.11/site-packages/torch/share \ | ||
| /usr/local/lib/python3.11/site-packages/torchvision/test 2>/dev/null || true && \ | ||
| chown -R $WSUSER:$WSUSER $SCENESCAPE_HOME /workspace |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
| RUN pip install --no-cache-dir -r /tmp/requirements-test.txt \ | ||
| && rm /tmp/requirements-test.txt |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
Click Remediation section below to solve this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the mapping controller's base image from Ubuntu 22.04 to Debian-based Python 3.11 slim (Bookworm). The change consolidates Python installation and optimizes the Dockerfile by reducing layers, removing redundant commands, and streamlining the build process for both MapAnything and VGGT models.
Changes:
- Base image changed from
ubuntu:22.04topython:3.11-slim-bookworm - Dockerfile refactored to combine multiple RUN commands into fewer layers
- Build process optimized to only clone the selected model type instead of cloning both
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mapping/Makefile | Updates RUNTIME_OS_IMAGE variable to use Python 3.11 Debian base image |
| mapping/Dockerfile | Refactors multi-stage build to optimize layers, removes Ubuntu-specific Python installation, consolidates RUN commands, and adjusts paths for Python 3.11 |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Set cache environment variables to use user directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted so these environment variables aren't set with ENV but in the shell script.
π Description
Changes base image of controller from ubuntu to Debian.
β¨ Type of Change
Select the type of change your PR introduces:
π§ͺ Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
β Checklist
Before submitting the PR, ensure the following: