diff --git a/AI/image-list.yml b/AI/image-list.yml index da4f69da255bf454d52d63ab6238d264ad9c478b..f7c927fed571f37aa5be3be71555004cfc478a8f 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 0000000000000000000000000000000000000000..60404b537bc083f64a8c732cf49f97f11dc66d61 --- /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 0000000000000000000000000000000000000000..ee4b49e9afa63ff59b2371473ff499d093b30722 --- /dev/null +++ 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 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 6e242186523357dd06ae7fdf15d2034ba88cab54..4cb79f8f6f0f9849fa98c20e952162ca18b89560 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 93b62809e106d30b93e6f340491e09fca3f181d5..62310be836c547aebc8e67fcf30d15f1a392283b 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 52bb2e0264e71ad5210c36ce504f8b77fbcb1993..b00e8613ef2921036a8d961f3a3adcdbf4ed017e 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