diff --git a/AI/image-list.yml b/AI/image-list.yml index da4f69da255bf454d52d63ab6238d264ad9c478b..9cb232499df7b319a0ac75499c1e412989b97f4d 100644 --- a/AI/image-list.yml +++ b/AI/image-list.yml @@ -38,6 +38,7 @@ images: llm-docsum: opea/llm-docsum docsum-gradio-ui: opea/docsum-gradio-ui reranking-tei: opea/reranking-tei + retriever: opea/retriever retriever-redis: opea/retriever-redis searchqna: opea/searchqna searchqna-ui: opea/searchqna-ui diff --git a/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/Dockerfile b/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/Dockerfile index 2ff9fa9f38f413f57c956988c2677262c7dbf7d2..30e942181e07de598ebb25ee0698e05ae9dc8efc 100644 --- a/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/Dockerfile +++ b/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/Dockerfile @@ -1,29 +1,37 @@ # 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 as vite-app - +FROM $BASE as vite-app + +ARG VERSION + RUN yum update -y && \ - yum install -y --setopt=install_weak_deps=False \ - git \ - npm + yum install -y \ + git && \ + yum clean all && \ + rm -rf /var/cache/yum -WORKDIR /home/user +WORKDIR /usr/app # Copy the front-end code repository -RUN git clone https://github.com/opea-project/GenAIExamples.git && cd GenAIExamples && git checkout v1.2 +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + cp -r GenAIExamples/ChatQnA/ui/react /usr/app/react && \ + rm -rf GenAIExamples -WORKDIR /home/user/GenAIExamples/ChatQnA/ui/react +WORKDIR /usr/app/react RUN ["npm", "install"] RUN ["npm", "run", "build"] -FROM openeuler/nginx:1.27.2-oe2403lts - -COPY --from=vite-app /home/user/GenAIExamples/ChatQnA/ui/react/dist /usr/local/nginx/html +FROM openeuler/nginx:1.29.0-oe2403lts -COPY env.sh /docker-entrypoint.d/env.sh +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 -COPY 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/1.2/24.03-lts/env.sh b/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/env.sh deleted file mode 100644 index b9660aabba1f153d1faca10b5119bde45d101b18..0000000000000000000000000000000000000000 --- a/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/env.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -for i in $(env | grep APP_) #// Make sure to use the prefix MY_APP_ if you have any other prefix in env.production file variable name replace it with MY_APP_ -do - key=$(echo $i | cut -d '=' -f 1) - value=$(echo $i | cut -d '=' -f 2-) - echo $key=$value - # sed All files - # find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' + - - # sed JS and CSS only - find /usr/local/nginx/html -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' + -done diff --git a/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/nginx.conf b/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/nginx.conf deleted file mode 100644 index fa220eb7cadef16485e4db964f53d59cf5d1afae..0000000000000000000000000000000000000000 --- a/AI/opea/chatqna-conversation-ui/1.2/24.03-lts/nginx.conf +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 80; - - gzip on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_types font/woff2 text/css application/javascript application/json application/font-woff application/font-tff image/gif image/png image/svg+xml application/octet-stream; - - location / { - root /usr/local/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html =404; - - location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4|woff2)$ { - expires 1d; - } - } -} \ No newline at end of file diff --git a/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile b/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile index e7cc132366720e43d913f44ae6f726e34b1df30c..c651fb6c3eafa0e40da72db2a8b55cbd0686dd32 100644 --- a/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile +++ b/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile @@ -1,29 +1,26 @@ # 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 +ARG BASE=openeuler/node:20.11.1-oe2403lts +ARG VERSION=v1.2 -# 安装依赖工具 -RUN yum update -y && \ - yum install -y curl git xz +# Use node 20.11.1 as the base image +FROM $BASE -# 下载并安装 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 +ARG VERSION # Update package manager and install Git -RUN yum update -y && yum install -y git +RUN yum update -y && \ + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum +WORKDIR /home/user # Copy the front-end code repository -RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git && \ - mkdir -p /home/user && \ - cp -r ./GenAIExamples/ChatQnA/ui/svelte /home/user/svelte - -#COPY svelte /home/user/svelte +ARG GENAIEXAMPLES_REPO=https://github.com/opea-project/GenAIExamples.git +RUN git clone -b $VERSION $GENAIEXAMPLES_REPO && \ + cp -r GenAIExamples/ChatQnA/ui/svelte /home/user/svelte && \ + rm -rf GenAIExamples # Set the working directory WORKDIR /home/user/svelte diff --git a/AI/opea/chatqna/1.2/24.03-lts/Dockerfile b/AI/opea/chatqna/1.2/24.03-lts/Dockerfile index 612c3ad4157afa1217ed6eb60c06c0960a04ae05..71dbbed6982650055209e012ebf935804b2e1f71 100644 --- a/AI/opea/chatqna/1.2/24.03-lts/Dockerfile +++ b/AI/opea/chatqna/1.2/24.03-lts/Dockerfile @@ -1,18 +1,17 @@ # 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 +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 -# 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/* +# Stage 1: base setup used by other stages +FROM $BASE AS base -RUN yum -y update && yum install -y shadow-utils \ - git \ - python3-pip +RUN yum update -y && \ + yum install -y \ + shadow && \ + yum clean all && \ + rm -rf /var/cache/yum ENV HOME=/home/user @@ -22,15 +21,22 @@ RUN useradd -m -s /bin/bash user && \ WORKDIR $HOME - # Stage 2: latest GenAIComps sources FROM base AS git +ARG VERSION + #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 +RUN yum update -y && \ + yum install -y git && \ + yum clean all && \ + rm -rf /var/cache/yum + +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 # Stage 3: common layer shared by services using GenAIComps FROM base AS comps-base @@ -38,11 +44,9 @@ 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/ChatQnA/chatqna.py $HOME/chatqna.py 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 @@ -51,12 +55,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps USER user - -# Stage 4: unique part -FROM comps-base - -RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git - -RUN cp GenAIExamples/ChatQnA/chatqna.py /home/user/chatqna.py - ENTRYPOINT ["python3", "chatqna.py"] \ No newline at end of file diff --git a/AI/opea/dataprep/1.2/24.03-lts/Dockerfile b/AI/opea/dataprep/1.2/24.03-lts/Dockerfile index d468bb0906ff99d8e5a01a4d535d1bc92efc6e64..241437da8c87262a0cd68a551eb2c933ad200aa3 100644 --- a/AI/opea/dataprep/1.2/24.03-lts/Dockerfile +++ b/AI/opea/dataprep/1.2/24.03-lts/Dockerfile @@ -1,50 +1,55 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM openeuler/openeuler:24.03-lts +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + +FROM $BASE + +ARG VERSION ENV LANG=C.UTF-8 ARG ARCH="cpu" -RUN yum update -y && \ - yum install -y \ - python3.11 \ - python3-devel \ - python3-pip \ - git \ - wget \ - gcc \ - gcc-c++ \ +RUN yum update -y && yum install -y \ + gcc g++ make cmake \ java-1.8.0-openjdk \ cairo \ + libxslt \ mesa-libGL \ jemalloc-devel \ - postgresql-devel \ + mariadb-connector-c-devel-3.3.8 \ + libpq-devel \ poppler-utils \ - tesseract \ - curl && \ - ln -s /usr/bin/python3.11 /usr/bin/python && \ - yum clean all - - -RUN LIBREOFFICE_URL=https://mirrors.bfsu.edu.cn/libreoffice/libreoffice/stable/24.8.6/rpm/x86_64/LibreOffice_24.8.6_Linux_x86-64_rpm.tar.gz && \ - wget $LIBREOFFICE_URL -O /tmp/LibreOffice_24.8.6_Linux_x86-64_rpm.tar.gz && \ - tar -xvf /tmp/LibreOffice_24.8.6_Linux_x86-64_rpm.tar.gz -C /tmp && \ - yum install -y /tmp/LibreOffice_24.8.6.2_Linux_x86-64_rpm/RPMS/*.rpm && \ - rm -fr /tmp/LibreOffice* + tesseract-tools \ + ffmpeg \ + wget curl \ + git \ + shadow && \ + 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/ -USER user WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.2 - -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 && \ diff --git a/AI/opea/embedding/1.2/24.03-lts/Dockerfile b/AI/opea/embedding/1.2/24.03-lts/Dockerfile index 8382b400b06dbc4794a2e325f10b8d591375aa20..c4930079abb86286822f3b26116a7585bcdfea20 100644 --- a/AI/opea/embedding/1.2/24.03-lts/Dockerfile +++ b/AI/opea/embedding/1.2/24.03-lts/Dockerfile @@ -1,18 +1,24 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM openeuler/openeuler:24.03-lts +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + +FROM $BASE + +ARG VERSION RUN yum update -y && \ yum install -y \ - python python-pip \ - git + git && \ + yum clean all && \ + rm -rf /var/cache/yum WORKDIR /home/user -RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git - -RUN cp -r GenAIComps/comps /home/user/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 && \ diff --git a/AI/opea/reranking/1.2/24.03-lts/Dockerfile b/AI/opea/reranking/1.2/24.03-lts/Dockerfile index 079320ab059c04a181a00373c191f00c6ce6b65a..a82062e0725a1e9a3fb0c702a452f54796cbaff7 100644 --- a/AI/opea/reranking/1.2/24.03-lts/Dockerfile +++ b/AI/opea/reranking/1.2/24.03-lts/Dockerfile @@ -1,19 +1,25 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM openeuler/openeuler:24.03-lts +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + +FROM ${BASE} ENV LANG=C.UTF-8 +ARG VERSION ARG ARCH="cpu" ARG SERVICE="all" RUN yum update -y && \ yum install -y \ - python python-pip \ + shadow \ git \ mesa-libGL \ - jemalloc-devel + jemalloc-devel && \ + yum clean all && \ + rm -rf /var/cache/yum RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -23,9 +29,9 @@ USER user WORKDIR /home/user -RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git - -RUN cp -r GenAIComps/comps /home/user/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 if [ ${ARCH} = "cpu" ]; then \ diff --git a/AI/opea/retriever-redis/1.2/24.03-lts/Dockerfile b/AI/opea/retriever-redis/1.2/24.03-lts/Dockerfile index 8e7aa74236d31df5a8d431aef03430be194baddc..fccff6c8da929d4d07f4a47d5b7269e148ed1d16 100644 --- a/AI/opea/retriever-redis/1.2/24.03-lts/Dockerfile +++ b/AI/opea/retriever-redis/1.2/24.03-lts/Dockerfile @@ -1,19 +1,27 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM openeuler/openeuler:24.03-lts +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + +FROM $BASE + +ARG VERSION ARG ARCH="cpu" RUN yum update -y && \ yum install -y \ + shadow \ mesa-libGL \ jemalloc-devel \ python python-pip \ cairo \ glib2 \ vim \ - git + git && \ + yum clean all && \ + rm -rf /var/cache/yum RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -21,9 +29,9 @@ RUN useradd -m -s /bin/bash user && \ WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.2 - -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 USER user @@ -37,12 +45,9 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \ pip install --no-cache-dir torch torchvision ${PIP_EXTRA_INDEX_URL} && \ pip install --no-cache-dir ${PIP_EXTRA_INDEX_URL} -r /home/user/comps/retrievers/src/requirements.txt && \ pip install opentelemetry-api==1.27.0 opentelemetry-exporter-otlp==1.27.0 opentelemetry-sdk==1.27.0 - -RUN pip install --no-cache-dir protobuf && \ - pip3 install --no-cache-dir pymilvus==2.5.0 ENV PYTHONPATH=/usr/bin/python:/home/user WORKDIR /home/user/comps/retrievers/src -ENTRYPOINT ["python", "opea_retrievers_microservice.py"] +ENTRYPOINT ["python", "opea_retrievers_microservice.py"] \ No newline at end of file diff --git a/AI/opea/retriever/1.2/24.03-lts/Dockerfile b/AI/opea/retriever/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f21476acdca27d43c01546165fb6d594f0fd82d1 --- /dev/null +++ b/AI/opea/retriever/1.2/24.03-lts/Dockerfile @@ -0,0 +1,53 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +ARG BASE=openeuler/python:3.11.13-oe2403lts +ARG VERSION=v1.2 + +FROM $BASE + +ARG VERSION + +ARG ARCH="cpu" + +RUN yum update -y && \ + yum install -y \ + shadow \ + mesa-libGL \ + jemalloc-devel \ + python python-pip \ + cairo \ + glib2 \ + vim \ + 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/ + +WORKDIR /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 + +USER user + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + if [ ${ARCH} = "cpu" ]; then \ + PIP_EXTRA_INDEX_URL="--extra-index-url https://download.pytorch.org/whl/cpu"; \ + else \ + PIP_EXTRA_INDEX_URL=""; \ + fi && \ + pip install --no-cache-dir torch torchvision ${PIP_EXTRA_INDEX_URL} && \ + pip install --no-cache-dir ${PIP_EXTRA_INDEX_URL} -r /home/user/comps/retrievers/src/requirements.txt && \ + pip install opentelemetry-api==1.27.0 opentelemetry-exporter-otlp==1.27.0 opentelemetry-sdk==1.27.0 + +ENV PYTHONPATH=/usr/bin/python:/home/user + +WORKDIR /home/user/comps/retrievers/src + +ENTRYPOINT ["python", "opea_retrievers_microservice.py"] diff --git a/AI/opea/retriever/meta.yml b/AI/opea/retriever/meta.yml new file mode 100644 index 0000000000000000000000000000000000000000..2d855cefca21cfe09a49183738c014e3571c06a7 --- /dev/null +++ b/AI/opea/retriever/meta.yml @@ -0,0 +1,3 @@ +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64