migrations: switch backend migration command from uv run to python#190
Draft
jirikuncar wants to merge 1 commit into
Draft
migrations: switch backend migration command from uv run to python#190jirikuncar wants to merge 1 commit into
uv run to python#190jirikuncar wants to merge 1 commit into
Conversation
Pairs with pydantic/platform#26663, which drops `uv` from the `python-prod` image to shrink the artifact. The backend migration Job on that image is the only in-cluster command that was still calling `uv run --no-sync ...`; this switches it to plain `python ...`. Both invocations are semantically identical: the prod image has the project's venv first on `PATH` (`/app/.venv/bin`), so `python` resolves to the venv interpreter — same as what `uv run --no-sync` was running. Verified locally on the platform PR by importing the migration entrypoint against the new `python-prod` image; it enumerates all 336 migrations before hitting the DB, exactly as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pairs with pydantic/platform#26663, which slims the
python-prodimage by droppinguv,git, and other build tooling.The
logfire-backend-migrationsJob is the only place in this chart that was still callinguv run --no-sync ...— every other service template already usespython -m .... This switches the migration Job to plainpython ...so it keeps working on the leaner image.Behavior
Both invocations resolve to the same interpreter on the prod image:
uv run --no-sync src/packages/logfire-db/logfire_db/migrations/main.py(old)python src/packages/logfire-db/logfire_db/migrations/main.py(new)The prod image sets
ENV PATH=/app/.venv/bin:$PATH, sopythonis/app/.venv/bin/python— the same interpreteruv run --no-syncwas invoking. The migration script hasn't changed.Coordination with the platform PR
python-prod:*image is published frommain, the old chart command (uv run …) will fail on that image because there is nouvbinary.main-cutpython-prodimage tag. Kept as draft until #26663 is merged and a tag is available.Verification
uv runreference exists in the chart templates (this file). Every other workload (logfire-backend,logfire-worker,logfire-remote-mcp, etc.) already usespython -m ...or a direct binary.python /app/src/packages/logfire-db/logfire_db/migrations/main.pyagainst a locally-builtpython-prodimage — the script enumerates all 336 migrations before hitting the DB (fails only at DB-connect, as expected).🤖 Generated with Claude Code