Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class BaseOllamaIT {
private static final Logger logger = LoggerFactory.getLogger(BaseOllamaIT.class);

// Toggle for running tests locally on native Ollama for a faster feedback loop.
private static final boolean useTestcontainers = false;
private static final boolean useTestcontainers = true;

public static final OllamaContainer ollamaContainer;

Expand All @@ -30,13 +30,13 @@ public class BaseOllamaIT {
* to the file ".testcontainers.properties" located in your home directory
*/
public static boolean isDisabled() {
return false;
return true;
}

public static OllamaApi buildOllamaApiWithModel(String model) {
var baseUrl = "http://localhost:11434";
if (useTestcontainers) {
baseUrl = "http://" + ollamaContainer.getHost() + ":" + ollamaContainer.getMappedPort(11434);
baseUrl = ollamaContainer.getEndpoint();
}
var ollamaApi = new OllamaApi(baseUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static boolean isDisabled() {
public static String buildConnectionWithModel(String model) throws IOException, InterruptedException {
var baseUrl = "http://localhost:11434";
if (useTestcontainers) {
baseUrl = "http://" + ollamaContainer.getHost() + ":" + ollamaContainer.getMappedPort(11434);
baseUrl = ollamaContainer.getEndpoint();

logger.info("Start pulling the '{}' model. The operation can take several minutes...", model);
ollamaContainer.execInContainer("ollama", "pull", model);
Expand Down