From 15c6d38081ddf3a9643404d75d8bcb4684361b29 Mon Sep 17 00:00:00 2001 From: zhihang Date: Sat, 26 Jul 2025 08:29:53 +0000 Subject: [PATCH 1/3] update FaqGen Signed-off-by: zhihang --- AI/image-list.yml | 1 + .../faqgen-react-ui/1.2/24.03-lts/Dockerfile | 36 +++++++++++ AI/opea/faqgen-react-ui/meta.yml | 0 AI/opea/faqgen-ui/1.2/24.03-lts/Dockerfile | 23 +++++--- AI/opea/faqgen/1.2/24.03-lts/Dockerfile | 59 +++++++++++++------ AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile | 31 +++++----- 6 files changed, 108 insertions(+), 42 deletions(-) create mode 100644 AI/opea/faqgen-react-ui/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/faqgen-react-ui/meta.yml diff --git a/AI/image-list.yml b/AI/image-list.yml index da4f69da..f7c927fe 100644 --- a/AI/image-list.yml +++ b/AI/image-list.yml @@ -29,6 +29,7 @@ images: embedding: opea/embedding faqgen-ui: opea/faqgen-ui faqgen: opea/faqgen + faqgen-react-ui: opea/faqgen-react-ui llm-faqgen: opea/llm-faqgen llm-docsum-tgi: opea/llm-docsum-tgi llm-faqgen-tgi: opea/llm-faqgen-tgi diff --git a/AI/opea/faqgen-react-ui/1.2/24.03-lts/Dockerfile b/AI/opea/faqgen-react-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 00000000..60404b53 --- /dev/null +++ b/AI/opea/faqgen-react-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,36 @@ + +ARG BASE=openeuler/node:20.11.1-oe2403lts +ARG VERSION=v1.2 + +FROM $BASE as vite-app + +ARG VERSION + +RUN yum update -y && \ + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum + +WORKDIR /usr/app + +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + cp -r GenAIExamples/FaqGen/ui/react /usr/app/react && \ + rm -rf GenAIExamples + +WORKDIR /usr/app/react + +ARG BACKEND_SERVICE_ENDPOINT +ENV VITE_FAQ_GEN_URL=$BACKEND_SERVICE_ENDPOINT + +RUN ["npm", "install"] +RUN ["npm", "run", "build"] + + +FROM openeuler/nginx:1.27.2-oe2403lts +EXPOSE 80 + +COPY --from=vite-app /usr/app/react/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html + +ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/AI/opea/faqgen-react-ui/meta.yml b/AI/opea/faqgen-react-ui/meta.yml new file mode 100644 index 00000000..e69de29b diff --git a/AI/opea/faqgen-ui/1.2/24.03-lts/Dockerfile b/AI/opea/faqgen-ui/1.2/24.03-lts/Dockerfile index 6e242186..4cb79f8f 100644 --- a/AI/opea/faqgen-ui/1.2/24.03-lts/Dockerfile +++ b/AI/opea/faqgen-ui/1.2/24.03-lts/Dockerfile @@ -1,22 +1,29 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +ARG BASE=openeuler/node:20.11.1-oe2403lts +ARG VERSION=v1.2 + # Use node 20.11.1 as the base image -FROM openeuler/openeuler:24.03-lts +FROM $BASE + +ARG VERSION # Update package manager and install Git RUN yum update -y && \ - yum install -y \ - git \ - npm + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum -WORKDIR /home/user/ +WORKDIR /home/user -# Copy the front-end code repository -RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + cp -r GenAIExamples/FaqGen/ui/svelte /home/user/svelte && \ + rm -rf GenAIExamples # Set the working directory -WORKDIR /home/user/GenAIExamples/FaqGen/ui/svelte +WORKDIR /home/user/svelte # Install front-end dependencies RUN npm install diff --git a/AI/opea/faqgen/1.2/24.03-lts/Dockerfile b/AI/opea/faqgen/1.2/24.03-lts/Dockerfile index 93b62809..62310be8 100644 --- a/AI/opea/faqgen/1.2/24.03-lts/Dockerfile +++ b/AI/opea/faqgen/1.2/24.03-lts/Dockerfile @@ -1,36 +1,61 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + # Stage 1: base setup used by other stages -FROM openeuler/openeuler:24.03-lts +FROM $BASE AS base + +ARG VERSION # get security updates RUN yum update -y && \ yum install -y \ - git \ - python python-pip + shadow && \ + yum clean all && \ + rm -rf /var/lib/yum + +ENV HOME=/home/user RUN useradd -m -s /bin/bash user && \ - mkdir -p /home/user && \ - chown -R user /home/user + mkdir -p $HOME && \ + chown -R user $HOME -WORKDIR /home/user +WORKDIR $HOME -RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git -WORKDIR /home/user/GenAIComps -RUN pip install --no-cache-dir --upgrade pip setuptools && \ - pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt +# Stage 2: latest GenAIComps sources +FROM base AS git -WORKDIR /home/user -RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git -RUN cp GenAIExamples/FaqGen/faqgen.py . -RUN rm -rf GenAIExamples +ARG VERSION -ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps +RUN yum update -y && \ + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum -USER user +ARG GENAICOMPS_REPO=https://github.com/opea-project/GenAIComps.git +RUN git clone -b $VERSION $GENAICOMPS_REPO + +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO -WORKDIR /home/user +# 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/ +COPY --from=git $HOME/GenAIExamples/FaqGen/faqgen.py $HOME/faqgen.py + +WORKDIR $HOME/GenAIComps +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 ENTRYPOINT ["python", "faqgen.py"] \ No newline at end of file diff --git a/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile b/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile index 52bb2e02..6ce5bf10 100644 --- a/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile +++ b/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile @@ -1,18 +1,21 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# Use a base image -FROM openeuler/openeuler:24.03-lts +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 -# Set this to "cpu" or "gpu" or etc -ARG ARCH="cpu" +FROM $BASE + +ARG VERSION RUN yum update -y && \ yum install -y \ mesa-libGL \ jemalloc-devel \ - python python-pip \ - git + git + shadow && \ + yum clean all && \ + rm -rf /var/cache/yum RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -20,24 +23,18 @@ RUN useradd -m -s /bin/bash user && \ USER user -WORKDIR /home/user/ - -RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git +WORKDIR /home/user -RUN cp -r GenAIComps/comps . && \ +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 RUN pip install --no-cache-dir --upgrade pip setuptools && \ - if [ ${ARCH} = "cpu" ]; then \ - pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/llms/src/faq-generation/requirements.txt; \ - else \ - pip install --no-cache-dir -r /home/user/comps/llms/src/faq-generation/requirements.txt; \ - fi + pip install --no-cache-dir -r /home/user/comps/llms/src/faq-generation/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home/user -USER user - WORKDIR /home/user/comps/llms/src/faq-generation ENTRYPOINT ["bash", "entrypoint.sh"] \ No newline at end of file -- Gitee From db726003b7026197fa1b0f459dbec88c887f5ec2 Mon Sep 17 00:00:00 2001 From: zhihang Date: Sat, 26 Jul 2025 08:54:45 +0000 Subject: [PATCH 2/3] fix bug Signed-off-by: zhihang --- AI/opea/faqgen-react-ui/meta.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AI/opea/faqgen-react-ui/meta.yml b/AI/opea/faqgen-react-ui/meta.yml index e69de29b..ee4b49e9 100644 --- a/AI/opea/faqgen-react-ui/meta.yml +++ b/AI/opea/faqgen-react-ui/meta.yml @@ -0,0 +1,3 @@ +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file -- Gitee From c5a69bfb298c785fa012b019af59ae6001e97b07 Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 28 Jul 2025 02:02:17 +0000 Subject: [PATCH 3/3] fix bug Signed-off-by: zhihang --- AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile b/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile index 6ce5bf10..b00e8613 100644 --- a/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile +++ b/AI/opea/llm-faqgen/1.2/24.03-lts/Dockerfile @@ -12,7 +12,7 @@ RUN yum update -y && \ yum install -y \ mesa-libGL \ jemalloc-devel \ - git + git \ shadow && \ yum clean all && \ rm -rf /var/cache/yum -- Gitee