chore(ci): decouple python deps from docker images#1380
Conversation
Greptile Summarydecouples python dependency installation from docker image builds by removing key changes:
architecture shift:
the change from installing specific extras to Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[pyproject.toml change] --> B{Before this PR}
A --> C{After this PR}
B --> D[Triggers python path filter]
D --> E[Rebuild python image<br/>uv pip install deps]
E --> F[Rebuild ros-python image]
F --> G[Rebuild dev image<br/>uv pip install dev]
G --> H[Rebuild ros-dev image]
H --> I[Run tests<br/>~1h total]
C --> J[No path filter match]
J --> K[Skip all image rebuilds]
K --> L[Tests run with existing image]
L --> M[uv sync --all-extras<br/>installs deps at runtime]
M --> N[Run tests<br/>~30s overhead]
style E fill:#ffcccc
style F fill:#ffcccc
style G fill:#ffcccc
style H fill:#ffcccc
style I fill:#ffcccc
style M fill:#ccffcc
style N fill:#ccffcc
Last reviewed commit: 732c15d |
|
@greptile check now |
.github/workflows/tests.yml
Outdated
| git config --global --add safe.directory '*' | ||
|
|
||
| - name: Install Python dependencies | ||
| run: uv sync --all-extras --frozen |
There was a problem hiding this comment.
--all-extras installs more dependencies than the old Dockerfiles ([misc,cpu,sim,drone,unitree,web,perception,visualization,manipulation,dev]). Now includes cuda, psql, dds, docker, base, agents etc. Consider using uv sync --extra misc --extra cpu ... to match the original scope if installation time exceeds ~30s.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
e953c1c to
a4de37d
Compare
moved python dep installation from docker build to test runtime. pyproject.toml changes no longer trigger image rebuilds. - docker/python/Dockerfile: removed COPY, uv pip install, pydrake stub deletion - docker/dev/Dockerfile: removed uv pip install .[dev] - docker.yml: removed pyproject.toml from python path filter, renamed job to run-tests/run-mypy - tests.yml: added uv sync --all-extras --no-extra dds --frozen, activate venv before running tests
a4de37d to
e0bda65
Compare
open3d leak fixed in #1386, workaround no longer needed. keeps venv activation since deps are now installed at test time.
Problem
python packages are baked into docker images at build time. any pyproject.toml change triggers a full rebuild cascade before tests can run. this burns ~1 hour of CI time unnecessarily.
Solution
moved python dep installation from dockerfile build to test runtime via
uv sync. now pyproject changes skip image rebuilds and install deps at test time instead (~30s vs ~1h).changes:
Breaking Changes
none
How to Test
expected: tests install deps via uv sync (~30s), no image rebuild
Contributor License Agreement