-
-
Notifications
You must be signed in to change notification settings - Fork 590
chore(ollama): use Run function #3420
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
chore(ollama): use Run function #3420
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
WalkthroughRefactors ollama module to use option-driven container startup. Updates local process run signature to accept image and customizer options, builds and validates requests from options, applies env and wait strategy post-validation, and adjusts wait-strategy combination. Module Run now detects local process usage, conditionally adds GPU, and invokes either local or testcontainers.Run. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Ollama as Ollama.Run
participant Local as localProcess
participant TCRun as testcontainers.Run
User->>Ollama: Run(ctx, img, opts...)
Ollama->>Ollama: Build moduleOpts (ports, wait)
Ollama->>Ollama: Detect localProcess in opts?
alt local detected
Ollama->>Local: run(ctx, img, moduleOpts)
note right of Local: Build GenericContainerRequest from options<br/>Validate request<br/>Apply Env & WaitingFor<br/>Start process
Local-->>Ollama: *OllamaContainer or error*
else no local
Ollama->>TCRun: Run(ctx, img, moduleOpts...)
TCRun-->>Ollama: Container or error
Ollama->>Ollama: Wrap as OllamaContainer
end
Ollama-->>User: *OllamaContainer or error*
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)modules/ollama/local.go (5)
modules/ollama/ollama.go (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (15)
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 |
| req.WaitingFor = logStrategy | ||
| } else { | ||
| req.WaitingFor = wait.ForAll(req.WaitingFor, logStrategy) | ||
| if w, ok := req.WaitingFor.(*wait.MultiStrategy); ok && len(w.Strategies) == 0 { |
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.
This fix is for the case where the wait.Multistrategy's internal slice of strategies gets cleared but it's not setting the strategy to nil. We probably need to fix it in the Walk strategy
cc/ @stevenh
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.
This looks like a bug - are you sure it's not supposed to be len(w.Strategies) > 0? Otherwise any existing strategies are lost...
What does this PR do?
Use the Run function in ollama
Why is it important?
Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.
Related issues