Repository navigation
[ci] Install data CI depset after conda ffmpeg to fix removed packages - #65334
Conversation
The conda solve for ffmpeg=7 in the data CI image build downgrades conda (26.7.0 -> 23.9.0 with the current oss-ci-base_ml base image) and removes its dependency stack from the miniforge env, including exceptiongroup, jinja2, markupsafe, httpx and typing-inspection. exceptiongroup is a hard runtime dependency of pytest on Python < 3.11, so every pytest target in data17build-py3.10 based jobs fails at import time. Install the python depset lock after the conda step so uv restores everything the lock declares. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: elliot-barn <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request moves the installation of the Python dependency lock and the nightly pyarrow package to run after the Conda FFmpeg installation in the Dockerfile, ensuring that Conda's dependency resolution does not downgrade or remove required Python packages. The reviewer suggested a cache optimization to split the RUN block and defer the COPY of the lockfile, preventing frequent lockfile updates from invalidating the cache for the slow MongoDB and FFmpeg installation steps.
| # The conda solve above can remove or downgrade python packages in the | ||
| # miniforge env (e.g. exceptiongroup, jinja2) while satisfying ffmpeg's | ||
| # constraints, so the depset must be installed after it to keep the env | ||
| # matching the lock. | ||
| uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match | ||
|
|
||
| if [[ "$IMAGE_TYPE" == "pyarrow-nightly" ]]; then | ||
| uv pip install \ | ||
| --system \ | ||
| --prerelease allow \ | ||
| --extra-index-url https://pypi.fury.io/arrow-nightlies/ \ | ||
| --upgrade-package pyarrow \ | ||
| pyarrow | ||
| fi |
There was a problem hiding this comment.
Cache Optimization: Split RUN block and defer COPY
Currently, COPY $PYTHON_DEPSET /home/ray/python_depset.lock is executed at line 11, before the large RUN block that installs MongoDB and FFmpeg via Conda. Because of this, any change to the Python dependency lockfile (which happens frequently) invalidates the Docker build cache for these slow installation steps.
By splitting the RUN block and moving the COPY instruction right before the uv pip install step, we can ensure that changes to the Python lockfile do not trigger a rebuild of the MongoDB and Conda FFmpeg layers, significantly speeding up CI image builds.
Note: Please also remove the COPY $PYTHON_DEPSET /home/ray/python_depset.lock instruction at line 11 of the Dockerfile to avoid redundant copying and cache invalidation.
EOF
COPY $PYTHON_DEPSET /home/ray/python_depset.lock
RUN <<EOF
#!/bin/bash
set -ex
# The conda solve above can remove or downgrade python packages in the
# miniforge env (e.g. exceptiongroup, jinja2) while satisfying ffmpeg's
# constraints, so the depset must be installed after it to keep the env
# matching the lock.
uv pip install -r /home/ray/python_depset.lock --no-deps --system --index-strategy unsafe-best-match
if [[ "$IMAGE_TYPE" == "pyarrow-nightly" ]]; then
uv pip install \
--system \
--prerelease allow \
--extra-index-url https://pypi.fury.io/arrow-nightlies/ \
--upgrade-package pyarrow \
pyarrow
fi
andrewsykim
left a comment
There was a problem hiding this comment.
Thanks for the fix.
Seems like the culprit was #63821 which was merged about a month ago. Do we know why it only started to fail recently?
|
fixes #65323 |
…removals The conda ffmpeg solve can delete files of packages whose dist-info still matches the lock: when the base image build replaced a version-mismatched conda package with the pip copy (e.g. conda msgpack-python 1.2.1 -> pip msgpack 1.1.2), conda-meta keeps a stale entry, and removing it deletes pip's files while the dist-info survives. uv --no-deps then skips the package even though its files are gone, breaking import ray in datamongobuild (microcheck 51856). --reinstall makes uv lay down every locked package unconditionally. TODO left to isolate ffmpeg in its own conda env so the solve cannot touch base site-packages at all. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: elliot-barn <[email protected]>
|
Second commit adds Mechanism: conda and pip share site-packages but keep independent ledgers. During the base_ml build, uv replaced version-mismatched conda copies (conda Also noteworthy: the ffmpeg solve is non-deterministic across builds — in the same microcheck run, |
Here are the events (claude generated) |
…o fix removed packages (#65334) (#65341) Cherry-pick of #65334 (master commit 4283d39) onto `releases/2.58.0`. ## Why are these changes needed? Same as #65334: `data17build-py3.10`-based CI jobs (data arrow v17 shards, docs example, integration, dashboard) fail with `ModuleNotFoundError: No module named 'exceptiongroup'` because the conda ffmpeg install step removes packages from the data CI depset. The release branch carries the same Dockerfile ordering, so its data CI is subject to the same breakage — this keeps 2.58.0 release CI green. ## Notes - Clean cherry-pick, no conflicts (`git cherry-pick -x -s`); diff is identical to the master commit (1 file, +22/−11). - No existing open PR cherry-picks #65334 to this branch (checked via `gh pr list --search`). - Original change and this cherry-pick were AI-assisted (Claude Code); submitted and reviewed by @elliot-barn. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
ray-project#65334) ## Why are these changes needed? All `data17build-py3.10`-based CI jobs (data arrow v17 shards, docs example, integration, dashboard) are currently red on master and premerge with: ``` import pytest → from exceptiongroup import BaseExceptionGroup ModuleNotFoundError: No module named 'exceptiongroup' ``` e.g. master postmerge [build 19099](https://buildkite.com/ray-project/postmerge/builds/19099) and premerge [build 71680](https://buildkite.com/ray-project/premerge/builds/71680). Root cause: in `ci/docker/data.build.Dockerfile`, the depset lock is installed **before** `conda install -y -c conda-forge "ffmpeg=7.*"`. With the current `oss-ci-base_ml` base image (which ships conda 26.7.0), the ffmpeg solve upgrades core native libs (libmamba 2.0.8 → 2.9.0, libarchive, libcurl, fmt), and since no conda 26.x py3.10 build is compatible with that upgraded stack, the solver **downgrades conda 26.7.0 → 23.9.0 and removes conda 26's entire python dependency tree** — including `exceptiongroup`, `jinja2`, `markupsafe`, `httpx` and `typing-inspection` (visible under "The following packages will be REMOVED" in the wanda `data17build-py3.10` job log). `exceptiongroup` is a hard runtime dep of pytest on Python < 3.11, so every pytest target import-fails. Fix: move the `uv pip install -r python_depset.lock` step (and the pyarrow-nightly override) **after** the conda ffmpeg step, so uv restores everything the lock declares. All five data depset locks contain the removed packages (`exceptiongroup` with a `python_full_version < '3.11'` marker, so py3.12 images are unaffected by design). Not a duplicate: searched open PRs for `exceptiongroup`, `ffmpeg conda`, and data image/depset changes — no existing PR addresses this. ## Related issue number N/A — master CI breakage, no issue filed. ## Checks - Verification: this is a CI image build-order change; validated by triaging the wanda `data17build-py3.10` build logs (conda removal transaction) and confirming the removed packages are present in all `python/deplocks/ci/data-*` locks. The premerge data jobs on this PR rebuild the image and are the end-to-end test. - `pre-commit` hooks ran and passed on commit. - AI assistance (Claude Code) was used for triage and this change; reviewed line-by-line by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
ray-project#65334) ## Why are these changes needed? All `data17build-py3.10`-based CI jobs (data arrow v17 shards, docs example, integration, dashboard) are currently red on master and premerge with: ``` import pytest → from exceptiongroup import BaseExceptionGroup ModuleNotFoundError: No module named 'exceptiongroup' ``` e.g. master postmerge [build 19099](https://buildkite.com/ray-project/postmerge/builds/19099) and premerge [build 71680](https://buildkite.com/ray-project/premerge/builds/71680). Root cause: in `ci/docker/data.build.Dockerfile`, the depset lock is installed **before** `conda install -y -c conda-forge "ffmpeg=7.*"`. With the current `oss-ci-base_ml` base image (which ships conda 26.7.0), the ffmpeg solve upgrades core native libs (libmamba 2.0.8 → 2.9.0, libarchive, libcurl, fmt), and since no conda 26.x py3.10 build is compatible with that upgraded stack, the solver **downgrades conda 26.7.0 → 23.9.0 and removes conda 26's entire python dependency tree** — including `exceptiongroup`, `jinja2`, `markupsafe`, `httpx` and `typing-inspection` (visible under "The following packages will be REMOVED" in the wanda `data17build-py3.10` job log). `exceptiongroup` is a hard runtime dep of pytest on Python < 3.11, so every pytest target import-fails. Fix: move the `uv pip install -r python_depset.lock` step (and the pyarrow-nightly override) **after** the conda ffmpeg step, so uv restores everything the lock declares. All five data depset locks contain the removed packages (`exceptiongroup` with a `python_full_version < '3.11'` marker, so py3.12 images are unaffected by design). Not a duplicate: searched open PRs for `exceptiongroup`, `ffmpeg conda`, and data image/depset changes — no existing PR addresses this. ## Related issue number N/A — master CI breakage, no issue filed. ## Checks - Verification: this is a CI image build-order change; validated by triaging the wanda `data17build-py3.10` build logs (conda removal transaction) and confirming the removed packages are present in all `python/deplocks/ci/data-*` locks. The premerge data jobs on this PR rebuild the image and are the end-to-end test. - `pre-commit` hooks ran and passed on commit. - AI assistance (Claude Code) was used for triage and this change; reviewed line-by-line by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> Signed-off-by: 400Ping <[email protected]>
…moved packages (#65334) (#66619) ## Why are these changes needed? Cherry-pick of #65334 onto `releases/2.57.1`. Data CI jobs built on the `data17build-py3.10` image (arrow v17 shards, doc, integration and dashboard tests) fail on this branch with: ``` import pytest -> from exceptiongroup import BaseExceptionGroup ModuleNotFoundError: No module named 'exceptiongroup' ``` `ci/docker/data.build.Dockerfile` installs the depset lock before `conda install ffmpeg=7.*`, and the ffmpeg solve removes conda's python dependencies (`exceptiongroup`, `jinja2`, `markupsafe`, `httpx`). #65334 installs the lock after the ffmpeg step, with `--reinstall`, so the env matches the lock again. The fix is already on master, `releases/2.58.0`, `releases/2.58.1` and `releases/2.59.0`. `releases/2.57.1` is the only active release branch still missing it. The rayturbo `releases-2.57.1` merge build hits it: https://buildkite.com/anyscale/rayturbo/builds/14415 The cherry-pick applied cleanly with no conflicts. ## Related issue number N/A. Cherry-pick of #65334. ## Checks - [x] I've signed off every commit (DCO). - The premerge data jobs on this PR rebuild the image and are the end-to-end test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
ray-project#65334) ## Why are these changes needed? All `data17build-py3.10`-based CI jobs (data arrow v17 shards, docs example, integration, dashboard) are currently red on master and premerge with: ``` import pytest → from exceptiongroup import BaseExceptionGroup ModuleNotFoundError: No module named 'exceptiongroup' ``` e.g. master postmerge [build 19099](https://buildkite.com/ray-project/postmerge/builds/19099) and premerge [build 71680](https://buildkite.com/ray-project/premerge/builds/71680). Root cause: in `ci/docker/data.build.Dockerfile`, the depset lock is installed **before** `conda install -y -c conda-forge "ffmpeg=7.*"`. With the current `oss-ci-base_ml` base image (which ships conda 26.7.0), the ffmpeg solve upgrades core native libs (libmamba 2.0.8 → 2.9.0, libarchive, libcurl, fmt), and since no conda 26.x py3.10 build is compatible with that upgraded stack, the solver **downgrades conda 26.7.0 → 23.9.0 and removes conda 26's entire python dependency tree** — including `exceptiongroup`, `jinja2`, `markupsafe`, `httpx` and `typing-inspection` (visible under "The following packages will be REMOVED" in the wanda `data17build-py3.10` job log). `exceptiongroup` is a hard runtime dep of pytest on Python < 3.11, so every pytest target import-fails. Fix: move the `uv pip install -r python_depset.lock` step (and the pyarrow-nightly override) **after** the conda ffmpeg step, so uv restores everything the lock declares. All five data depset locks contain the removed packages (`exceptiongroup` with a `python_full_version < '3.11'` marker, so py3.12 images are unaffected by design). Not a duplicate: searched open PRs for `exceptiongroup`, `ffmpeg conda`, and data image/depset changes — no existing PR addresses this. ## Related issue number N/A — master CI breakage, no issue filed. ## Checks - Verification: this is a CI image build-order change; validated by triaging the wanda `data17build-py3.10` build logs (conda removal transaction) and confirming the removed packages are present in all `python/deplocks/ci/data-*` locks. The premerge data jobs on this PR rebuild the image and are the end-to-end test. - `pre-commit` hooks ran and passed on commit. - AI assistance (Claude Code) was used for triage and this change; reviewed line-by-line by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
Why are these changes needed?
All
data17build-py3.10-based CI jobs (data arrow v17 shards, docs example, integration, dashboard) are currently red on master and premerge with:e.g. master postmerge build 19099 and premerge build 71680.
Root cause: in
ci/docker/data.build.Dockerfile, the depset lock is installed beforeconda install -y -c conda-forge "ffmpeg=7.*". With the currentoss-ci-base_mlbase image (which ships conda 26.7.0), the ffmpeg solve upgrades core native libs (libmamba 2.0.8 → 2.9.0, libarchive, libcurl, fmt), and since no conda 26.x py3.10 build is compatible with that upgraded stack, the solver downgrades conda 26.7.0 → 23.9.0 and removes conda 26's entire python dependency tree — includingexceptiongroup,jinja2,markupsafe,httpxandtyping-inspection(visible under "The following packages will be REMOVED" in the wandadata17build-py3.10job log).exceptiongroupis a hard runtime dep of pytest on Python < 3.11, so every pytest target import-fails.Fix: move the
uv pip install -r python_depset.lockstep (and the pyarrow-nightly override) after the conda ffmpeg step, so uv restores everything the lock declares. All five data depset locks contain the removed packages (exceptiongroupwith apython_full_version < '3.11'marker, so py3.12 images are unaffected by design).Not a duplicate: searched open PRs for
exceptiongroup,ffmpeg conda, and data image/depset changes — no existing PR addresses this.Related issue number
N/A — master CI breakage, no issue filed.
Checks
data17build-py3.10build logs (conda removal transaction) and confirming the removed packages are present in allpython/deplocks/ci/data-*locks. The premerge data jobs on this PR rebuild the image and are the end-to-end test.pre-commithooks ran and passed on commit.🤖 Generated with Claude Code