Use plain golang images instead of oneapi devkit
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
9e08c23ba9
commit
ad651e9682
2 changed files with 47 additions and 12 deletions
55
Dockerfile
55
Dockerfile
|
@ -1,13 +1,26 @@
|
|||
FROM intel/oneapi-basekit:2024.2.0-devel-rockylinux9 as build
|
||||
# Build stage
|
||||
FROM golang:1.22-bookworm as build
|
||||
|
||||
RUN wget $(echo "https://pkgs.dyn.su/el9/base/x86_64/raven-release.el9.noarch.rpm" | sed "s/el9/el$(rpm -q --queryformat '%{RELEASE}' rpm | grep -oP 'el\K[0-9]+')/g") && \
|
||||
rpm -ivh raven-release*.rpm && \
|
||||
rm -rf raven-release*.rpm && \
|
||||
dnf update -y && \
|
||||
dnf -y --enablerepo=raven-extras install golang && \
|
||||
dnf -y install epel-release && \
|
||||
dnf -y update && \
|
||||
dnf -y install supervisor
|
||||
# Install necessary dependencies
|
||||
RUN apt update && apt install -y \
|
||||
wget \
|
||||
gnupg \
|
||||
software-properties-common \
|
||||
git \
|
||||
apt-utils
|
||||
|
||||
# Install Intel oneAPI
|
||||
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
|
||||
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \
|
||||
apt update && \
|
||||
apt install -y --no-install-recommends \
|
||||
intel-oneapi-mkl \
|
||||
intel-oneapi-compiler-dpcpp-cpp \
|
||||
intel-oneapi-mkl-devel \
|
||||
gcc \
|
||||
g++ \
|
||||
pkg-config \
|
||||
cmake
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
@ -15,9 +28,31 @@ ARG GIN_MODE=release
|
|||
|
||||
ADD . .
|
||||
|
||||
RUN OLLAMA_CUSTOM_CPU_DEFS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_NATIVE=ON" go generate ./... && \
|
||||
RUN . /opt/intel/oneapi/setvars.sh && \
|
||||
OLLAMA_CUSTOM_CPU_DEFS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_NATIVE=ON" go generate ./... && \
|
||||
go build -ldflags="-s -w"
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt update && apt install -y --no-install-recommends \
|
||||
wget \
|
||||
gnupg \
|
||||
software-properties-common \
|
||||
supervisor && \
|
||||
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
|
||||
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \
|
||||
apt update && \
|
||||
apt install -y --no-install-recommends intel-oneapi-runtime-libs && \
|
||||
apt clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/supervisord.conf /app/supervisord.conf
|
||||
COPY --from=build /app/ollama /app/ollama
|
||||
COPY --from=build /app/run_model.sh /app/run_model.sh
|
||||
COPY --from=build /app/serve.sh /app/serve.sh
|
||||
|
||||
ENV MODEL_NAME="llama"
|
||||
ENV OLLAMA_HOST="0.0.0.0:8080"
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
nodaemon=true
|
||||
|
||||
[program:ollama]
|
||||
command=/ollama/serve.sh
|
||||
command=/app/serve.sh
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:run_model]
|
||||
command=/ollama/run_model.sh
|
||||
command=/app/run_model.sh
|
||||
autostart=true
|
||||
autorestart=false
|
||||
startsecs=0
|
||||
|
|
Loading…
Reference in a new issue