Skip to content

Commit b7d41dd

Browse files
authored
fix(modules): update chroma version (#826)
Chroma deprecated their v1 health check. Updated the version and module to use the new v2 endpoint.
1 parent 3b9e8e4 commit b7d41dd

File tree

4 files changed

+221
-15
lines changed

4 files changed

+221
-15
lines changed

modules/chroma/testcontainers/chroma/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class ChromaContainer(DockerContainer):
3232

3333
def __init__(
3434
self,
35-
image: str = "chromadb/chroma:latest",
35+
image: str = "chromadb/chroma:1.0.0",
3636
port: int = 8000,
3737
**kwargs,
3838
) -> None:
3939
"""
4040
Args:
41-
image: Docker image to use for the MinIO container.
41+
image: Docker image to use for the ChromaDB container.
4242
port: Port to expose on the container.
4343
access_key: Access key for client connections.
4444
secret_key: Secret key for client connections.
@@ -55,7 +55,7 @@ def get_config(self) -> dict:
5555
including the endpoint.
5656
5757
Returns:
58-
dict: {`endpoint`: str}
58+
dict: {`endpoint`: str, `host`: str, `port`: int}
5959
"""
6060
host_ip = self.get_container_host_ip()
6161
exposed_port = self.get_exposed_port(self.port)
@@ -69,7 +69,7 @@ def get_config(self) -> dict:
6969
def _healthcheck(self) -> None:
7070
"""This is an internal method used to check if the Chroma container
7171
is healthy and ready to receive requests."""
72-
url = f"http://{self.get_config()['endpoint']}/api/v1/heartbeat"
72+
url = f"http://{self.get_config()['endpoint']}/api/v2/heartbeat"
7373
response: Response = get(url)
7474
response.raise_for_status()
7575

modules/chroma/tests/test_chroma.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def test_docker_run_chroma():
6-
with ChromaContainer(image="chromadb/chroma:0.4.24") as chroma:
6+
with ChromaContainer(image="chromadb/chroma:1.0.0") as chroma:
77
client = chromadb.HttpClient(host=chroma.get_config()["host"], port=chroma.get_config()["port"])
88
col = client.get_or_create_collection("test")
99
assert col.name == "test"

0 commit comments

Comments
 (0)