Skip to content

Commit

Permalink
ci: swap ort for candle on cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
jcudit committed Sep 12, 2024
1 parent 65fb21d commit 96135d5
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV SCCACHE=0.5.4
ENV RUSTC_WRAPPER=/usr/local/bin/sccache

# Donwload, configure sccache
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v$SCCACHE/sccache-v$SCCACHE-x86_64-unknown-linux-musl.tar.gz | tar -xzv --strip-components=1 -C /usr/local/bin sccache-v$SCCACHE-x86_64-unknown-linux-musl/sccache && \
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v$SCCACHE/sccache-v$SCCACHE-x86_64-unknown-linux-musl.tar.gz | tar -xzv --strip-components=1 -C /usr/local/bin sccache-v$SCCACHE-x86_64-unknown-linux-musl/sccache &&
chmod +x /usr/local/bin/sccache

FROM chef AS planner
Expand All @@ -16,7 +16,7 @@ COPY router router
COPY Cargo.toml ./
COPY Cargo.lock ./

RUN cargo chef prepare --recipe-path recipe.json
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder

Expand All @@ -30,7 +30,7 @@ ARG SCCACHE_GHA_ENABLED

COPY --from=planner /usr/src/recipe.json recipe.json

RUN cargo chef cook --release --features ort --no-default-features --recipe-path recipe.json && sccache -s
RUN cargo chef cook --release --features candle --no-default-features --recipe-path recipe.json && sccache -s

COPY backends backends
COPY core core
Expand All @@ -40,19 +40,19 @@ COPY Cargo.lock ./

FROM builder AS http-builder

RUN cargo build --release --bin text-embeddings-router -F ort -F http --no-default-features && sccache -s
RUN cargo build --release --bin text-embeddings-router -F candle -F http --no-default-features && sccache -s

FROM builder AS grpc-builder

RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip && \
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.12/$PROTOC_ZIP && \
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc && \
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \
RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip &&
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.12/$PROTOC_ZIP &&
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc &&
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' &&
rm -f $PROTOC_ZIP

COPY proto proto

RUN cargo build --release --bin text-embeddings-router -F grpc -F ort --no-default-features && sccache -s
RUN cargo build --release --bin text-embeddings-router -F grpc -F candle --no-default-features && sccache -s

FROM debian:bookworm-slim AS base

Expand All @@ -61,9 +61,8 @@ ENV HUGGINGFACE_HUB_CACHE=/data \

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

libssl-dev &&
rm -rf /var/lib/apt/lists/*

FROM base AS grpc

Expand Down

0 comments on commit 96135d5

Please sign in to comment.