-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Bug]: Docker files not functioning properly #4230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@j0hnthebuilder, your observation is correct. In version 1.0.x we switched rust backend which requires bindings. The bindings need to be built before the new version can be used. I'll provide shortly a dockerfile that will build the bindings and help you run from source. |
@tazarov thank you very much friend 🥇 🙏 |
Hi @tazarov, hope you are well ❤ |
@j0hnthebuilder, here it goes: FROM python:3.11-slim-bookworm AS builder
ARG REBUILD_HNSWLIB
ARG PROTOBUF_VERSION=28.2
RUN apt-get update --fix-missing && apt-get install -y --fix-missing \
build-essential \
gcc \
g++ \
cmake \
autoconf \
python3-dev \
unzip \
curl \
make && \
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \
rm -rf /var/lib/apt/lists/* && \
mkdir /install
ENV PATH="/root/.cargo/bin:$PATH"
# Install specific Protobuf compiler (v28.2)
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip && \
unzip protoc-${PROTOBUF_VERSION}-linux-x86_64.zip -d /usr/local/ && \
rm protoc-${PROTOBUF_VERSION}-linux-x86_64.zip && \
chmod +x /usr/local/bin/protoc && \
protoc --version # Verify installed version
WORKDIR /install
COPY ./requirements.txt requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip pip install maturin cffi patchelf
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade --prefix="/install" -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip if [ "$REBUILD_HNSWLIB" = "true" ]; then pip install --no-binary :all: --force-reinstall --prefix="/install" chroma-hnswlib; fi
# Install gRPC tools for Python with fixed version
RUN pip install grpcio==1.58.0 grpcio-tools==1.58.0
# Copy source files to build Protobufs
COPY ./ /chroma
# Generate Protobufs
WORKDIR /chroma
RUN make -C idl proto_python
RUN python3 -m maturin build
RUN pip uninstall chromadb -y
RUN pip install --prefix="/install" --find-links target/wheels/ --upgrade chromadb
FROM python:3.11-slim-bookworm AS final
# Create working directory
RUN mkdir /chroma
WORKDIR /chroma
# Copy entrypoint
COPY ./bin/docker_entrypoint.sh /docker_entrypoint.sh
RUN apt-get update --fix-missing && apt-get install -y curl && \
chmod +x /docker_entrypoint.sh && \
rm -rf /var/lib/apt/lists/*
# Copy built dependencies and generated Protobufs
COPY --from=builder /install /usr/local
COPY --from=builder /chroma /chroma
ENV CHROMA_HOST_ADDR="0.0.0.0"
ENV CHROMA_HOST_PORT=8000
ENV CHROMA_WORKERS=1
ENV CHROMA_LOG_CONFIG="chromadb/log_config.yml"
ENV CHROMA_TIMEOUT_KEEP_ALIVE=30
EXPOSE 8000
ENTRYPOINT ["/docker_entrypoint.sh"]
CMD [ "--workers ${CHROMA_WORKERS} --host ${CHROMA_HOST_ADDR} --port ${CHROMA_HOST_PORT} --proxy-headers --log-config ${CHROMA_LOG_CONFIG} --timeout-keep-alive ${CHROMA_TIMEOUT_KEEP_ALIVE}"] |
@j0hnthebuilder alternatively you can use pure rust CLI as follows: FROM rust:1.81.0 AS builder
ARG RELEASE_MODE=release
ARG BRANCH=main
WORKDIR /chroma/
ENV PROTOC_ZIP=protoc-25.1-linux-x86_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v25.1/$PROTOC_ZIP \
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
&& unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \
&& rm -f $PROTOC_ZIP
RUN git clone --branch trayan-04-08-fix_improving_backfil_error_propagation https://github.com/chroma-core/chroma.git .
# RUN git clone --branch ${BRANCH} https://github.com/chroma-core/chroma.git .
RUN apt-get update && \
apt-get install -y python3.11-dev
RUN cargo build --bin chroma --release
FROM debian:bookworm-slim
COPY --from=builder /chroma/target/release/chroma /usr/local/bin/
RUN apt-get update && \
apt-get install -y python3.11-dev
EXPOSE 8000
ENTRYPOINT ["chroma"]
CMD ["run","--path","/data","--host","0.0.0.0"] |
@j0hnthebuilder should we keep this open or is everything squared away? |
Hi @jeffchuber , I've requested a commit to fix the issue with a proper Dockerfile (courtesy of @tazarov) but nobody has approved it since, you can view it here |
ok great! looks like @jairad26 is helping 🎉 |
What happened?
Hi Folks,
here are the full list of commands and the error that is caused
The error
Versions
latest version as seen in the command
Relevant log output
The text was updated successfully, but these errors were encountered: