-
Notifications
You must be signed in to change notification settings - Fork 57
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
Attempt to use versioned container #537
Conversation
Reviewer's Guide by SourceryThis pull request introduces versioned containers to improve reproducibility and dependency management. It modifies the model.py and common.py files to attempt using a versioned container if available. If the versioned container image is not found locally, it attempts to pull it. If the pull fails, it defaults to using the "latest" tag. Sequence diagram for container version resolutionsequenceDiagram
participant C as Container Manager
participant M as Model
participant R as Registry
M->>C: inspect versioned image
alt Image exists locally
C-->>M: Success
else Image not found locally
M->>C: pull versioned image
C->>R: pull image
alt Pull successful
R-->>C: Image downloaded
C-->>M: Success
else Pull failed
R-->>C: Error
C-->>M: Failure
Note over M: Fallback to latest tag
end
end
Class diagram showing updated Model classclassDiagram
class Model {
+remove(args)
+attempt_to_use_versioned(conman, image, vers, args) bool
-_image(args) str
+setup_container(args)
}
note for Model "New method attempt_to_use_versioned
handles versioned container resolution"
State diagram for container version resolution processstateDiagram-v2
[*] --> CheckLocal
CheckLocal --> UseVersioned: Version exists locally
CheckLocal --> AttemptPull: Version not found
AttemptPull --> UseVersioned: Pull successful
AttemptPull --> UseLatest: Pull failed
UseVersioned --> [*]
UseLatest --> [*]
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 - here's some feedback:
Overall Comments:
- The broad Exception catch in attempt_to_use_versioned could mask important errors. Consider catching specific exceptions (like ContainerError or NetworkError) that you expect might occur.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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.
3da2779
to
ba37fbc
Compare
ramalama/model.py
Outdated
try: | ||
if run_cmd([conman, "inspect", f"{image}:{vers}"], ignore_all=True, debug=args.debug): | ||
return True | ||
elif run_cmd([conman, "pull", f"{image}:{vers}"], debug=args.debug): |
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.
No elif required here, just return it.
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.
Will do!
LGTM once tests pass. |
Part of me wishes we prepared vLLM and llama.cpp Containerfiles and upstreamed these Containerfiles to both projects specifically, so we would have UBI-based images published by both projects. At least CUDA ones (and maybe ROCm, etc.). Both projects publish their own images but they are debian/ubuntu-based I believe. Maybe they would be willing to publish |
0448ae7
to
ef44bf4
Compare
Needs a rebase. |
82a400f
to
11b8e48
Compare
Check if it's locally available, then try and pull. Then just use latest if it's not available. Signed-off-by: Eric Curtin <[email protected]>
11b8e48
to
19500b9
Compare
LGTM |
Check if it's locally available, then try and pull. Then just use latest if it's not available.
Summary by Sourcery
Enhancements: