chore(backend): add uv dependency lock#8038
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Follow-up Docker/runtime-image uv migration is tracked in #8039. |
There was a problem hiding this comment.
2 issues found across 7 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Addressed cubic's review comments:
Validation after the patch: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 860d105c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install -r testing/e2e/requirements.txt | ||
| run: uv pip sync pylock.toml --system |
There was a problem hiding this comment.
Keep e2e installs aligned with Docker dependencies
Until the backend Dockerfiles are moved to pylock.toml, this workflow no longer tests the dependency set that is actually deployed: I checked backend/Dockerfile and it still builds from backend/requirements.txt via pip install -r /tmp/requirements.txt. In any PR that changes requirements.txt without the lock, or where an open requirement resolves differently under pip, hermetic e2e can pass here while the production image uses different package versions, so either keep this CI path on the same requirements inputs as Docker for now or switch Docker/enforcement to the lock in the same rollout.
Useful? React with 👍 / 👎.
| python --version | ||
| python -m venv venv | ||
| # From backend/ | ||
| ./scripts/sync-python-deps.sh |
There was a problem hiding this comment.
Install uv before running the sync script
For a fresh local setup, this is now the first command that needs uv, but the preceding platform dependency steps still only install Python/Git/FFmpeg/opus. Since backend/scripts/sync-python-deps.sh exits immediately when command -v uv fails, users following these docs hit that error before the venv is created; add uv installation to the system dependency steps or insert an explicit install step before this command.
Useful? React with 👍 / 👎.
|
Follow-up Docker/runtime-image uv migration is now tracked as an ANX card: https://anx.scalingforever.com/o/david-zhang/w/omi/boards/stability?card=build-backend-install-docker-deps-from-uv-lock (GitHub issue: #8039). |
Docker smoke test + follow-up recommendationI tried to build/test the backend Dockerfile from this PR branch. What passed locallyThe exact production base image is private from this environment, so I used public Result: build completed successfully. Runtime smoke checks inside the built image also passed: Started the container and verified HTTP responses:
What could not be validated hereThe actual production base image could not be pulled from this environment: So this validates Dockerfile mechanics and runtime smoke behavior against a close public Python 3.11 slim stand-in, but not the exact private GCR base image. Do we need a GCR-access machine?For the current PR as written: not strictly before merge, because this PR does not change the Docker install path; Docker still installs from For the follow-up that moves Docker to the uv lock: yes — that PR should be built on a machine/CI runner with GCR access using the real Follow-up neededThe Codex review comment is valid: CI now installs from Suggested next implementation shape:
|
Summary
First PR of the backend Python reproducibility rollout.
backend/.python-version(3.11.15)pylock.tomlgenerated from the existing backend runtime + hermetic e2e requirement inputsbackend/scripts/sync-python-deps.shbackend/scripts/update-python-lock.shuv pip sync pylock.toml --systemThis deliberately leaves production Dockerfiles on the existing
pip install -r requirements.txtpath; that is the next PR so CI/local behavior can be proven before changing runtime image builds.Validation
Follow-up
Next PR should move backend Docker image dependency installation to the checked-in uv lock after this PR's CI/local path is green. Tracked in #8039.