From 39ce8eda4b598ef49689d77ce6cd4f932bf0f5a2 Mon Sep 17 00:00:00 2001 From: gtysssp <3132548401@qq.com> Date: Thu, 8 May 2025 21:06:12 +0800 Subject: [PATCH] commit with CLA problem solved --- AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile | 22 ++++++--- AI/opea/chatqna/1.2/24.03-lts/Dockerfile | 31 ++++++++----- .../dataprep-redis/1.2/24.03-lts/Dockerfile | 46 +++++++------------ 3 files changed, 52 insertions(+), 47 deletions(-) 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 9d6ad23..8cfdefb 100644 --- a/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile +++ b/AI/opea/chatqna-ui/1.2/24.03-lts/Dockerfile @@ -4,16 +4,26 @@ # Use node 20.11.1 as the base image FROM openeuler/openeuler:24.03-lts -# Update package manager and install Git -RUN yum update -y && yum install -y git npm +# 安装依赖工具 +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 -WORKDIR /home/user +# 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/GenAIExamples.git && cd GenAIExamples && git checkout v1.2 +RUN git clone https://github.com/opea-project/GenAIComps.git && \ + git checkout v1.2 && \ + cp ./GenAIExamples/ChatQnA/ui/svelte /home/user/svelte -RUN cp -r GenAIExamples/ChatQnA/ui/svelte /home/user/svelte && \ - rm -rf GenAIExamples +#COPY svelte /home/user/svelte # 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 31817d8..4381ac2 100644 --- a/AI/opea/chatqna/1.2/24.03-lts/Dockerfile +++ b/AI/opea/chatqna/1.2/24.03-lts/Dockerfile @@ -4,12 +4,17 @@ # Stage 1: base setup used by other stages FROM openeuler/openeuler:24.03-lts AS base -ENV HOME=/home/user +# 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 -RUN yum update -y && yum install -y \ - python python-pip \ - shadow-utils \ - git +ENV HOME=/home/user RUN useradd -m -s /bin/bash user && \ mkdir -p $HOME && \ @@ -21,7 +26,10 @@ WORKDIR $HOME # Stage 2: latest GenAIComps sources FROM base AS git -RUN git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.2 +#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 @@ -32,6 +40,10 @@ 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 @@ -44,9 +56,6 @@ USER user # Stage 4: unique part FROM comps-base -RUN git clone https://github.com/opea-project/GenAIExamples.git && cd GenAIExamples && git checkout v1.2 - -RUN cp -r GenAIExamples/ChatQnA/chatqna.py $HOME/chatqna.py && \ - rm -rf GenAIExamples +COPY ./chatqna.py $HOME/chatqna.py -ENTRYPOINT ["python", "chatqna.py"] \ No newline at end of file +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 index 4d05542..c90d3ab 100644 --- a/AI/opea/dataprep-redis/1.2/24.03-lts/Dockerfile +++ b/AI/opea/dataprep-redis/1.2/24.03-lts/Dockerfile @@ -7,21 +7,20 @@ ENV LANG=C.UTF-8 ARG ARCH="cpu" -RUN yum update -y && yum install -y \ - make gcc gcc-c++ \ +RUN yum update -y && \ + yum install -y \ + wget \ java-11-openjdk \ mesa-libGL \ - jemalloc-devel \ + shadow-utils \ + jemalloc jemalloc-devel \ poppler-utils \ - python3-devel python-pip \ + python-pip python \ tesseract \ tesseract-langpack-eng \ - libpq-devel \ - cairo \ - wget \ - git \ - xz - + 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 && \ @@ -36,13 +35,6 @@ RUN mkdir -p /tmp/LibreOffice/LibreOffice && \ yum -y install /tmp/LibreOffice/helppack_zh-CN/RPMS/*.rpm && \ rm -rf /tmp/LibreOffice -# Install ffmpeg static build -RUN cd /root && wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz && \ -mkdir ffmpeg-git-amd64-static && tar -xvf ffmpeg-git-amd64-static.tar.xz -C ffmpeg-git-amd64-static --strip-components 1 && \ -export PATH=/root/ffmpeg-git-amd64-static:$PATH && \ -cp /root/ffmpeg-git-amd64-static/ffmpeg /usr/local/bin/ - - RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ chown -R user /home/user/ @@ -51,29 +43,23 @@ USER user WORKDIR /home/user/ -RUN git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout v1.2 +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_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/dataprep/src/requirements.txt && \ - pip install opentelemetry-api==1.29.0 opentelemetry-exporter-otlp==1.29.0 opentelemetry-sdk==1.29.0 + 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=$PYTHONPATH:/home/user +ENV PYTHONPATH=/usr/bin/python:/home/user USER root -RUN mkdir -p /home/user/comps/dataprep/src/uploaded_files && chown -R user /home/user/comps/dataprep/src/uploaded_files +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/src +WORKDIR /home/user/comps/dataprep/redis/langchain -ENTRYPOINT ["sh", "-c", "python $( [ \"$MULTIMODAL_DATAPREP\" = \"true\" ] && echo 'opea_dataprep_multimodal_microservice.py' || echo 'opea_dataprep_microservice.py')"] \ No newline at end of file +ENTRYPOINT ["python", "prepare_doc_redis.py"] \ No newline at end of file -- Gitee