From 20652824d99076f58e989f46430f68b2d619f489 Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Wed, 6 Nov 2024 17:33:37 +0100 Subject: [PATCH] feat(dockerfile): build process --- Dockerfile.llamacpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile.llamacpp b/Dockerfile.llamacpp index e24ce9bd..0864c1ba 100644 --- a/Dockerfile.llamacpp +++ b/Dockerfile.llamacpp @@ -15,6 +15,7 @@ COPY router router RUN cargo chef prepare --recipe-path recipe.json FROM chef AS builder +ENV CMAKE_INSTALL_PREFIX=${CWD}/dist RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y \ clang \ cmake \ @@ -26,7 +27,6 @@ RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y \ openssl \ python3-dev - RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 \ && update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 10 \ && update-alternatives --auto cc \ @@ -36,7 +36,7 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 \ && cc --version \ && c++ --version -COPY --from=planner usr/src/text-generation-inference/recipe.json recipe.json +COPY --from=planner /usr/src/text-generation-inference/recipe.json recipe.json RUN cargo chef cook --profile release-opt --package text-generation-backend-llamacpp --bin text-generation-backend-llamacpp --recipe-path recipe.json COPY Cargo.lock Cargo.lock @@ -48,4 +48,8 @@ COPY launcher launcher COPY router router ENV RUSTFLAGS="-L/usr/lib" -RUN cargo build --profile release-opt --package text-generation-backend-llamacpp --bin text-generation-backend-llamacpp --frozen \ No newline at end of file +RUN cargo build --profile release-opt --package text-generation-backend-llamacpp --bin text-generation-backend-llamacpp --frozen + +FROM ubuntu:24.04 +COPY --from=builder /usr/src/text-generation-inference/target/release-opt/text-generation-backend-llamacpp /usr/src/text-generation-inference/text-generation-launcher +COPY --from=builder /usr/src/text-generation-inference/dist /usr/ \ No newline at end of file