Skip to content

Commit a57cf61

Browse files
feat: add all methods to vertex API (#192)
1 parent 5e60d06 commit a57cf61

File tree

6 files changed

+505
-122
lines changed

6 files changed

+505
-122
lines changed

Dockerfile-cuda-all

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ FROM base-builder AS builder
3333

3434
ARG GIT_SHA
3535
ARG DOCKER_LABEL
36+
ARG VERTEX
3637

3738
# sccache specific variables
3839
ARG ACTIONS_CACHE_URL
@@ -45,39 +46,69 @@ COPY --from=planner /usr/src/recipe.json recipe.json
4546

4647
FROM builder as builder-75
4748

48-
RUN CUDA_COMPUTE_CAP=75 cargo chef cook --release --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s
49+
RUN if [ $VERTEX = "true" ]; \
50+
then \
51+
CUDA_COMPUTE_CAP=75 cargo chef cook --release --features google --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
52+
else \
53+
CUDA_COMPUTE_CAP=75 cargo chef cook --release --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
54+
fi;
4955

5056
COPY backends backends
5157
COPY core core
5258
COPY router router
5359
COPY Cargo.toml ./
5460
COPY Cargo.lock ./
5561

56-
RUN CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http --no-default-features && sccache -s
62+
RUN if [ $VERTEX = "true" ]; \
63+
then \
64+
CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http -F google --no-default-features && sccache -s; \
65+
else \
66+
CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http --no-default-features && sccache -s; \
67+
fi;
5768

5869
FROM builder as builder-80
5970

60-
RUN CUDA_COMPUTE_CAP=80 cargo chef cook --release --features candle-cuda --no-default-features --recipe-path recipe.json && sccache -s
71+
RUN if [ $VERTEX = "true" ]; \
72+
then \
73+
CUDA_COMPUTE_CAP=80 cargo chef cook --release --features google --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
74+
else \
75+
CUDA_COMPUTE_CAP=80 cargo chef cook --release --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
76+
fi;
6177

6278
COPY backends backends
6379
COPY core core
6480
COPY router router
6581
COPY Cargo.toml ./
6682
COPY Cargo.lock ./
6783

68-
RUN CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda -F http --no-default-features && sccache -s
84+
RUN if [ $VERTEX = "true" ]; \
85+
then \
86+
CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http -F google --no-default-features && sccache -s; \
87+
else \
88+
CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http --no-default-features && sccache -s; \
89+
fi;
6990

7091
FROM builder as builder-90
7192

72-
RUN CUDA_COMPUTE_CAP=90 cargo chef cook --release --features candle-cuda --no-default-features --recipe-path recipe.json && sccache -s
93+
RUN if [ $VERTEX = "true" ]; \
94+
then \
95+
CUDA_COMPUTE_CAP=90 cargo chef cook --release --features google --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
96+
else \
97+
CUDA_COMPUTE_CAP=90 cargo chef cook --release --features candle-cuda-turing --no-default-features --recipe-path recipe.json && sccache -s; \
98+
fi;
7399

74100
COPY backends backends
75101
COPY core core
76102
COPY router router
77103
COPY Cargo.toml ./
78104
COPY Cargo.lock ./
79105

80-
RUN CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda -F http --no-default-features && sccache -s
106+
RUN if [ $VERTEX = "true" ]; \
107+
then \
108+
CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http -F google --no-default-features && sccache -s; \
109+
else \
110+
CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F http --no-default-features && sccache -s; \
111+
fi;
81112

82113
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 as base
83114

0 commit comments

Comments
 (0)