-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Enable Ollama integration test #322
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
Closed
eddumelendez
wants to merge
2
commits into
spring-projects:main
from
eddumelendez:cache-ollama-image
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/OllamaImage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package org.springframework.ai.autoconfigure.ollama; | ||
|
|
||
| public class OllamaImage { | ||
|
|
||
| static final String IMAGE = "ollama/ollama:0.1.10"; | ||
|
|
||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks, I'd like to speed up the IT tests as well. I'm curious as to the rationale in going from a one liner to use test containers
To now using two static classes and a static method. I'm not quite up on my testcontainer knowledge, but would have expected something more terse code-wise.
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.
The reason is to create the new Ollama image with the orca-mini model in it. We are doing it programmatically but another approach could be to reuse an existing image from Docker Hub that has the model and the one line could remain just pointing to the new image, removing the rest of the code. However, not sure if there is any preference to use any image out there or creating their own.
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 a tricky situation I encountered in other projects as well. On the one hand, it'd be better to use official images. On the other hand, downloading the model every time is not much feasible, requiring some mitigation strategies with additional configuration. I looked for existing images out there, but I ended up publishing my own Ollama-based images to make sure they are always up-to-date and for having multi-architecture support: https://github.com/ThomasVitale/llm-images.
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.
There is an issue in ollama to provide specific images ollama/ollama#2161
Uh oh!
There was an error while loading. Please reload this page.
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.
That image has been closed with 'won't do' - so closing this issue. We will have to setup a separate integration test profile for ollama along with other model providers that aren't currently running in CI