-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PERF]: Optimized docker image (#1613)
## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Removed the re-download of hnsw in docker entrypoint - Removed build dependencies in final image to reduce size (by about 100M) - Added flag for rebuilding hnsw lib from source - Added docs how to build in image with hardware-optimized hnsw ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js ## Documentation Changes Example of building AVX-optimized image added under `examples/`.
- Loading branch information
Showing
3 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/bin/bash | ||
|
||
echo "Rebuilding hnsw to ensure architecture compatibility" | ||
pip install --force-reinstall --no-cache-dir chroma-hnswlib | ||
export IS_PERSISTENT=1 | ||
export CHROMA_SERVER_NOFILE=65535 | ||
exec uvicorn chromadb.app:app --workers 1 --host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --timeout-keep-alive 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Building Hardware Optimized ChromaDB Image | ||
|
||
The default Chroma DB image comes with binary distribution of hnsw lib which is not optimized to take advantage of | ||
certain CPU architectures (Intel-based) with AVX support. This can be improved by building an image with hnsw rebuilt | ||
from source. To do that run: | ||
|
||
```bash | ||
docker build -t chroma-test1 --build-arg REBUILD_HNSWLIB=true --no-cache . | ||
``` | ||
|