mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-09 11:24:53 +00:00
faster builds
This commit is contained in:
parent
787e20a199
commit
18e8f03070
8
.github/workflows/build.yaml
vendored
8
.github/workflows/build.yaml
vendored
@ -15,6 +15,10 @@ jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2.0.0
|
||||
with:
|
||||
install: true
|
||||
- name: Tailscale
|
||||
uses: tailscale/github-action@v1
|
||||
with:
|
||||
@ -65,5 +69,5 @@ jobs:
|
||||
platforms: 'linux/amd64'
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=ghcr.io/huggingface/text-generation-inference:latest
|
||||
cache-to: type=inline
|
||||
cache-from: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
|
||||
cache-to: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
|
36
Dockerfile
36
Dockerfile
@ -1,4 +1,15 @@
|
||||
FROM rust:1.67 as router-builder
|
||||
FROM lukemathwalker/cargo-chef:latest-rust-1.67 AS chef
|
||||
WORKDIR /usr/src
|
||||
|
||||
FROM chef as planner
|
||||
COPY Cargo.toml Cargo.toml
|
||||
COPY rust-toolchain.toml rust-toolchain.toml
|
||||
COPY proto proto
|
||||
COPY router router
|
||||
COPY launcher launcher
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
|
||||
FROM chef AS builder
|
||||
|
||||
RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip && \
|
||||
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.12/$PROTOC_ZIP && \
|
||||
@ -6,26 +17,15 @@ RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip && \
|
||||
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \
|
||||
rm -f $PROTOC_ZIP
|
||||
|
||||
WORKDIR /usr/src
|
||||
COPY --from=planner /usr/src/recipe.json recipe.json
|
||||
RUN cargo chef cook --release --recipe-path recipe.json
|
||||
|
||||
COPY Cargo.toml Cargo.toml
|
||||
COPY rust-toolchain.toml rust-toolchain.toml
|
||||
COPY proto proto
|
||||
COPY router router
|
||||
|
||||
WORKDIR /usr/src/router
|
||||
|
||||
RUN cargo install --path .
|
||||
|
||||
FROM rust:1.67 as launcher-builder
|
||||
|
||||
WORKDIR /usr/src
|
||||
|
||||
COPY rust-toolchain.toml rust-toolchain.toml
|
||||
COPY launcher launcher
|
||||
|
||||
WORKDIR /usr/src/launcher
|
||||
|
||||
RUN cargo install --path .
|
||||
RUN cargo build --release
|
||||
|
||||
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
||||
|
||||
@ -69,9 +69,9 @@ RUN cd server && \
|
||||
/opt/miniconda/envs/text-generation/bin/pip install ".[bnb]" --no-cache-dir
|
||||
|
||||
# Install router
|
||||
COPY --from=router-builder /usr/local/cargo/bin/text-generation-router /usr/local/bin/text-generation-router
|
||||
COPY --from=builder /usr/src/target/release/text-generation-router /usr/local/bin/text-generation-router
|
||||
# Install launcher
|
||||
COPY --from=launcher-builder /usr/local/cargo/bin/text-generation-launcher /usr/local/bin/text-generation-launcher
|
||||
COPY --from=builder /usr/src/target/release/text-generation-launcher /usr/local/bin/text-generation-launcher
|
||||
|
||||
ENTRYPOINT ["text-generation-launcher"]
|
||||
CMD ["--json-output"]
|
Loading…
Reference in New Issue
Block a user