-
Notifications
You must be signed in to change notification settings - Fork 48
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
Simplify container image build #451
Conversation
Simplifying Signed-off-by: Eric Curtin <ecurtin@redhat.com>
Reviewer's Guide by SourceryThis PR refactors the container image build script to improve organization and reduce redundancy in package installation logic. The changes primarily focus on consolidating package lists and simplifying the conditional installation blocks for different container types. Sequence diagram for the refactored package installation processsequenceDiagram
participant User
participant Script
participant DNF
User->>Script: Run build_llama_and_whisper.sh
Script->>DNF: Install common RPM packages
alt If containerfile is ramalama
Script->>DNF: Install EPEL release
Script->>DNF: Enable CRB
Script->>DNF: Install additional packages for ramalama
else If containerfile is asahi
Script->>DNF: Enable Asahi branding
Script->>DNF: Install additional packages for asahi
else If containerfile is rocm
Script->>DNF: Install ROCm packages
else If containerfile is cuda
Script->>DNF: Install CUDA packages
end
File-Level Changes
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.
Hey @ericcurtin - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -1,33 +1,31 @@ | |||
#!/bin/bash |
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.
suggestion: Add error handling to ensure package installation failures don't go unnoticed
Consider adding 'set -e' at the start of the script and checking return values of dnf commands to fail fast if package installation fails.
#!/bin/bash | |
#!/bin/bash | |
set -e | |
dnf_install() { | |
local rpm_list=("python3" "python3-pip" "python3-argcomplete" \ | |
"python3-dnf-plugin-versionlock" "gcc-c++" "cmake" "vim" \ | |
"procps-ng" "git" "dnf-plugins-core") | |
local vulkan_rpms=("vulkan-headers" "vulkan-loader-devel" "vulkan-tools" \ | |
"spirv-tools" "glslc" "glslang") |
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.
I like the idea of adding set -e to the script.
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.
Thank you for your feedback, we will generate more comments like this in the future according to the following instructions:
- Ensure the comment provides a clear suggestion for improvement or enhancement.
- The comment should address potential issues such as error handling or code robustness.
- Include specific code examples or modifications to illustrate the suggestion.
- The comment should be relevant to the context of the code and provide actionable advice.
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.
It's already there, it's just the AI bot isn't smart enough to detect it:
main() {
set -e
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.
Thank you for your feedback, we will generate fewer comments like this in the future according to the following instructions:
- Ensure the comment provides a clear and actionable suggestion for improvement.
- Verify that the suggestion is relevant to the context of the code and addresses a potential issue or enhancement.
- Check if the comment includes specific code examples or modifications that illustrate the suggested change.
- Avoid comments that suggest changes without considering the broader implications or without sufficient justification.
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.
It's Artificial Intelligence, but this does not mean it is smart.
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.
Thank you for your feedback, we will generate fewer comments like this in the future according to the following instructions:
- Ensure the comment provides a clear and actionable suggestion for improvement.
- Verify that the suggestion is relevant to the code and addresses a potential issue or enhancement.
- Check if the comment includes specific code examples or modifications that illustrate the suggestion.
- Avoid comments that suggest changes without considering the context or potential side effects.
LGTM |
Simplifying
Summary by Sourcery
Build: