chroma-core / chroma-core/chroma
[Feature Request]: Remove re-build during docker container entry
- Dominant language
- Rust
- Stars
- 29.3k
- Forks
- 2.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 38
Description
During container entry, it seems the entire stack is rebuild. Here are my logs from a simple docker-compose:
```
repo-query-chroma-1 | Collecting chroma-hnswlib
repo-query-chroma-1 | Downloading chroma-hnswlib-0.7.2.tar.gz (31 kB)
repo-query-chroma-1 | Installing build dependencies: started
repo-query-chroma-1 | Installing build dependencies: finished with status 'done'
repo-query-chroma-1 | Getting requirements to build wheel: started
repo-query-chroma-1 | Getting requirements to build wheel: finished with status 'done'
repo-query-chroma-1 | Preparing metadata (pyproject.toml): started
repo-query-chroma-1 | Preparing metadata (pyproject.toml): finished with status 'done'
repo-query-chroma-1 | Collecting numpy
repo-query-chroma-1 | Downloading numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
repo-query-chroma-1 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 10.7 MB/s eta 0:00:00
repo-query-chroma-1 | Building wheels for collected packages: chroma-hnswlib
repo-query-chroma-1 | Building wheel for chroma-hnswlib (pyproject.toml): started
repo-query-chroma-1 | Building wheel for chroma-hnswlib (pyproject.toml): still running...
repo-query-chroma-1 | Building wheel for chroma-hnswlib (pyproject.toml): finished with status 'done'
repo-query-chroma-1 | Created wheel for chroma-hnswlib: filename=chroma_hnswlib-0.7.2-cp310-cp310-linux_x86_64.whl size=2240435 sha256=e9a31acae99a9130ea9e767052b1c9367db009b00b1a9aba9669501195824952
repo-query-chroma-1 | Stored in directory: /tmp/pip-ephem-wheel-cache-r3a58g0s/wheels/11/2b/0d/ee457f6782f75315bb5828d5c2dc5639d471afbd44a830b9dc
repo-query-chroma-1 | Successfully built chroma-hnswlib
repo-query-chroma-1 | Installing collected packages: numpy, chroma-hnswlib
repo-query-chroma-1 | Attempting uninstall: numpy
repo-query-chroma-1 | Found existing installation: numpy 1.21.6
repo-query-chroma-1 | Uninstalling numpy-1.21.6:
repo-query-chroma-1 | Successfully uninstalled numpy-1.21.6
repo-query-chroma-1 | Attempting uninstall: chroma-hnswlib
repo-query-chroma-1 | Found existing installation: chroma-hnswlib 0.7.2
repo-query-chroma-1 | Uninstalling chroma-hnswlib-0.7.2:
repo-query-chroma-1 | Successfully uninstalled chroma-hnswlib-0.7.2
repo-query-chroma-1 | Successfully installed chroma-hnswlib-0.7.2 numpy-1.25.2
repo-query-chroma-1 | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
repo-query-chroma-1 |
repo-query-chroma-1 | [notice] A new release of pip is available: 23.0.1 -> 23.2.1
repo-query-chroma-1 | [notice] To update, run: pip install --upgrade pip
repo-query-chroma-1 | 2023-08-17 15:14:47 INFO chromadb.telemetry.posthog Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
repo-query-chroma-1 | 2023-08-17 15:14:47 DEBUG chromadb.config Starting component System
repo-query-chroma-1 | 2023-08-17 15:14:47 DEBUG chromadb.config Starting component Posthog
repo-query-chroma-1 | 2023-08-17 15:14:47 DEBUG chromadb.config Starting component SqliteDB
repo-query-chroma-1 | 2023-08-17 15:14:48 DEBUG chromadb.config Starting component LocalSegmentManager
repo-query-chroma-1 | 2023-08-17 15:14:48 DEBUG chromadb.config Starting component SegmentAPI
repo-query-chroma-1 | 2023-08-17 15:14:48 INFO uvicorn.error Started server process [85]
repo-query-chroma-1 | 2023-08-17 15:14:48 INFO uvicorn.error Waiting for application startup.
repo-query-chroma-1 | 2023-08-17 15:14:48 INFO uvicorn.error Application startup complete.
repo-query-chroma-1 | 2023-08-17 15:14:48 INFO uvicorn.error Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
```
This entire operation seems to take upwards 1 min and I even saw it take 5 mins at one point.
Ideally, given a multi-architecture image, there shouldn't be any rebuilding and Chroma should come up right away.
---
Shouldn't this also remove the need to rebuild dependencies during container entry?
https://github.com/chroma-core/chroma/blob/42c29f0d14fd7bebd249f0d1b58fa1f3f1cefa55/bin/docker_entrypoint.sh#L3-L4
_Originally posted by @jpmcb in https://github.com/chroma-core/chroma/pull/857#pullrequestreview-1577667502_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with bin/docker_entrypoint.sh at the lines linked in the issue and inspect the commands that install or rebuild dependencies during container startup. Run the referenced docker-compose setup and verify that Chroma starts without rebuilding the stack or reinstalling dependencies, while still becoming available normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, python
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100