-
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
Add --host=0.0.0.0 if running llama.cpp serve within a container #444
Conversation
Reviewer's Guide by SourceryThis PR modifies the container handling logic in ramalama to improve the serve and run functionality. The main changes include adding host binding for containers and restructuring the test cases to handle both container and non-container scenarios. Sequence diagram for container handling in serve commandsequenceDiagram
participant User
participant Ramalama
participant Container
User->>Ramalama: run_ramalama --dryrun serve ${model}
alt is_container
Ramalama->>Container: Add --host 0.0.0.0
Container-->>Ramalama: Host set to 0.0.0.0
else
Ramalama-->>User: Host not set to 0.0.0.0
end
Ramalama-->>User: Output result
Updated class diagram for Ramalama model handlingclassDiagram
class Ramalama {
+run(args)
+serve(args)
}
Ramalama : +exec_model_in_container(model_path, exec_args, args)
Ramalama : +dry_run(exec_args)
Ramalama : +exec_cmd(exec_args, debug)
note for Ramalama "Added host binding logic for containers in serve method"
note for Ramalama "Added dryrun handling in run and serve methods"
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.
Hey @rhatdan - 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.
@@ -289,6 +286,9 @@ def run(self, args): | |||
try: | |||
if self.exec_model_in_container(model_path, exec_args, args): | |||
return | |||
if args.dryrun: |
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: Consider extracting duplicate dryrun handling logic into a helper method
The dryrun handling logic is duplicated between run() and serve(). Consider creating a helper method to reduce code duplication.
def _handle_dryrun(self, exec_args):
dry_run(exec_args)
return True
if args.dryrun:
return self._handle_dryrun(exec_args)
Fixes: #442 |
Turn on some testing of --nocontainer serve and run, at least with dryrun. Signed-off-by: Daniel J Walsh <[email protected]>
Lets not block merge here |
Turn on some testing of --nocontainer serve and run, at least with dryrun.
Summary by Sourcery
Add --host=0.0.0.0 when running llama.cpp serve within a container and improve error handling for conflicting options. Enhance system tests to cover new scenarios.
New Features:
Enhancements:
Tests: