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 0000000000000000000000000000000000000000..074c2a4a616711522c3ae092bb14d66583950255 --- /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 0000000000000000000000000000000000000000..b744b4478b3c1833dd349a8fcdf401ea56581e7d --- /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 0000000000000000000000000000000000000000..cae54f03f0ede17cd557d250e52ba357f75c54b9 --- /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 0000000000000000000000000000000000000000..6985ae55df8fbce97f9e05157572ad4c281bbb47 --- /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 0000000000000000000000000000000000000000..8bafe10fa5e9e6f946fe6aa9944d7ce7b7769d1f --- /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 0000000000000000000000000000000000000000..5d5b47f7e5b26b58e36bb9443130e8e1641c99a2 --- /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 5512f06291ef1784105cdb3971f3ae1eaf2d566a..eda76c8faf53cb4ac73e84f6255875d935f5b288 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