fix test run and chroma connection in final docker image

This commit is contained in:
Jason Hunter 2023-12-18 14:39:15 -05:00
parent 59586e0a78
commit 343136341b
4 changed files with 12 additions and 3 deletions

View File

@ -13,4 +13,4 @@ echo "[INFO] Starting ChromaDB..."
# Replace the bash process with the Frigate process, redirecting stderr to stdout # Replace the bash process with the Frigate process, redirecting stderr to stdout
exec 2>&1 exec 2>&1
exec /usr/local/chroma run --path /config/chroma --host 127.0.0.1 exec /usr/local/chroma run --path /config/chroma --host 0.0.0.0

View File

@ -53,7 +53,9 @@ class EmbeddingProcessor(threading.Thread):
return return
# Create the database # Create the database
self.chroma = ChromaClient(settings=Settings(anonymized_telemetry=False)) self.chroma = ChromaClient(
host="127.0.0.1", settings=Settings(anonymized_telemetry=False)
)
# Create/Load the collection(s) # Create/Load the collection(s)
self.thumbnail = self.chroma.get_or_create_collection( self.thumbnail = self.chroma.get_or_create_collection(

View File

@ -108,7 +108,9 @@ def create_app(
app.plus_api = plus_api app.plus_api = plus_api
app.camera_error_image = None app.camera_error_image = None
app.hwaccel_errors = [] app.hwaccel_errors = []
app.chroma = ChromaClient(settings=Settings(anonymized_telemetry=False)) app.chroma = ChromaClient(
host="127.0.0.1", settings=Settings(anonymized_telemetry=False)
)
app.thumbnail_collection = app.chroma.get_or_create_collection( app.thumbnail_collection = app.chroma.get_or_create_collection(
name="event_thumbnail", embedding_function=ClipEmbedding() name="event_thumbnail", embedding_function=ClipEmbedding()
) )

View File

@ -0,0 +1,5 @@
# This is required to satisfy the chromadb dependency
__import__("pysqlite3")
import sys # noqa: E402
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")