LCORE-2799: Post 0.5.2 fixes#2026
Merged
Merged
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
5e97402 to
39e9d5c
Compare
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.
Description
Post 0.5.2 fixes
Summary: Packages installed into wrong Python environment in hermetic Containerfile build
Problem: The released registry.redhat.io/lightspeed-core/lightspeed-stack-rhel9:0.5.2 image failed at startup with ModuleNotFoundError: No module named 'yaml' — PyYAML and all other dependencies were installed into the system site-packages instead of the application's .venv.
Root cause: The Containerfile's hermetic install step was:
Three issues cascaded:
uv venv --seed fails hermetically — it tries to download pip from the network. In the Konflux no-network build, --seed can't install pip into the venv.
Without --seed, the venv has no pip — so pip install (or python3.12 -m pip) can't run from within the venv.
System pip3.12 ignores the venv — calling /usr/bin/pip3.12 directly installs to /opt/app-root/lib64/python3.12/site-packages/ (the system/base-image location), not /app-root/.venv/. The activate script modifies PATH and VIRTUAL_ENV, but system pip doesn't honor those — it uses its own sys.prefix.
The result: all 126 packages landed in system site-packages. The image's PATH points to .venv/bin, and Python at runtime uses .venv — which is empty.
Fix: Replace pip install with uv pip install, which natively targets the active venv without needing pip installed there:
Key changes:
Why this wasn't caught in testing:
Unit and E2E tests run via uv run in the development venv — not inside the container
The Konflux integration test pipeline deploys the image on a ROSA cluster, but only runs post-release — too late
No lightweight container smoke test (e.g., podman run --rm $IMAGE python3.12 -c "from configuration import configuration") exists in the build pipeline
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing