Skip to content

Commit f843477

Browse files
committed
Remove both Google Vertex & AWS SageMaker from Dockerfile-cuda-all
Neither of those is required, since both Google Cloud and AWS SageMaker port the `Dockerfile-cuda-all` as-is, and then re-builds it there, meaning that the actual BUILD_ARG for VERTEX is not being used at all, neither the AWS SageMaker stage. For more information check the repositories https://github.com/huggingface/Google-Cloud-Containers/tree/main/containers/tei, and https://github.com/awslabs/llm-hosting-container/tree/main/huggingface/pytorch/tei/docker, respectively for Google Cloud and AWS SageMaker.
1 parent b55218f commit f843477

File tree

1 file changed

+7
-53
lines changed

1 file changed

+7
-53
lines changed

Dockerfile-cuda-all

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ FROM base-builder AS builder
3535

3636
ARG GIT_SHA
3737
ARG DOCKER_LABEL
38-
ARG VERTEX="false"
3938

4039
# sccache specific variables
4140
ARG SCCACHE_GHA_ENABLED
@@ -51,39 +50,19 @@ COPY --from=planner /usr/src/recipe.json recipe.json
5150

5251
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
5352
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
54-
if [ $VERTEX = "true" ]; \
55-
then \
56-
cargo chef cook --release --features google --recipe-path recipe.json && sccache -s; \
57-
else \
58-
cargo chef cook --release --recipe-path recipe.json && sccache -s; \
59-
fi;
53+
cargo chef cook --release --recipe-path recipe.json && sccache -s;
6054

6155
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
6256
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
63-
if [ $VERTEX = "true" ]; \
64-
then \
65-
CUDA_COMPUTE_CAP=75 cargo chef cook --release --features google --features candle-cuda-turing --recipe-path recipe.json && sccache -s; \
66-
else \
67-
CUDA_COMPUTE_CAP=75 cargo chef cook --release --features candle-cuda-turing --recipe-path recipe.json && sccache -s; \
68-
fi;
57+
CUDA_COMPUTE_CAP=75 cargo chef cook --release --features candle-cuda-turing --recipe-path recipe.json && sccache -s;
6958

7059
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
7160
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
72-
if [ $VERTEX = "true" ]; \
73-
then \
74-
CUDA_COMPUTE_CAP=80 cargo chef cook --release --features google --features candle-cuda --recipe-path recipe.json && sccache -s; \
75-
else \
76-
CUDA_COMPUTE_CAP=80 cargo chef cook --release --features candle-cuda --recipe-path recipe.json && sccache -s; \
77-
fi;
61+
CUDA_COMPUTE_CAP=80 cargo chef cook --release --features candle-cuda --recipe-path recipe.json && sccache -s;
7862

7963
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
8064
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
81-
if [ $VERTEX = "true" ]; \
82-
then \
83-
CUDA_COMPUTE_CAP=90 cargo chef cook --release --features google --features candle-cuda --recipe-path recipe.json && sccache -s; \
84-
else \
85-
CUDA_COMPUTE_CAP=90 cargo chef cook --release --features candle-cuda --recipe-path recipe.json && sccache -s; \
86-
fi;
65+
CUDA_COMPUTE_CAP=90 cargo chef cook --release --features candle-cuda --recipe-path recipe.json && sccache -s;
8766

8867
COPY backends backends
8968
COPY core core
@@ -93,34 +72,19 @@ COPY Cargo.lock ./
9372

9473
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
9574
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
96-
if [ $VERTEX = "true" ]; \
97-
then \
98-
CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing -F google && sccache -s; \
99-
else \
100-
CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing && sccache -s; \
101-
fi;
75+
CUDA_COMPUTE_CAP=75 cargo build --release --bin text-embeddings-router -F candle-cuda-turing && sccache -s;
10276

10377
RUN mv /usr/src/target/release/text-embeddings-router /usr/src/target/release/text-embeddings-router-75
10478

10579
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
10680
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
107-
if [ $VERTEX = "true" ]; \
108-
then \
109-
CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda -F google && sccache -s; \
110-
else \
111-
CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda && sccache -s; \
112-
fi;
81+
CUDA_COMPUTE_CAP=80 cargo build --release --bin text-embeddings-router -F candle-cuda && sccache -s;
11382

11483
RUN mv /usr/src/target/release/text-embeddings-router /usr/src/target/release/text-embeddings-router-80
11584

11685
RUN --mount=type=secret,id=actions_results_url,env=ACTIONS_RESULTS_URL \
11786
--mount=type=secret,id=actions_runtime_token,env=ACTIONS_RUNTIME_TOKEN \
118-
if [ $VERTEX = "true" ]; \
119-
then \
120-
CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda -F google && sccache -s; \
121-
else \
122-
CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda && sccache -s; \
123-
fi;
87+
CUDA_COMPUTE_CAP=90 cargo build --release --bin text-embeddings-router -F candle-cuda && sccache -s;
12488

12589
RUN mv /usr/src/target/release/text-embeddings-router /usr/src/target/release/text-embeddings-router-90
12690

@@ -142,16 +106,6 @@ COPY --from=builder /usr/src/target/release/text-embeddings-router-75 /usr/local
142106
COPY --from=builder /usr/src/target/release/text-embeddings-router-80 /usr/local/bin/text-embeddings-router-80
143107
COPY --from=builder /usr/src/target/release/text-embeddings-router-90 /usr/local/bin/text-embeddings-router-90
144108

145-
# Amazon SageMaker compatible image
146-
FROM base AS sagemaker
147-
148-
COPY --chmod=775 sagemaker-entrypoint-cuda-all.sh entrypoint.sh
149-
150-
ENTRYPOINT ["./entrypoint.sh"]
151-
152-
# Default image
153-
FROM base
154-
155109
COPY --chmod=775 cuda-all-entrypoint.sh entrypoint.sh
156110

157111
ENTRYPOINT ["./entrypoint.sh"]

0 commit comments

Comments
 (0)