diff --git a/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile b/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8cfdefbb0ed28de270ac3b77d1cb6431f64f53cb --- /dev/null +++ b/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,41 @@ +# 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 + +# 安装依赖工具 +RUN yum update -y && \ + yum install -y curl git xz + +# 下载并安装 Node.js 官方预编译包(不依赖 yum 或 dnf) +RUN curl -fsSL https://nodejs.org/dist/v20.11.1/node-v20.11.1-linux-x64.tar.xz -o node.tar.xz && \ + tar -xf node.tar.xz && \ + mv node-v20.11.1-linux-x64 /usr/local/node && \ + ln -s /usr/local/node/bin/* /usr/bin/ && \ + rm -f node.tar.xz + +# Update package manager and install Git +RUN yum update -y && yum install -y git + +# Copy the front-end code repository +RUN git clone https://github.com/opea-project/GenAIComps.git && \ + git checkout v1.2 && \ + cp ./GenAIExamples/ChatQnA/ui/svelte /home/user/svelte + +#COPY svelte /home/user/svelte + +# Set the working directory +WORKDIR /home/user/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/AI/opea/chatqna/1.2/24.03-lts/Dockerfile b/AI/opea/chatqna/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4381ac225e942456acfd2f2513820449ee62d99c --- /dev/null +++ b/AI/opea/chatqna/1.2/24.03-lts/Dockerfile @@ -0,0 +1,61 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Stage 1: base setup used by other stages +FROM openeuler/openeuler:24.03-lts AS base + +# get security updates +#RUN apt-get update && apt-get upgrade -y && \ +# apt-get clean && rm -rf /var/lib/apt/lists/* +#RUN yum upgrade -y && \ +# yum clean && rm -rf /var/lib/apt/lists/* + +RUN yum -y update && yum install -y shadow-utils \ + git \ + python3-pip + +ENV HOME=/home/user + +RUN useradd -m -s /bin/bash user && \ + mkdir -p $HOME && \ + chown -R user $HOME + +WORKDIR $HOME + + +# Stage 2: latest GenAIComps sources +FROM base AS git + +#RUN apt-get update && apt-get install -y --no-install-recommends git +RUN yum -y update && \ + yum install -y git +RUN git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.2 + + +# Stage 3: common layer shared by services using GenAIComps +FROM base AS comps-base + +# copy just relevant parts +COPY --from=git $HOME/GenAIComps/comps $HOME/GenAIComps/comps +COPY --from=git $HOME/GenAIComps/*.* $HOME/GenAIComps/LICENSE $HOME/GenAIComps/ + +WORKDIR $HOME/GenAIComps +RUN yum install -y python3 && \ + yum install -y python3-pip + + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r $HOME/GenAIComps/requirements.txt +WORKDIR $HOME + +ENV PYTHONPATH=$PYTHONPATH:$HOME/GenAIComps + +USER user + + +# Stage 4: unique part +FROM comps-base + +COPY ./chatqna.py $HOME/chatqna.py + +ENTRYPOINT ["python3", "chatqna.py"] diff --git a/AI/opea/dataprep-redis/1.2/24.03-lts/Dockerfile b/AI/opea/dataprep-redis/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c90d3abb5d0c6d477ae9632ce9dcdc9ee6927799 --- /dev/null +++ b/AI/opea/dataprep-redis/1.2/24.03-lts/Dockerfile @@ -0,0 +1,65 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +ENV LANG=C.UTF-8 + +ARG ARCH="cpu" + +RUN yum update -y && \ + yum install -y \ + wget \ + java-11-openjdk \ + mesa-libGL \ + shadow-utils \ + jemalloc jemalloc-devel \ + poppler-utils \ + python-pip python \ + tesseract \ + tesseract-langpack-eng \ + git + + +RUN mkdir -p /tmp/LibreOffice/LibreOffice && \ + wget -O /tmp/LibreOffice/LibreOffice.tar.gz https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/25.2.1/rpm/x86_64/LibreOffice_25.2.1_Linux_x86-64_rpm.tar.gz && \ + tar -zxvf /tmp/LibreOffice/LibreOffice.tar.gz -C /tmp/LibreOffice/LibreOffice/ --strip-components 1 && \ + yum -y install /tmp/LibreOffice/LibreOffice/RPMS/*.rpm && \ + mkdir -p /tmp/LibreOffice/langpack_zh-CN && \ + wget -O /tmp/LibreOffice/langpack_zh-CN.tar.gz https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/25.2.1/rpm/x86_64/LibreOffice_25.2.1_Linux_x86-64_rpm_langpack_zh-CN.tar.gz && \ + tar -zxvf /tmp/LibreOffice/langpack_zh-CN.tar.gz -C /tmp/LibreOffice/langpack_zh-CN/ --strip-components 1 && \ + yum -y install /tmp/LibreOffice/langpack_zh-CN/RPMS/*.rpm && \ + mkdir -p /tmp/LibreOffice/helppack_zh-CN && \ + wget -O /tmp/LibreOffice/helppack_zh-CN.tar.gz https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/25.2.1/rpm/x86_64/LibreOffice_25.2.1_Linux_x86-64_rpm_helppack_zh-CN.tar.gz && \ + tar -zxvf /tmp/LibreOffice/helppack_zh-CN.tar.gz -C /tmp/LibreOffice/helppack_zh-CN/ --strip-components 1 && \ + yum -y install /tmp/LibreOffice/helppack_zh-CN/RPMS/*.rpm && \ + rm -rf /tmp/LibreOffice + +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://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.0 + +RUN cp -r GenAIComps/comps . && \ + rm -rf GenAIComps + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + pip install --no-cache-dir -r /home/user/comps/dataprep/redis/langchain/requirements.txt + +ENV PYTHONPATH=/usr/bin/python:/home/user + +USER root + +RUN mkdir -p /home/user/comps/dataprep/redis/langchain/uploaded_files && chown -R user /home/user/comps/dataprep/redis/langchain/uploaded_files + +USER user + +WORKDIR /home/user/comps/dataprep/redis/langchain + +ENTRYPOINT ["python", "prepare_doc_redis.py"] \ No newline at end of file