k-krawczyk opened a new pull request, #27472: URL: https://github.com/apache/camel/pull/27472
The remaining scope of CAMEL-24821, in the shape davsclaus asked for in the ticket: a generic, repeatable `--property key=value` rather than an ollama-specific `--model`. ### Why the CLI needed it A test infra service resolves its own settings through `LocalPropertyResolver`, which reads `System.getProperty` first and only then the `container.properties` of the service. So `-Dollama.model=qwen2.5:0.5b` already worked, while `camel infra run` had flags of its own only for the port and the companion UI, and no way to reach anything else. ### What the option does ``` camel infra run ollama --property ollama.model=qwen2.5:0.5b ``` pulls around 400 MB instead of the 2.1 GB of the default `granite4:3b`, and the same option reaches the embedding model, the container limits, GPU support and the settings of every other service - the names are the ones in `container.properties`, so nothing has to be added per service. Details worth noting in review: * the properties are set next to the existing `camel.infra.port` and `camel.infra.ui` handling, that is **before** the service is instantiated, which is when it resolves them; * the names that were set are cleared when the service stops, next to the `camel.infra.*` ones, so a `camel infra run` in the same JVM (the TUI, the tests) does not leak them into the next service; * `--background` re-executes the CLI: picocli replays the original arguments, and the hand-built fallback argument list adds the properties the way it already adds `--port` and `--no-ui`; * only the first `=` separates the name from the value, so `--property ollama.model=library/qwen2.5:0.5b=latest` keeps its value intact; * a property with no name or no value is refused with a message and exit code 1, like the "service not found" path next to it, rather than a stack trace. ### Tests `InfraRunPropertyTest`, three cases: the properties become system properties and the method reports their names for the cleanup, only the first separator splits the pair, and a malformed pair is rejected. No container is needed - the mapping is what the test drives, and the pass-through itself is `System.setProperty`. ### Docs A new `Configuring a service` section in `camel-jbang-dev-services.adoc` with the ollama example and the names behind it, and a sentence where `camel-jbang-ai-providers.adoc` mentions `camel infra run ollama`. The generated command docs and `camel-jbang-commands-metadata.json` are regenerated; their only semantic change is the entry for the new option. ### Scope The first part of the ticket, failing when the model pull fails, is already on main for 4.23.0 (#26718, commit 4bb0dafbdedd). The named volume turned out to be unnecessary - the bind mount of `~/.camel-test/ollama` has been there since 050af78ca32c - and showing the pull progress is left for a separate ticket, since it crosses the reflective classloader boundary in `InfraRun`. So this change is the whole of what is left, for 4.24.0. _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]
