Skip to content

Commit 4f65e33

Browse files
committed
devops: finalise docker images for s390x
Signed-off-by: Aaron Teo <[email protected]>
1 parent 557320c commit 4f65e33

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

.devops/cpu.Dockerfile

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
ARG UBUNTU_VERSION=22.04
2-
ARG GCC_VERSION=15.2.0
32

4-
FROM gcc:$GCC_VERSION AS build
3+
FROM ubuntu:$UBUNTU_VERSION AS build
54

65
ARG TARGETARCH
76

87
RUN apt-get update && \
9-
apt-get install -y git cmake libcurl4-openssl-dev
10-
11-
RUN if [ "$TARGETARCH" = "s390x" ]; then \
12-
apt-get install -y libopenblas-dev; \
13-
fi
8+
apt-get install -y build-essential git cmake libcurl4-openssl-dev
149

1510
WORKDIR /app
1611

1712
COPY . .
1813

1914
RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
2015
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
21-
elif [ "$TARGETARCH" = "s390x" ]; then \
22-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS; \
2316
else \
2417
echo "Unsupported architecture"; \
2518
exit 1; \
@@ -40,13 +33,8 @@ RUN mkdir -p /app/full \
4033
## Base image
4134
FROM ubuntu:$UBUNTU_VERSION AS base
4235

43-
ARG TARGETARCH
44-
4536
RUN apt-get update \
46-
&& apt-get install -y libgomp1 curl \
47-
&& if [ "$TARGETARCH" = "s390x" ]; then \
48-
apt-get install -y libopenblas-dev; \
49-
fi \
37+
&& apt-get install -y libgomp1 curl\
5038
&& apt autoremove -y \
5139
&& apt clean -y \
5240
&& rm -rf /tmp/* /var/tmp/* \

.devops/s390x.Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG GCC_VERSION=15.2.0
22
ARG UBUNTU_VERSION=24.04
33

4-
4+
### Build stage
55
FROM --platform=linux/s390x gcc:${GCC_VERSION} AS build
66

77
RUN --mount=type=cache,target=/var/cache/apt \
@@ -30,16 +30,13 @@ RUN --mount=type=cache,target=/root/.ccache \
3030
cmake --build build --config Release -j $(nproc) && \
3131
cmake --install build --prefix /opt/llama.cpp
3232

33-
# TODO: DOUBLE CHECK ALL FILES ARE COPIED INTO COLLECTOR
3433
COPY *.py /opt/llama.cpp/bin
3534
COPY .devops/tools.sh /opt/llama.cpp/bin
3635

3736
COPY gguf-py /opt/llama.cpp/gguf-py
3837
COPY requirements.txt /opt/llama.cpp/gguf-py
3938
COPY requirements /opt/llama.cpp/gguf-py/requirements
4039

41-
RUN ls -laR /opt/llama.cpp
42-
4340

4441
### Collect all llama.cpp binaries, libraries and distro libraries
4542
FROM --platform=linux/s390x scratch AS collector
@@ -103,7 +100,7 @@ FROM --platform=linux/s390x base AS light
103100
WORKDIR /llama.cpp/bin
104101

105102
# Copy llama.cpp binaries and libraries
106-
COPY --from=collector /llama.cpp/bin/llama-cli /llama.cpp/bin
103+
COPY --from=collector /llama.cpp/bin/llama-cli /llama.cpp/bin
107104

108105
ENTRYPOINT [ "/llama.cpp/bin/llama-cli" ]
109106

0 commit comments

Comments
 (0)