Skip to content

Commit d1d164b

Browse files
committed
feat(conda): add make target and entrypoints for the dockerfile
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 896610a commit d1d164b

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARG TARGETARCH
1414
ARG TARGETVARIANT
1515

1616
ENV BUILD_TYPE=${BUILD_TYPE}
17-
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/autogptq.py,bark:/build/extra/grpc/bark/ttsbark.py,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py,vllm:/build/extra/grpc/vllm/backend_vllm.py"
17+
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/run.sh,bark:/build/extra/grpc/bark/run.sh,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py,vllm:/build/extra/grpc/vllm/backend_vllm.py"
1818
ENV GALLERIES='[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"url": "github:go-skynet/model-gallery/huggingface.yaml","name":"huggingface"}]'
1919
ARG GO_TAGS="stablediffusion tts"
2020

@@ -166,6 +166,10 @@ COPY --from=builder /build/local-ai ./
166166
# do not let stablediffusion rebuild (requires an older version of absl)
167167
COPY --from=builder /build/backend-assets/grpc/stablediffusion ./backend-assets/grpc/stablediffusion
168168

169+
RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
170+
make prepare-extra-conda-environments \
171+
; fi
172+
169173
# Copy VALLE-X as it's not a real "lib"
170174
RUN if [ -d /usr/lib/vall-e-x ]; then \
171175
cp -rfv /usr/lib/vall-e-x/* ./ ; \

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ protogen-python:
409409

410410
## GRPC
411411

412+
prepare-extra-conda-environments:
413+
$(MAKE) -C extra/grpc/autogptq
414+
$(MAKE) -C extra/grpc/bark
415+
412416
backend-assets/grpc:
413417
mkdir -p backend-assets/grpc
414418

extra/grpc/autogptq/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
##
2+
## A bash script wrapper that runs the autogptq server with conda
3+
4+
# Activate conda environment
5+
source activate autogptq
6+
7+
# get the directory where the bash script is located
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9+
10+
python $DIR/autogptq.py

extra/grpc/bark/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
##
2+
## A bash script wrapper that runs the ttsbark server with conda
3+
4+
# Activate conda environment
5+
source activate ttsbark
6+
7+
# get the directory where the bash script is located
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9+
10+
python $DIR/ttsbark.py

0 commit comments

Comments
 (0)