fix: always install OpenBLAS and Stable Diffusion requirements

This commit is contained in:
Sébastien Prud'homme 2023-05-29 21:14:09 +02:00
parent a7fe65a54c
commit 65809f303e
2 changed files with 17 additions and 20 deletions

View file

@ -19,6 +19,7 @@ WORKDIR /build
RUN apt-get update && \
apt-get install -y ca-certificates cmake curl
# CuBLAS requirements
RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \
apt-get install -y software-properties-common && \
apt-add-repository contrib && \
@ -30,14 +31,12 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \
; fi
ENV PATH /usr/local/cuda/bin:${PATH}
RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \
apt-get install -y libopenblas-dev \
; fi
# OpenBLAS requirements
RUN apt-get install -y libopenblas-dev
RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \
apt-get install -y libopencv-dev && \
ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 \
; fi
# Stable Diffusion requirements
RUN apt-get install -y libopencv-dev && \
ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2
COPY . .
RUN make build

View file

@ -15,6 +15,7 @@ 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 && \
@ -26,14 +27,12 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \
; fi
ENV PATH /usr/local/cuda/bin:${PATH}
RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \
apt-get install -y libopenblas-dev \
; fi
# OpenBLAS requirements
RUN apt-get install -y libopenblas-dev
RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \
apt-get install -y libopencv-dev && \
ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 \
; fi
# Stable Diffusion requirements
RUN apt-get install -y libopencv-dev && \
ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2
COPY . .
RUN make build
@ -53,6 +52,7 @@ 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 && \
@ -63,13 +63,11 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \
apt-get install -y cuda-cudart-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcublas-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} \
; fi
RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \
apt-get install -y libopenblas0 \
; fi
# OpenBLAS requirements
RUN apt-get install -y libopenblas0
RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \
apt-get install -y libgomp1 libopencv-core4.5 libopencv-imgcodecs4.5 \
; fi
# 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