-
Notifications
You must be signed in to change notification settings - Fork 270
Fix vulkan container build by using Python 3.11 for ramalama installa… #1584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vulkan container build by using Python 3.11 for ramalama installa… #1584
Conversation
…tion The vulkan container build was failing because ramalama now requires Python >= 3.10, but the UBI 9 base image only provides Python 3.9. This commit resolves the issue by: - Installing python3.11 and python3.11-pip packages alongside default Python - Using python3.11 specifically for ramalama installation in clone_and_build_ramalama() - Keeping python3 (3.9) for other pip packages to maintain compatibility with rag_framework This allows the vulkan container to build successfully while maintaining backward compatibility for scripts that expect the default Python version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Reviewer's GuideThe PR resolves a Python version incompatibility by installing Python 3.11 alongside existing Python 3.9, switching the ramalama build to use python3.11, and enabling shell tracing to aid debugging. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @stefwalter, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request resolves a build failure for the Vulkan container image by addressing a Python version incompatibility. The core issue was that the ramalama package required Python 3.10 or newer, while the base image provided Python 3.9. My changes introduce Python 3.11 into the build environment and specifically use it for the ramalama installation, ensuring the build completes successfully while preserving compatibility for other Python 3.9-dependent components.
Highlights
- Build Fix: I've addressed a critical build failure for the Vulkan container image, which was caused by a Python version incompatibility with the
ramalamapackage. - Python Version Management: I've updated the build script to install Python 3.11 and its corresponding pip package. This allows
ramalamato be installed with its required Python version (>=3.10). - Targeted Installation: I've specifically configured the
clone_and_build_ramalamafunction to usepython3.11for installingramalama, ensuring the correct interpreter is used for this dependency. - Backward Compatibility: I've ensured that the default Python 3.9 installation remains available for other components, such as
rag_framework, to maintain existing compatibility. - Debugging Improvement: I've added
set -xto the build script to enable verbose output, which will aid in debugging future build issues by showing executed commands.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @stefwalter - I've reviewed your changes - here's some feedback:
- Remove the
set -xdebugging flag once this fix is verified to avoid verbose logging in production builds. - You may need to include
python3.11-develin the RPM list to ensure any C extensions build correctly under Python 3.11. - Consider parameterizing the target Python version in a variable to simplify future upgrades and avoid hard-coding
python3.11.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Remove the `set -x` debugging flag once this fix is verified to avoid verbose logging in production builds.
- You may need to include `python3.11-devel` in the RPM list to ensure any C extensions build correctly under Python 3.11.
- Consider parameterizing the target Python version in a variable to simplify future upgrades and avoid hard-coding `python3.11`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request fixes a build failure in the Vulkan container by using Python 3.11 for the ramalama installation. The changes include installing Python 3.11, using it for ramalama, and maintaining compatibility with Python 3.9 for other packages. I've suggested adding set -e for improved script robustness.
| @@ -1,4 +1,5 @@ | |||
| #!/bin/bash | |||
| set -x | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding set -e to exit immediately if a command exits with a non-zero status. This can prevent unexpected behavior in automated scripts.[^1]
Alternatively, using set -euxo pipefail is even more robust:
-e: exit on error-u: treat unset variables as an error-x: trace command execution-o pipefail: cause a pipeline to return the exit status of the last command in the pipe that returned a non-zero status.
| set -x | |
| set -ex |
|
Fedora 42 is at 3.13? Are you doing this just for RHEL9? |
|
We should stick this in the else part of here, since it's not applicable to Fedora: we did sorta drop ubi9 support to focus on Fedora that's closer to upstream, but we can still take this change. |
|
This was already fixed in main. Was using Claude Code to fix my build. Figured out it was fixed in main when it tried to rebase. Sorry for the noise. |
Title:
Fix vulkan container build by using Python 3.11 for ramalama installation
Description:
Summary
Fixes the vulkan container build failure caused by Python version incompatibility.
Problem
The vulkan container build was failing with the error:
ERROR: Package 'ramalama' requires a different Python: 3.9.21 not in '>=3.10'
This occurred because:
Solution
This PR resolves the issue by:
python3.11andpython3.11-pipto the RPM installation listclone_and_build_ramalama()to usepython3.11instead ofpython3python3(3.9) for other pip packages to ensure compatibility with existing scriptslike
rag_frameworkTest plan
quay.io/ramalama/vulkan- Base vulkan imagequay.io/ramalama/vulkan-llama-server- Vulkan with LLaMA serverquay.io/ramalama/vulkan-whisper-server- Vulkan with Whisper serverquay.io/ramalama/vulkan-rag- Vulkan with RAG frameworkThe changes are minimal and focused, addressing the specific Python version compatibility issue while maintaining backward
compatibility.
Summary by Sourcery
Use Python 3.11 in the Vulkan container build to install ramalama properly while retaining Python 3.9 for other components.
Bug Fixes:
Enhancements:
Build: