langchain4j/langchain4j-ollama
Eddú Meléndez Gonzales 00db7557ce
Use Testcontainers in Ollama IT (#315)
Currently, integration tests in Ollama module are disabled because
it needs a Ollama instance running in order to execute them.
Testcontainers provides this infrastructure not only by running
the ollama container but also by automating the pull model step.

This commit, use the Singleton Container approach to reuse the single
instance across multiple IT. Also, pull step is only executed when the
image is `ollama/ollama`.

The behavior on this is:
1st execution:
1. Pull `ollama/ollama` image
2. Start the container based on `ollama/ollama` image
3. Download the `orca-mini` model
4. Create an image based on the current state (with the model in it)
5. Declare the container ready to use
6. Run test

Next executions:
1. Look for the local image created in the 1st execution
2. Start the container based on the local image
3. Declare the container ready to use
4. Run test

1st execution is expected to take longer because of the model (3GB).
Next execution are way more faster.
2023-12-05 10:31:02 +01:00
..
src Use Testcontainers in Ollama IT (#315) 2023-12-05 10:31:02 +01:00
pom.xml Use Testcontainers in Ollama IT (#315) 2023-12-05 10:31:02 +01:00