Skip to content

build(backend): install Docker deps from uv lock #8039

Description

@Git-on-my-level

Context

PR #8038 introduces the first backend Python reproducibility step:

  • backend/.python-version
  • backend/pylock.toml
  • uv local sync/update scripts
  • Backend Hermetic E2E install via uv pip sync pylock.toml --system

It intentionally leaves production Dockerfiles on the current pip install -r requirements.txt path to avoid mixing CI/local dependency changes with production image build changes.

Goal

Move backend production image dependency installation to the checked-in uv lock once #8038 is green/merged.

Proposed scope

Start with the main backend image only, then expand if validation stays straightforward:

  1. backend/Dockerfile
  2. optionally backend/pusher/Dockerfile and backend/agent-proxy/Dockerfile if they can consume the same pattern cleanly
  3. defer GPU/specialized services (modal, diarizer, parakeet) unless explicitly validated in this PR

Suggested implementation

  • Install/copy uv in the builder stage.
  • Copy backend/pylock.toml and .python-version before application code for better Docker layer caching.
  • Replace runtime dependency install with locked sync semantics, e.g. uv pip sync pylock.toml --python /opt/venv/bin/python or an equivalent uv-managed install path.
  • Remove pip install --upgrade -r ... for converted images.
  • Preserve the existing liblc3/PyOgg build behavior unless the uv path explicitly handles it.

Verification

  • Build the converted Docker image locally or in CI.
  • Run a lightweight import/smoke check inside the built image.
  • Compare build time with the current pip path.
  • Confirm /v1/health or equivalent app startup works.
  • Keep rollback simple: revert to the previous Docker install stanza if image build/runtime differs.

Out of scope

  • Repo-wide plugin migration.
  • GPU image conversion unless separately validated.
  • Moving every dependency into [project.dependencies]; requirements.txt can remain the human-maintained input while pylock.toml is the resolved install artifact during this transition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend Task (python)buildp3Priority: Backlog (score <14)python

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions