Skip to content

Commit ce80d3e

Browse files
committed
Add OpenBLAS Dockerfiles
1 parent f37615c commit ce80d3e

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.devops/full-openblas.Dockerfile

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

0 commit comments

Comments
 (0)