k-krawczyk opened a new pull request, #26718:
URL: https://github.com/apache/camel/pull/26718

   First part of CAMEL-24821, the one that is independent of how the ticket's 
other points are settled.
   
   ### The finding
   
   `OllamaLocalContainerInfraService.initialize()` discarded the 
`Container.ExecResult` of both `ollama pull` invocations, so the exit code and 
the error output were thrown away. A pull that fails - no network, a model name 
that does not exist, a full disk - left nothing behind but an `INFO` line 
saying the pull had started.
   
   Nothing else covers for it. `org.testcontainers.ollama.OllamaContainer` 
(testcontainers-ollama 2.0.5) sets no wait strategy of its own: its constructor 
asserts image compatibility, adds the GPU modifier when the nvidia runtime is 
present, and calls `withExposedPorts(11434)`. Readiness therefore falls through 
to the default host-port wait, which is satisfied as soon as the server accepts 
a connection - long before any model blob exists. So there was no point in the 
code where "the model is present and usable" was ever asserted, and the service 
reported a running instance that answers every request with "model not found".
   
   ### The change
   
   Both pulls go through one method that checks the exit code and fails with 
the model name and the error output of the pull. An `InterruptedException` 
restores the interrupt flag before the exception leaves the method, which the 
previous `catch (IOException | InterruptedException e)` did not.
   
   ### Tests
   
   The check lives in a package-private `requireSuccessfulPull(model, exitCode, 
stderr)` so it can be tested without Docker: a pull that succeeded, a pull that 
failed with an error message, and a pull that failed with no error output at 
all. `camel-test-infra-ollama` had no tests before this, so `src/test` is new; 
the assertions follow the JUnit style the other `test-infra` test uses 
(`TestServiceUtilRetryTest`), rather than introducing AssertJ as an outlier.
   
   ### Not in this PR
   
   The other two points of the ticket are answered in a comment on CAMEL-24821 
and wait on davsclaus:
   
   * the named volume - the container has bound `~/.camel-test/ollama` to 
`/root/.ollama` since 050af78ca32c (2026-05-16), so the repeated pull the 
ticket describes looks like a failed bind rather than a missing mount;
   * `--model` for `camel infra run ollama` - the plumbing already exists, 
since `LocalPropertyResolver` reads system properties first, but whether it 
should be an ollama-specific option or a generic property passthrough is a 
question for the ticket.
   
   _Reported by Claude Code on behalf of Karol Krawczyk_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to