Skip to content

fix(ci): avoid uv sync in image build - #644

Merged
delete-cloud merged 1 commit into
mainfrom
fix/docker-pip-install
Jun 27, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/docker-pip-install

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 27, 2026 •

Copy link
Copy Markdown
Owner

Summary\n- keep uv.lock as the runtime dependency source via uv export\n- install exported locked requirements with pip inside the image builder venv\n- avoid the Woodpecker/Kaniko uv sync path that stalled on large wheels\n\n## Verification\n- woodpecker-cli lint .woodpecker/ci.yml\n- git diff --check\n- uv export --frozen --no-dev --extra redis --no-emit-project --no-hashes --output-file /tmp/coding-agent-image-requirements.txt\n- docker build --target builder --build-arg PYTHON_BASE_IMAGE=python:3.12-slim --build-arg PIP_DEFAULT_TIMEOUT=120 --build-arg PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple --build-arg UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple -f coding-agent/Dockerfile coding-agent\n\n## Context\nWoodpecker main pipeline #155 was stopped after build-image spent 45+ minutes in uv sync with no image manifest produced. The same dependency set installs successfully through pip in roughly two minutes locally while still using versions exported from uv.lock.

Summary by CodeRabbit

  • Chores
    • Updated the app’s container setup to use a more standard Python dependency installation flow.
    • Improved dependency handling during image builds, which may make builds and runtime environments more reliable.

Export locked runtime requirements with uv, then install them with pip inside the image builder venv. This keeps uv.lock as the version source while avoiding the Woodpecker/Kaniko uv sync path that stalled on large wheels.\n\nVerification:\n- woodpecker-cli lint .woodpecker/ci.yml\n- git diff --check\n- uv export --frozen --no-dev --extra redis --no-emit-project --no-hashes --output-file /tmp/coding-agent-image-requirements.txt\n- docker build --target builder --build-arg PYTHON_BASE_IMAGE=python:3.12-slim --build-arg PIP_DEFAULT_TIMEOUT=120 --build-arg PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple --build-arg UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple -f coding-agent/Dockerfile coding-agent
@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Dockerfile builder stage drops UV_LINK_MODE=copy from its env vars and replaces the uv sync + uv pip install redis dependency installation with a venv-based workflow: create /app/.venv, export frozen no-dev requirements (including redis extra) via uv export, upgrade pip, install requirements, then install the project with pip --no-deps.

Changes

Dockerfile dependency install refactor

Layer / File(s) Summary
Env cleanup and venv+pip install workflow
coding-agent/Dockerfile
Removes UV_LINK_MODE=copy from the ENV block and replaces uv sync --frozen --no-dev + uv pip install redis with a sequence that creates /app/.venv, runs uv export (frozen, no-dev, redis extra) to /tmp/requirements.txt, upgrades pip, installs requirements via pip, and installs the project via pip --no-deps ..

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Poem

🐇 Hop, hop, away with uv sync,
A venv blooms beside the kitchen sink.
Export the deps, then pip install,
No UV_LINK_MODE needed at all.
The rabbit builds a cleaner trail! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: replacing uv sync in the CI image build with an alternate install flow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docker-pip-install

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
coding-agent/Dockerfile (1)

42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the build backend in the locked install path. pyproject.toml declares [build-system].requires = ["hatchling"], so pip install --no-deps . can still fetch hatchling in an isolated build env outside /tmp/requirements.txt. If this image is meant to be fully lock-driven, preinstall hatchling from the exported requirements or use --no-build-isolation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@coding-agent/Dockerfile` at line 42, The Dockerfile install step still allows
pip to resolve the build backend outside the locked requirements, so keep the
package build fully lock-driven. Update the `pip install` flow in the image
build to ensure `hatchling` is installed from the exported requirements before
installing the project, or switch the `python -m pip install` invocation to use
`--no-build-isolation` so `pyproject.toml` build requirements are not fetched
separately.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@coding-agent/Dockerfile`:
- Line 42: The Dockerfile install step still allows pip to resolve the build
backend outside the locked requirements, so keep the package build fully
lock-driven. Update the `pip install` flow in the image build to ensure
`hatchling` is installed from the exported requirements before installing the
project, or switch the `python -m pip install` invocation to use
`--no-build-isolation` so `pyproject.toml` build requirements are not fetched
separately.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3b33769-37bb-455d-ba58-b4c05f8edc93

📥 Commits

Reviewing files that changed from the base of the PR and between 7f40d4a and ec5da2f.

📒 Files selected for processing (1)
  • coding-agent/Dockerfile

@delete-cloud
delete-cloud merged commit 52b1cd5 into main Jun 27, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the fix/docker-pip-install branch June 27, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant