Skip to content

Commit 1722df2

Browse files
committed
Add OpenBLAS Dockerfiles
1 parent 3821734 commit 1722df2

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.devops/full-openblas.Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG UBUNTU_VERSION=22.04
2+
3+
FROM ubuntu:$UBUNTU_VERSION AS build
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential python3 python3-pip git cmake libcurl4-openssl-dev libgomp1 libopenblas-openmp-dev pkg-config && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9+
10+
COPY requirements.txt requirements.txt
11+
COPY requirements requirements
12+
13+
RUN pip install --upgrade pip setuptools wheel \
14+
&& pip install -r requirements.txt
15+
16+
WORKDIR /app
17+
18+
COPY . .
19+
20+
RUN cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DLLAMA_CURL=ON && \
21+
cmake --build build --config Release -j$(nproc) && \
22+
cp build/bin/* .
23+
24+
ENV LC_ALL=C.utf8
25+
26+
ENTRYPOINT ["/app/.devops/tools.sh"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG UBUNTU_VERSION=22.04
2+
3+
FROM ubuntu:$UBUNTU_VERSION AS build
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential git cmake libopenblas-openmp-dev pkg-config && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9+
10+
WORKDIR /app
11+
12+
COPY . .
13+
14+
RUN cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS && \
15+
cmake --build build --config Release --target llama-cli -j$(nproc)
16+
17+
ENV LC_ALL=C.utf8
18+
19+
ENTRYPOINT [ "/app/build/bin/llama-cli" ]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG UBUNTU_VERSION=22.04
2+
3+
FROM ubuntu:$UBUNTU_VERSION AS build
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential git cmake libcurl4-openssl-dev libopenblas-openmp-dev pkg-config && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9+
10+
WORKDIR /app
11+
12+
COPY . .
13+
14+
RUN cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DLLAMA_CURL=ON && \
15+
cmake --build build --config Release --target llama-server -j$(nproc)
16+
17+
ENV LC_ALL=C.utf8
18+
# Must be set to 0.0.0.0 so it can listen to requests from host machine
19+
ENV LLAMA_ARG_HOST=0.0.0.0
20+
21+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
22+
23+
ENTRYPOINT [ "/app/build/bin/llama-server" ]

0 commit comments

Comments
 (0)