Skip to content

Commit 03e642a

Browse files
committed
devops: attempt at making it cache the build
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
1 parent 0084c88 commit 03e642a

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

.devops/s390x.Dockerfile

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,38 @@ ARG DEBIAN_VERSION=12
33

44
FROM gcc:${GCC_VERSION} AS build
55

6-
RUN apt update && \
6+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
7+
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
8+
apt update -y && \
79
apt upgrade -y && \
8-
apt install -y git cmake libcurl4-openssl-dev libopenblas-openmp-dev
10+
apt install -y --no-install-recommends \
11+
git cmake ccache ninja-build \
12+
libcurl4-openssl-dev libopenblas-openmp-dev && \
13+
rm -rf /var/lib/apt/lists/*
914

1015
WORKDIR /app
11-
COPY . .
16+
COPY CMakeLists.txt .
17+
COPY CMakePresets.json .
1218

1319
RUN --mount=type=cache,target=/root/.ccache \
14-
cmake -S . -B build \
20+
--mount=type=cache,target=/app/build \
21+
cmake -S . -B build -G Ninja \
1522
-DCMAKE_BUILD_TYPE=Release \
23+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
24+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
1625
-DLLAMA_BUILD_TESTS=OFF \
1726
-DGGML_NATIVE=OFF \
1827
-DGGML_BACKEND_DL=ON \
1928
-DGGML_CPU_ALL_VARIANTS=OFF \
2029
-DGGML_BLAS=ON \
21-
-DGGML_BLAS_VENDOR=OpenBLAS \
22-
&& cmake --build build --config Release -j $(nproc) \
23-
&& cmake --install build --prefix /opt/llama.cpp
30+
-DGGML_BLAS_VENDOR=OpenBLAS
31+
32+
COPY . .
33+
34+
RUN --mount=type=cache,target=/root/.ccache \
35+
--mount=type=cache,target=/app/build \
36+
cmake --build build --config Release -j $(nproc) && \
37+
cmake --install build --prefix /opt/llama.cpp
2438

2539
# TODO: DOUBLE CHECK ALL FILES ARE COPIED INTO COLLECTOR
2640
RUN cp *.py /opt/llama.cpp \

0 commit comments

Comments
 (0)