Skip to content
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

fix: Add support for ollama module #618

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

bricefotzo
Copy link
Contributor

@bricefotzo bricefotzo commented Jun 26, 2024

  • Added a new class OllamaContainer with few methods to handle the Ollama container.

  • The _check_and_add_gpu_capabilities method checks if the host has GPUs and adds the necessary capabilities to the container.

  • The commit_to_image allows to save somehow the state of a container into an image so that we can reuse it, especially for the ones having some models pulled.

  • Added tests to check the functionality of the new class.

Note: I inspired myself from the java implementation of the Ollama module.

Fixes #617

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@ead0f79). Learn more about missing BASE report.

Current head 3ab8f36 differs from pull request most recent head fb7259c

Please upload reports for the commit fb7259c to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #618   +/-   ##
=======================================
  Coverage        ?   80.29%           
=======================================
  Files           ?       11           
  Lines           ?      604           
  Branches        ?       86           
=======================================
  Hits            ?      485           
  Misses          ?       92           
  Partials        ?       27           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bricefotzo bricefotzo force-pushed the feature/add-ollama branch 4 times, most recently from 2d411c2 to 9d45d4e Compare June 26, 2024 22:02
- Added a new class OllamaContainer with few methods to handle the Ollama container.

- The `_check_and_add_gpu_capabilities` method checks if the host has GPUs and adds the necessary capabilities to the container.

- The `commit_to_image` allows to save somehow the state of a container into an image so that we can reuse it, especially for the ones having some models pulled.
- Added tests to check the functionality of the new class.
- Added a new class OllamaContainer with few methods to handle the Ollama container.

- The `_check_and_add_gpu_capabilities` method checks if the host has GPUs and adds the necessary capabilities to the container.

- The `commit_to_image` allows to save somehow the state of a container into an image so that we can reuse it, especially for the ones having some models pulled.
- Added tests to check the functionality of the new class.
@alexanderankin alexanderankin merged commit 5442d05 into testcontainers:main Jun 27, 2024
12 checks passed
@alexanderankin alexanderankin changed the title feat(core): Add support for ollama module fix: Add support for ollama module Jun 27, 2024
@alexanderankin alexanderankin added the community-feat feature but its a community module so we wont bump tc core for it label Jun 27, 2024
alexanderankin pushed a commit that referenced this pull request Jun 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.7.0](testcontainers-v4.6.0...testcontainers-v4.7.0)
(2024-06-28)


### Features

* **core:** Added Generic module
([#612](#612))
([e575b28](e575b28))
* **core:** allow custom dockerfile path for image build and bypassing
build cache
([#615](#615))
([ead0f79](ead0f79)),
closes
[#610](#610)
* **core:** DockerCompose.stop now stops only services that it starts
(does not stop the other services)
([#620](#620))
([e711800](e711800))


### Bug Fixes

* **ollama:** Add support for ollama module
([#618](#618))
([5442d05](5442d05))
* **cosmosdb:** Add support for the CosmosDB Emulator
([#579](#579))
([8045a80](8045a80))
* improve ollama docs, s/ollama_dir/ollama_home/g
([#619](#619))
([27f2a6b](27f2a6b))
* **kafka:** Add Kraft to Kafka containers
([#611](#611))
([762d2a2](762d2a2))


### Documentation

* **contributing:** add contribution and new-container guide
([#460](#460))
([3519f4b](3519f4b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-feat feature but its a community module so we wont bump tc core for it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Container: OllamaContainer
4 participants