From 6d2d31069c85b5ec14b32ad5bf5df956c771d401 Mon Sep 17 00:00:00 2001 From: zhihang Date: Tue, 5 Nov 2024 17:27:37 +0000 Subject: [PATCH] fix: update text-generation-inference-cpu/2.4.0/24.03-lts/Dockerfile --- codetrans-ui/1.0/24.03-lts/Dockerfile | 28 ++++++++++++++ codetrans-ui/meta.yml | 3 ++ codetrans/1.0/24.03-lts/Dockerfile | 38 +++++++++++++++++++ codetrans/meta.yml | 3 ++ llm-tgi/1.0/24.03-lts/Dockerfile | 32 ++++++++++++++++ llm-tgi/meta.yml | 3 ++ .../2.4.0/24.03-lts/Dockerfile | 36 +++++++----------- 7 files changed, 121 insertions(+), 22 deletions(-) create mode 100644 codetrans-ui/1.0/24.03-lts/Dockerfile create mode 100644 codetrans-ui/meta.yml create mode 100644 codetrans/1.0/24.03-lts/Dockerfile create mode 100644 codetrans/meta.yml create mode 100644 llm-tgi/1.0/24.03-lts/Dockerfile create mode 100644 llm-tgi/meta.yml diff --git a/codetrans-ui/1.0/24.03-lts/Dockerfile b/codetrans-ui/1.0/24.03-lts/Dockerfile new file mode 100644 index 00000000..074c2a4a --- /dev/null +++ b/codetrans-ui/1.0/24.03-lts/Dockerfile @@ -0,0 +1,28 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Use node 20.11.1 as the base image +FROM openeuler/openeuler:24.03-lts + +# Update package manager and install Git +RUN yum update -y && yum install -y git npm + +WORKDIR /home/user + +# Copy the front-end code repository +RUN git clone https://gitee.com/zhihang161013/GenAIExamples.git + +# Set the working directory +WORKDIR /home/user/GenAIExamples/CodeTrans/ui/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/codetrans-ui/meta.yml b/codetrans-ui/meta.yml new file mode 100644 index 00000000..b744b447 --- /dev/null +++ b/codetrans-ui/meta.yml @@ -0,0 +1,3 @@ +1.0-oe2403lts: + path: codetrans-ui/1.0/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file diff --git a/codetrans/1.0/24.03-lts/Dockerfile b/codetrans/1.0/24.03-lts/Dockerfile new file mode 100644 index 00000000..cae54f03 --- /dev/null +++ b/codetrans/1.0/24.03-lts/Dockerfile @@ -0,0 +1,38 @@ + + +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +RUN yum update -y && \ + yum install -y --setopt=install_weak_deps=False \ + python-pip python \ + shadow-utils \ + mesa-libGL \ + jemalloc-devel \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +WORKDIR /home/user/ +RUN git clone https://gitee.com/zhihang161013/GenAIComps.git + +WORKDIR /home/user/GenAIComps +RUN pip install --no-cache-dir --upgrade pip && \ + pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt + +WORKDIR /home/user/ +RUN git clone https://gitee.com/zhihang161013/GenAIExamples.git +RUN cp GenAIExamples/CodeTrans/code_translation.py . +RUN rm -rf GenAIExamples + +ENV PYTHONPATH=/usr/bin/python:/home/user/GenAIComps + +USER user + +WORKDIR /home/user + +ENTRYPOINT ["python", "code_translation.py"] diff --git a/codetrans/meta.yml b/codetrans/meta.yml new file mode 100644 index 00000000..6985ae55 --- /dev/null +++ b/codetrans/meta.yml @@ -0,0 +1,3 @@ +1.0-oe2403lts: + path: codetrans/1.0/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file diff --git a/llm-tgi/1.0/24.03-lts/Dockerfile b/llm-tgi/1.0/24.03-lts/Dockerfile new file mode 100644 index 00000000..8bafe10f --- /dev/null +++ b/llm-tgi/1.0/24.03-lts/Dockerfile @@ -0,0 +1,32 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +RUN yum update -y && yum install -y --setopt=install_weak_deps=False \ + python-pip python \ + shadow-utils \ + mesa-libGL \ + jemalloc-devel \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +USER user + +WORKDIR /home/user/ + +RUN git clone https://gitee.com/zhihang161013/GenAIComps.git && \ + cp -r GenAIComps/comps . && \ + rm -rf GenAIComps + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/comps/llms/text-generation/tgi/requirements.txt + +ENV PYTHONPATH=/usr/bin/python:/home/user + +WORKDIR /home/user/comps/llms/text-generation/tgi + +ENTRYPOINT ["bash", "entrypoint.sh"] diff --git a/llm-tgi/meta.yml b/llm-tgi/meta.yml new file mode 100644 index 00000000..5d5b47f7 --- /dev/null +++ b/llm-tgi/meta.yml @@ -0,0 +1,3 @@ +1.0-oe2403lts: + path: llm-tgi/1.0/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file diff --git a/text-generation-inference-cpu/2.4.0/24.03-lts/Dockerfile b/text-generation-inference-cpu/2.4.0/24.03-lts/Dockerfile index 5512f062..eda76c8f 100644 --- a/text-generation-inference-cpu/2.4.0/24.03-lts/Dockerfile +++ b/text-generation-inference-cpu/2.4.0/24.03-lts/Dockerfile @@ -19,7 +19,6 @@ RUN cargo install cargo-chef --locked ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse -FROM chef AS planner RUN git clone https://github.com/huggingface/text-generation-inference.git && cd text-generation-inference && git checkout v2.4.0 RUN mv text-generation-inference/Cargo.lock Cargo.lock && \ @@ -34,8 +33,6 @@ RUN mv text-generation-inference/Cargo.lock Cargo.lock && \ RUN cargo chef prepare --recipe-path recipe.json -FROM chef AS builder - RUN yum update -y && yum install -y --setopt=install_weak_deps=False \ python3-devel \ unzip \ @@ -46,27 +43,21 @@ RUN PROTOC_ZIP=protoc-21.12-linux-x86_64.zip && \ unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \ rm -f $PROTOC_ZIP -COPY --from=planner /usr/src/recipe.json recipe.json RUN cargo chef cook --profile release-opt --recipe-path recipe.json ARG GIT_SHA ARG DOCKER_LABEL -RUN git clone https://github.com/huggingface/text-generation-inference.git && cd text-generation-inference && git checkout v2.4.0 - -RUN mv text-generation-inference/Cargo.lock Cargo.lock && \ - mv text-generation-inference/Cargo.toml Cargo.toml && \ - mv text-generation-inference/rust-toolchain.toml rust-toolchain.toml && \ - mv text-generation-inference/proto proto && \ - mv text-generation-inference/benchmark benchmark && \ - mv text-generation-inference/router router && \ - mv text-generation-inference/backends backends && \ - mv text-generation-inference/launcher launcher && \ - rm -rf text-generation-inference - -RUN cargo build --profile release-opt --offline +COPY Cargo.lock Cargo.lock +COPY Cargo.toml Cargo.toml +COPY rust-toolchain.toml rust-toolchain.toml +COPY proto proto +COPY benchmark benchmark +COPY router router +COPY backends backends +COPY launcher launcher +RUN cargo build --profile release-opt --frozen -# Text Generation Inference base image for Intel-cpu FROM openeuler/openeuler:24.03-lts AS cpu RUN yum update -y && yum install -y --setopt=install_weak_deps=False \ @@ -78,7 +69,8 @@ RUN yum update -y && yum install -y --setopt=install_weak_deps=False \ git \ wget \ cmake \ - numactl-devel + numactl-devel \ + numactl-libs RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 @@ -156,11 +148,11 @@ RUN cd server && \ pip install ".[accelerate, peft, outlines]" --no-cache-dir # Install benchmarker -COPY --from=builder /usr/src/target/release-opt/text-generation-benchmark /usr/local/bin/text-generation-benchmark +COPY --from=chef /usr/src/target/release-opt/text-generation-benchmark /usr/local/bin/text-generation-benchmark # Install router -COPY --from=builder /usr/src/target/release-opt/text-generation-router /usr/local/bin/text-generation-router +COPY --from=chef /usr/src/target/release-opt/text-generation-router /usr/local/bin/text-generation-router # Install launcher -COPY --from=builder /usr/src/target/release-opt/text-generation-launcher /usr/local/bin/text-generation-launcher +COPY --from=chef /usr/src/target/release-opt/text-generation-launcher /usr/local/bin/text-generation-launcher FROM ${PLATFORM} AS final ENV ATTENTION=paged -- Gitee