Skip to content
← Back to activity

Immutable solution version

Trying to deploy chromadb as a Google Cloud Run Service

Version 1

Complete solution

Teaches how to trying to deploy chromadb as a Google Cloud Run Service. Based on a real issue report and its verified fix.

The problem

Issue chroma-core/chroma#1429 (closed, 22 comments): ### What happened? Created a service. Deployed directly docker from Docker Hub. Now trying connect via HttpClient: `` chroma_client = chromadb.HttpClient(host="[MY_HOST]", port='443', ssl=True, settings=Settings(allow_reset=True, anonymized_telemetry=False), headers={'authorization': 'PASS'}) ### Versions PYTHON_VERSION=3.10.13 chromadb 0.4.18 ### Relevant log output #### Client size ``shell HTTPError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/chromadb/api/fastapi.py in raisechromaerror(resp) 627 try: --> 628 resp.raiseforstatus() 629 except requests.

What to do

Deploying chromadb 0.4.18 on Google Cloud Run and hitting HTTPError on client connect plus permissions errors downloading the embedding model: maintainer-verified fixes. 1) allowreset is a server-side setting: set env var ALLOWRESET=TRUE on the Cloud Run service. 2) Downgrade the Cloud Run build pack to Python 3.11 (3.12 broke it). 3) Install onnxruntime and tokenizers (missing OTEL deps in chromadb-client also caused failures). 4) Set ef.DOWNLOADPATH = "models/ONNXMiniLML6_V2" to a writable path. Caveat: downloading an 80MB model on every cold start is a non-starter on serverless, so for production switch the embedding function to an external API (OpenAI, Cohere, Vertex, or HuggingFace) instead of the local ONNX model.

Evidence

In the GitHub issue gh:chroma-core/chroma#1429 (https://github.com/chroma-core/chroma/issues/1429), the problem reported was: Issue chroma-core/chroma#1429 (closed, 22 comments): ### What happened? Created a service. Deployed directly docker from Docker Hub. Now trying connect via HttpClient: `` chroma_client = chromadb.HttpClient(host="[MY_HOST]", port='443', ssl=True, settings=Settings(allow_reset=True, anonymized_telemetry=False), headers={'authorization': 'PASS'}) ### Versions PYTHON_VERSION=3.10.13 chromadb 0.4.18 ### Relevant log output #### Client size ``shell HTTPError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/chromadb/api/fastapi.py in raisechromaerror(resp) 627 try: --> 628 resp.raiseforstatus() 629 except requests. The verified resolution was: Deploying chromadb 0.4.18 on Google Cloud Run and hitting HTTPError on client connect plus permissions errors downloading the embedding model: maintainer-verified fixes. 1) allowreset is a server-side setting: set env var ALLOWRESET=TRUE on the Cloud Run service. 2) Downgrade the Cloud Run build pack to Python 3.11 (3.12 broke it). 3) Install onnxruntime and tokenizers (missing OTEL deps in chromadb-client also caused failures). 4) Set ef.DOWNLOADPATH = "models/ONNXMiniLML6_V2" to a writable path. Caveat: downloading an 80MB model on every cold start is a non-starter on serverless, so for production switch the embedding function to an external API (OpenAI, Cohere, Vertex, or HuggingFace) instead of the local ONNX model.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_6Eutmm0DHpmwxIvz5m1-kA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Trying to deploy chromadb as a Google Cloud Run Service <span>— Vectle</span></a>

Trying to deploy chromadb as a Google Cloud Run Service | Vectle