mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-23 16:02:10 +00:00
feat(dockerfile): build process
This commit is contained in:
parent
a7afde41a9
commit
20652824d9
@ -15,6 +15,7 @@ COPY router router
|
|||||||
RUN cargo chef prepare --recipe-path recipe.json
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
FROM chef AS builder
|
FROM chef AS builder
|
||||||
|
ENV CMAKE_INSTALL_PREFIX=${CWD}/dist
|
||||||
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y \
|
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y \
|
||||||
clang \
|
clang \
|
||||||
cmake \
|
cmake \
|
||||||
@ -26,7 +27,6 @@ RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y \
|
|||||||
openssl \
|
openssl \
|
||||||
python3-dev
|
python3-dev
|
||||||
|
|
||||||
|
|
||||||
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 \
|
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 --install /usr/bin/c++ c++ /usr/bin/clang 10 \
|
||||||
&& update-alternatives --auto cc \
|
&& update-alternatives --auto cc \
|
||||||
@ -36,7 +36,7 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 \
|
|||||||
&& cc --version \
|
&& cc --version \
|
||||||
&& c++ --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
|
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
|
COPY Cargo.lock Cargo.lock
|
||||||
@ -48,4 +48,8 @@ COPY launcher launcher
|
|||||||
COPY router router
|
COPY router router
|
||||||
|
|
||||||
ENV RUSTFLAGS="-L/usr/lib"
|
ENV RUSTFLAGS="-L/usr/lib"
|
||||||
RUN cargo build --profile release-opt --package text-generation-backend-llamacpp --bin text-generation-backend-llamacpp --frozen
|
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/
|
Loading…
Reference in New Issue
Block a user