From 9b0cedd50f42718d3f0c3466b663f492426c38c2 Mon Sep 17 00:00:00 2001 From: zhihang Date: Thu, 21 Aug 2025 09:43:06 +0000 Subject: [PATCH 1/2] update chatqna to 1.3 Signed-off-by: zhihang --- .../1.3/24.03-lts/Dockerfile | 33 ++++++++ AI/opea/chatqna-conversation-ui/meta.yml | 8 ++ AI/opea/chatqna-ui/1.3/24.03-lts/Dockerfile | 32 ++++++++ AI/opea/chatqna-ui/meta.yml | 4 + AI/opea/chatqna/1.3/24.03-lts/Dockerfile | 13 ++++ AI/opea/dataprep/1.3/24.03-lts/Dockerfile | 75 +++++++++++++++++++ AI/opea/dataprep/meta.yml | 4 + AI/opea/retriever/1.3/24.03-lts/Dockerfile | 50 +++++++++++++ AI/opea/retriever/meta.yml | 4 + 9 files changed, 223 insertions(+) create mode 100644 AI/opea/chatqna-conversation-ui/1.3/24.03-lts/Dockerfile create mode 100644 AI/opea/chatqna-ui/1.3/24.03-lts/Dockerfile create mode 100644 AI/opea/chatqna/1.3/24.03-lts/Dockerfile create mode 100644 AI/opea/dataprep/1.3/24.03-lts/Dockerfile create mode 100644 AI/opea/retriever/1.3/24.03-lts/Dockerfile diff --git a/AI/opea/chatqna-conversation-ui/1.3/24.03-lts/Dockerfile b/AI/opea/chatqna-conversation-ui/1.3/24.03-lts/Dockerfile new file mode 100644 index 00000000..cf73dfa2 --- /dev/null +++ b/AI/opea/chatqna-conversation-ui/1.3/24.03-lts/Dockerfile @@ -0,0 +1,33 @@ +ARG BASE=openeuler/node:20.11.1-oe2403lts +ARG VERSION=v1.3 + +# Use node 20.11.1 as the base image +FROM $BASE as vite-app + +ARG VERSION + +RUN yum update -y && \ + yum install -y \ + git && \ + yum clean all + +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + mkdir -p /usr/app && \ + cp -r GenAIExamples/ChatQnA/ui/react /usr/app/react && \ + rm -rf GenAIExamples + +WORKDIR /usr/app/react + + +RUN ["npm", "install"] +RUN ["npm", "run", "build"] + + +FROM openeuler/nginx:1.29.0-oe2403lts + +COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html +COPY --from=vite-app /usr/app/react/env.sh /docker-entrypoint.d/env.sh + +COPY --from=vite-app /usr/app/react/nginx.conf /etc/nginx/conf.d/default.conf +RUN chmod +x /docker-entrypoint.d/env.sh \ No newline at end of file diff --git a/AI/opea/chatqna-conversation-ui/meta.yml b/AI/opea/chatqna-conversation-ui/meta.yml index 55f9e33c..ec645045 100644 --- a/AI/opea/chatqna-conversation-ui/meta.yml +++ b/AI/opea/chatqna-conversation-ui/meta.yml @@ -1,3 +1,11 @@ 1.0-oe2403lts: path: 1.0/24.03-lts/Dockerfile arch: x86_64 + +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 + +1.3-oe2403lts: + path: 1.3/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file diff --git a/AI/opea/chatqna-ui/1.3/24.03-lts/Dockerfile b/AI/opea/chatqna-ui/1.3/24.03-lts/Dockerfile new file mode 100644 index 00000000..0bbb6f18 --- /dev/null +++ b/AI/opea/chatqna-ui/1.3/24.03-lts/Dockerfile @@ -0,0 +1,32 @@ +ARG VERSION=v1.3 +ARG BASE=openeuler/node:20.11.1-oe2403lts +# Use node 20.11.1 as the base image +FROM $BASE +ARG VERSION +# Update package manager and install Git +RUN yum update -y && \ + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum + +# Copy the front-end code repository +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + mkdir -p /home/user && \ + cp -r GenAIExamples/ChatQnA/ui/svelte /home/user/svelte && \ + rm -rf GenAIExamples + +# 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-ui/meta.yml b/AI/opea/chatqna-ui/meta.yml index 0e6dfdc0..ec645045 100644 --- a/AI/opea/chatqna-ui/meta.yml +++ b/AI/opea/chatqna-ui/meta.yml @@ -4,4 +4,8 @@ 1.2-oe2403lts: path: 1.2/24.03-lts/Dockerfile + arch: x86_64 + +1.3-oe2403lts: + path: 1.3/24.03-lts/Dockerfile arch: x86_64 \ No newline at end of file diff --git a/AI/opea/chatqna/1.3/24.03-lts/Dockerfile b/AI/opea/chatqna/1.3/24.03-lts/Dockerfile new file mode 100644 index 00000000..1e73a669 --- /dev/null +++ b/AI/opea/chatqna/1.3/24.03-lts/Dockerfile @@ -0,0 +1,13 @@ +ARG IMAGE_REPO=openeuler +ARG BASE_TAG=1.3 +FROM $IMAGE_REPO/comps-base:$BASE_TAG-oe2403lts + +ARG BASE_TAG + +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b v$BASE_TAG $GENAIEXAMPLES_REPO && \ + cp -r GenAIExamples/ChatQnA/chatqna.py $HOME/chatqna.py && \ + cp -r GenAIExamples/ChatQnA/entrypoint.sh $HOME/entrypoint.sh && \ + rm -rf GenAIExamples + +ENTRYPOINT ["bash", "entrypoint.sh"] \ No newline at end of file diff --git a/AI/opea/dataprep/1.3/24.03-lts/Dockerfile b/AI/opea/dataprep/1.3/24.03-lts/Dockerfile new file mode 100644 index 00000000..18f21097 --- /dev/null +++ b/AI/opea/dataprep/1.3/24.03-lts/Dockerfile @@ -0,0 +1,75 @@ +# Copyright (C) 2025 Huawei Technologies Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.3 + +FROM $BASE + +ARG VERSION + +ENV LANG=C.UTF-8 + +ARG ARCH="cpu" + +RUN yum update -y && yum install -y \ + gcc g++ make cmake \ + java-1.8.0-openjdk \ + cairo \ + libxslt \ + mesa-libGL \ + jemalloc-devel \ + mariadb-connector-c-devel-3.3.8 \ + libpq-devel \ + poppler-utils \ + tesseract-tools \ + ffmpeg \ + wget curl \ + shadow \ + git && \ + yum clean all && \ + rm -rf /var/cache/yum + +ENV TESSDATA_PREFIX=/usr/share/tesseract/tessdata + +RUN LIBREOFFICE_URL=https://mirrors.tuna.tsinghua.edu.cn/libreoffice/libreoffice/stable/25.2.4/rpm/x86_64/LibreOffice_25.2.4_Linux_x86-64_rpm.tar.gz && \ + wget $LIBREOFFICE_URL -O /tmp/libreOffice.tar.gz && \ + tar --strip-components=1 -xvf /tmp/libreOffice.tar.gz -C /tmp && \ + yum install -y /tmp/RPMS/*.rpm && \ + yum clean all && \ + rm -fr /tmp/libreOffice.tar.gz /tmp/RPMS && \ + ln -sf /usr/bin/libreoffice25.2 /usr/bin/libreoffice + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +ARG GENAICOMPS_REPO=https://github.com/opea-project/GenAIComps.git +RUN git clone -b $VERSION $GENAICOMPS_REPO && \ + cp -r GenAIComps/comps /home/user/comps && \ + rm -rf GenAIComps + +ARG uvpip='uv pip install --system --no-cache-dir' +RUN pip install --no-cache-dir --upgrade pip setuptools uv && \ + if [ ${ARCH} = "cpu" ]; then \ + PIP_EXTRA_INDEX_URL="--extra-index-url https://download.pytorch.org/whl/cpu"; \ + else \ + PIP_EXTRA_INDEX_URL=""; \ + fi && \ + $uvpip torch torchvision ${PIP_EXTRA_INDEX_URL} && \ + $uvpip -r /home/user/comps/dataprep/src/requirements.txt + +ENV PYTHONPATH=$PYTHONPATH:/home/user + +RUN mkdir -p /home/user/comps/dataprep/src/uploaded_files && chown -R user /home/user/comps/dataprep/src/uploaded_files +RUN mkdir -p /data && chown -R user /data + +USER user +ENV NLTK_DATA=/home/user/nltk_data +# air gapped support: predownload all needed nltk data +RUN mkdir -p /home/user/nltk_data && python -m nltk.downloader -d /home/user/nltk_data punkt_tab averaged_perceptron_tagger_eng stopwords +# air gapped support: set model cache dir +ENV HF_HUB_CACHE=/data + +WORKDIR /home/user/comps/dataprep/src + +ENTRYPOINT ["sh", "-c", "python $( [ \"$MULTIMODAL_DATAPREP\" = \"true\" ] && echo 'opea_dataprep_multimodal_microservice.py' || echo 'opea_dataprep_microservice.py')"] \ No newline at end of file diff --git a/AI/opea/dataprep/meta.yml b/AI/opea/dataprep/meta.yml index 2d855cef..2ab4c3be 100644 --- a/AI/opea/dataprep/meta.yml +++ b/AI/opea/dataprep/meta.yml @@ -1,3 +1,7 @@ 1.2-oe2403lts: path: 1.2/24.03-lts/Dockerfile arch: x86_64 + +1.3-oe2403lts: + path: 1.3/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file diff --git a/AI/opea/retriever/1.3/24.03-lts/Dockerfile b/AI/opea/retriever/1.3/24.03-lts/Dockerfile new file mode 100644 index 00000000..518f8f6d --- /dev/null +++ b/AI/opea/retriever/1.3/24.03-lts/Dockerfile @@ -0,0 +1,50 @@ +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.3 + +FROM $BASE + +ARG VERSION + +ARG ARCH="cpu" + +RUN yum update -y && yum install -y \ + cairo \ + mesa-libGL \ + glib2 \ + jemalloc-devel \ + mariadb-connector-c-devel-3.3.8 \ + gcc g++ make cmake \ + shadow \ + git && \ + yum clean all && \ + rm -rf /var/cache/yum + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +ARG GENAICOMPS_REPO=https://github.com/opea-project/GenAIComps.git +RUN git clone -b $VERSION $GENAICOMPS_REPO && \ + cp -r GenAIComps/comps /home/user/comps && \ + rm -rf GenAIComps + +ARG uvpip='uv pip install --system --no-cache-dir' +RUN pip install --no-cache-dir --upgrade pip setuptools uv && \ + if [ ${ARCH} = "cpu" ]; then \ + PIP_EXTRA_INDEX_URL="--extra-index-url https://download.pytorch.org/whl/cpu"; \ + else \ + PIP_EXTRA_INDEX_URL=""; \ + fi && \ + $uvpip torch torchvision ${PIP_EXTRA_INDEX_URL} && \ + $uvpip -r /home/user/comps/retrievers/src/requirements.txt + +ENV PYTHONPATH=$PYTHONPATH:/home/user + +USER user +ENV NLTK_DATA=/home/user/nltk_data +# air gapped support: predownload all needed nltk data +RUN mkdir -p /home/user/nltk_data && python -m nltk.downloader -d /home/user/nltk_data punkt_tab stopwords + +WORKDIR /home/user/comps/retrievers/src + +ENTRYPOINT ["python", "opea_retrievers_microservice.py"] \ No newline at end of file diff --git a/AI/opea/retriever/meta.yml b/AI/opea/retriever/meta.yml index 2d855cef..2ab4c3be 100644 --- a/AI/opea/retriever/meta.yml +++ b/AI/opea/retriever/meta.yml @@ -1,3 +1,7 @@ 1.2-oe2403lts: path: 1.2/24.03-lts/Dockerfile arch: x86_64 + +1.3-oe2403lts: + path: 1.3/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file -- Gitee From ee698e42558e9e3ad5f72141b2a6ec8d3eaf962f Mon Sep 17 00:00:00 2001 From: zhihang Date: Fri, 22 Aug 2025 09:16:52 +0000 Subject: [PATCH 2/2] fix bug Signed-off-by: zhihang --- AI/opea/chatqna/meta.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AI/opea/chatqna/meta.yml b/AI/opea/chatqna/meta.yml index 0343efe1..05b30cd3 100644 --- a/AI/opea/chatqna/meta.yml +++ b/AI/opea/chatqna/meta.yml @@ -5,3 +5,7 @@ 1.2-oe2403lts: path: 1.2/24.03-lts/Dockerfile arch: x86_64 + +1.3-oe2403lts: + path: 1.3/24.03-lts/Dockerfile + arch: x86_64 -- Gitee