From 577d36b5964ba0873b945f2ea00404ed52556408 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 30 May 2023 15:58:10 +0200 Subject: [PATCH] images: cleanup, drop .dev Dockerfile (#437) Signed-off-by: mudler --- Dockerfile | 3 - Dockerfile.dev | 79 ------------------- docker-compose.yaml | 2 +- examples/chatbot-ui/docker-compose.yaml | 2 +- examples/discord-bot/docker-compose.yaml | 2 +- examples/langchain-python/docker-compose.yaml | 2 +- examples/langchain/docker-compose.yaml | 2 +- examples/rwkv/docker-compose.yaml | 2 +- examples/slack-bot/docker-compose.yaml | 2 +- 9 files changed, 7 insertions(+), 89 deletions(-) delete mode 100644 Dockerfile.dev diff --git a/Dockerfile b/Dockerfile index 2401e95b..f7fdbb8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,9 +55,6 @@ ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility ENV NVIDIA_REQUIRE_CUDA="cuda>=${CUDA_MAJOR_VERSION}.0" ENV NVIDIA_VISIBLE_DEVICES=all ENV HEALTHCHECK_ENDPOINT=http://localhost:8080/readyz -ENV HEALTHCHECK_TIMEOUT=10m -ENV HEALTHCHECK_INTERVAL=10m -ENV HEALTHCHECK_RETRIES=10m ENV REBUILD=true diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index bc4a3377..00000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,79 +0,0 @@ -ARG GO_VERSION=1.20 -ARG DEBIAN_VERSION=11 -FROM golang:$GO_VERSION as builder - -ARG BUILD_TYPE= -ARG GO_TAGS= -ARG CUDA_MAJOR_VERSION=11 -ARG CUDA_MINOR_VERSION=7 - -ENV BUILD_TYPE=${BUILD_TYPE} -ENV GO_TAGS=${GO_TAGS} - -WORKDIR /build - -RUN apt-get update && \ - apt-get install -y cmake - -# CuBLAS requirements -RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ - apt-get install -y software-properties-common && \ - apt-add-repository contrib && \ - curl -O https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.0-1_all.deb && \ - dpkg -i cuda-keyring_1.0-1_all.deb && \ - rm -f cuda-keyring_1.0-1_all.deb && \ - apt-get update && \ - apt-get install -y cuda-nvcc-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcublas-dev-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} \ - ; fi -ENV PATH /usr/local/cuda/bin:${PATH} - -# OpenBLAS requirements -RUN apt-get install -y libopenblas-dev - -# Stable Diffusion requirements -RUN apt-get install -y libopencv-dev && \ - ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 - -COPY . . -RUN make build - -FROM debian:$DEBIAN_VERSION - -ARG BUILD_TYPE= -ARG GO_TAGS= -ARG CUDA_MAJOR_VERSION=11 -ARG CUDA_MINOR_VERSION=7 - -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility -ENV NVIDIA_REQUIRE_CUDA="cuda>=${CUDA_MAJOR_VERSION}.0" -ENV NVIDIA_VISIBLE_DEVICES=all -ENV HEALTHCHECK_ENDPOINT=http://localhost:8080/readyz - -RUN apt-get update && \ - apt-get install -y ca-certificates curl - -# CuBLAS requirements -RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ - apt-get install -y curl software-properties-common && \ - apt-add-repository contrib && \ - curl -O https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.0-1_all.deb && \ - dpkg -i cuda-keyring_1.0-1_all.deb && \ - rm -f cuda-keyring_1.0-1_all.deb && \ - apt-get update && \ - apt-get install -y cuda-cudart-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcublas-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} \ - ; fi - -# OpenBLAS requirements -RUN apt-get install -y libopenblas0 - -# Stable Diffusion requirements -RUN apt-get install -y libgomp1 libopencv-core4.5 libopencv-imgcodecs4.5 - -COPY --from=builder /build/local-ai /usr/bin/local-ai - -# Define the health check command -HEALTHCHECK --interval=1m --timeout=10m --retries=10 \ - CMD curl -f $HEALTHCHECK_ENDPOINT || exit 1 - -EXPOSE 8080 -ENTRYPOINT [ "/usr/bin/local-ai" ] diff --git a/docker-compose.yaml b/docker-compose.yaml index f7d76538..6217b9f6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: . - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 env_file: diff --git a/examples/chatbot-ui/docker-compose.yaml b/examples/chatbot-ui/docker-compose.yaml index a5f94aca..c7782c34 100644 --- a/examples/chatbot-ui/docker-compose.yaml +++ b/examples/chatbot-ui/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: diff --git a/examples/discord-bot/docker-compose.yaml b/examples/discord-bot/docker-compose.yaml index 6a10f306..e7ee6b4c 100644 --- a/examples/discord-bot/docker-compose.yaml +++ b/examples/discord-bot/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: diff --git a/examples/langchain-python/docker-compose.yaml b/examples/langchain-python/docker-compose.yaml index ed3eaec6..8bd61b5f 100644 --- a/examples/langchain-python/docker-compose.yaml +++ b/examples/langchain-python/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: diff --git a/examples/langchain/docker-compose.yaml b/examples/langchain/docker-compose.yaml index cafcb490..32564fef 100644 --- a/examples/langchain/docker-compose.yaml +++ b/examples/langchain/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: diff --git a/examples/rwkv/docker-compose.yaml b/examples/rwkv/docker-compose.yaml index ed3eaec6..8bd61b5f 100644 --- a/examples/rwkv/docker-compose.yaml +++ b/examples/rwkv/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: diff --git a/examples/slack-bot/docker-compose.yaml b/examples/slack-bot/docker-compose.yaml index 35a7501a..12cb70b0 100644 --- a/examples/slack-bot/docker-compose.yaml +++ b/examples/slack-bot/docker-compose.yaml @@ -5,7 +5,7 @@ services: image: quay.io/go-skynet/local-ai:latest build: context: ../../ - dockerfile: Dockerfile.dev + dockerfile: Dockerfile ports: - 8080:8080 environment: