From 622aaa9f7d0b9126dfb77c95144eeb0a9acbea25 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 5 Nov 2023 10:31:33 +0100 Subject: [PATCH] dockerfile: avoid pushing a big layer Signed-off-by: Ettore Di Giacinto --- Dockerfile | 21 ++++++++++++++++++++- Makefile | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b03a7cfa..fd9ce122 100644 --- a/Dockerfile +++ b/Dockerfile @@ -178,8 +178,27 @@ COPY --from=builder /build/local-ai ./ # do not let stablediffusion rebuild (requires an older version of absl) COPY --from=builder /build/backend-assets/grpc/stablediffusion ./backend-assets/grpc/stablediffusion +## Duplicated from Makefile to avoid having a big layer that's hard to push RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ - PATH=$PATH:/opt/conda/bin make prepare-extra-conda-environments \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/autogptq \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/bark \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/diffusers \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/vllm \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/huggingface \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/vall-e-x \ + ; fi +RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \ + PATH=$PATH:/opt/conda/bin make -C extra/grpc/vall-e-x \ ; fi # Copy VALLE-X as it's not a real "lib" diff --git a/Makefile b/Makefile index 890c27e4..758f1a0d 100644 --- a/Makefile +++ b/Makefile @@ -386,7 +386,7 @@ protogen-python: python3 -m grpc_tools.protoc -Ipkg/grpc/proto/ --python_out=extra/grpc/vllm/ --grpc_python_out=extra/grpc/vllm/ pkg/grpc/proto/backend.proto ## GRPC - +# Note: it is duplicated in the Dockerfile prepare-extra-conda-environments: $(MAKE) -C extra/grpc/autogptq $(MAKE) -C extra/grpc/bark