Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/dataprep-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ services:
build:
dockerfile: comps/dataprep/src/Dockerfile
image: ${REGISTRY:-opea}/dataprep:${TAG:-latest}
dataprep-openeuler:
build:
dockerfile: comps/dataprep/src/Dockerfile.openEuler
image: ${REGISTRY:-opea}/dataprep:${TAG:-latest}-openeuler
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/embeddings-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ services:
build:
dockerfile: comps/embeddings/src/Dockerfile
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
embedding-openeuler:
build:
dockerfile: comps/embeddings/src/Dockerfile.openEuler
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}-openeuler
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/guardrails-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ services:
build:
dockerfile: comps/guardrails/src/guardrails/Dockerfile
image: ${REGISTRY:-opea}/guardrails:${TAG:-latest}
guardrails-openeuler:
build:
dockerfile: comps/guardrails/src/guardrails/Dockerfile.openEuler
image: ${REGISTRY:-opea}/guardrails:${TAG:-latest}-openeuler
guardrails-bias-detection:
build:
dockerfile: comps/guardrails/src/bias_detection/Dockerfile
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/rerankings-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ services:
build:
dockerfile: comps/rerankings/src/Dockerfile
image: ${REGISTRY:-opea}/reranking:${TAG:-latest}
reranking-openeuler:
build:
dockerfile: comps/rerankings/src/Dockerfile.openEuler
image: ${REGISTRY:-opea}/reranking:${TAG:-latest}-openeuler
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/retrievers-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ services:
build:
dockerfile: comps/retrievers/src/Dockerfile
image: ${REGISTRY:-opea}/retriever:${TAG:-latest}
retriever-openeuler:
build:
dockerfile: comps/retrievers/src/Dockerfile.openEuler
image: ${REGISTRY:-opea}/retriever:${TAG:-latest}-openeuler
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/third_parties-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ services:
build:
dockerfile: comps/third_parties/nginx/src/Dockerfile
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
nginx-openeuler:
build:
dockerfile: comps/third_parties/nginx/src/Dockerfile.openEuler
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}-openeuler
embedding-multimodal-clip:
build:
dockerfile: comps/third_parties/clip/src/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-dockerfile-path-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
consistency="TRUE"
yamls=$(find .github/workflows/docker/compose/ -name '*-compose.yaml')
for build_yaml in $yamls; do
message=$(python3 .github/workflows/scripts/check-name-agreement.py "$build_yaml")
message=$(python3 .github/workflows/scripts/check_name_agreement.py "$build_yaml")
if [[ "$message" != *"consistent"* ]]; then
consistency="FALSE"
echo "Inconsistent service name and image name found in file $build_yaml."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-microservice-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: MicroService-test

on:
pull_request_target:
pull_request:
branches: ["main", "*rc", "pre-ci", "**uv"]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ def check_service_image_consistency(data):
image_name = service_details.get("image", "")
# Extract the image name part after the last '/'
image_name_part = image_name.split("/")[-1].split(":")[0]
# Remove '-openeuler' suffix if it exists
fixed_service_name = service_name.rsplit("-openeuler", 1)[0]
# Check if the service name is a substring of the image name part
if service_name not in image_name_part:
if fixed_service_name not in image_name_part:
# Get the line number of the service name
line_number = service_details.lc.line + 1
inconsistencies.append((service_name, image_name, line_number))
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scripts/codeScan/.hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

ignored:
- DL3033
- DL3003
- DL3006
- DL3007
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/scripts/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,23 @@ function find_test_1() {
done
fi
if [ "$run_all_interation" = "true" ]; then
set -x
find_test=$(find ./tests -type f -name "test_${service_name}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
# limit test case. If the changed file only to be Dockerfile.openEuler, then only run the script integrate related test.
check_files_except_openeuler_docker=$(printf '%s\n' "${changed_files[@]}"| grep ${service_path} | grep -vE 'Dockerfile.openEuler' | sort -u) || true
if [ -z "$check_files_except_openeuler_docker" ]; then
for test in ${find_test}; do
find_dockerfile=$(grep -rl "openEuler" $test) || true
if [ "$find_dockerfile" ]; then
fill_in_matrix "$test"
fi
done
else
fill_in_matrix "$find_test"
fi
fi
set +x
fi
elif [[ $(echo ${service_path} | grep "third_parties") ]]; then
# new org with `src` and `third_parties` folder
Expand Down
38 changes: 38 additions & 0 deletions Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

# Base image for GenAIComps based OPEA Python applications
# Build: docker build -t opea/comps-base:{version}-openeuler -f Dockerfile.openEuler .

ARG IMAGE_NAME=openeuler/python
ARG IMAGE_TAG=3.11.13-oe2403lts

FROM ${IMAGE_NAME}:${IMAGE_TAG} AS base

ENV HOME=/home/user

RUN yum update -y && \
yum upgrade -y && \
yum install -y shadow && \
yum clean all && \
rm -rf /var/cache/yum

RUN useradd -m -s /bin/bash user && \
mkdir -p $HOME && \
chown -R user $HOME

WORKDIR $HOME

COPY *.toml *.py *.txt *.md LICENSE ./

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
$uvpip -r requirements.txt

COPY comps/ comps/

ENV PYTHONPATH=$PYTHONPATH:$HOME

USER user

ENTRYPOINT ["sh", "-c", "set && ls -la"]
66 changes: 66 additions & 0 deletions comps/dataprep/src/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

FROM openeuler/python:3.11.13-oe2403lts

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 && \
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/

COPY comps /home/user/comps

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
if [ ${ARCH} = "cpu" ]; then \
$uvpip torch torchvision --index-url https://download.pytorch.org/whl/cpu; \
$uvpip -r /home/user/comps/dataprep/src/requirements-cpu.txt; \
else \
$uvpip -r /home/user/comps/dataprep/src/requirements-gpu.txt; \
fi

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')"]
19 changes: 19 additions & 0 deletions comps/embeddings/src/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

FROM openeuler/python:3.11.13-oe2403lts

COPY comps /home/comps

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
$uvpip -r /home/comps/embeddings/src/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home

WORKDIR /home/comps/embeddings/src/

ENV MULTIMODAL_EMBEDDING="false"

ENTRYPOINT ["sh", "-c", "python $( [ \"$MULTIMODAL_EMBEDDING\" = \"true\" ] && echo 'opea_multimodal_embedding_microservice.py' || echo 'opea_embedding_microservice.py')"]

38 changes: 38 additions & 0 deletions comps/guardrails/src/guardrails/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

FROM openeuler/python:3.11.13-oe2403lts

ENV LANG=C.UTF-8

ARG ARCH="cpu"

RUN yum update -y && yum install -y \
mesa-libGL \
jemalloc-devel \
shadow && \
yum clean all && \
rm -rf /var/cache/yum

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

COPY comps /home/user/comps

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
if [ ${ARCH} = "cpu" ]; then \
$uvpip torch --index-url https://download.pytorch.org/whl/cpu; \
$uvpip -r /home/user/comps/guardrails/src/guardrails/requirements-cpu.txt; \
else \
$uvpip -r /home/user/comps/guardrails/src/guardrails/requirements-gpu.txt; \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user

WORKDIR /home/user/comps/guardrails/src/guardrails/

ENTRYPOINT ["python", "opea_guardrails_microservice.py"]
40 changes: 40 additions & 0 deletions comps/rerankings/src/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

FROM openeuler/python:3.11.13-oe2403lts

ENV LANG=C.UTF-8

ARG ARCH="cpu"

RUN yum update -y && yum install -y \
git \
mesa-libGL \
jemalloc-devel \
shadow && \
yum clean all && \
rm -rf /var/cache/yum

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

COPY comps/rerankings/src/requirements* /home/user/comps/rerankings/src/

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
if [ ${ARCH} = "cpu" ]; then \
$uvpip torch --index-url https://download.pytorch.org/whl/cpu; \
$uvpip -r /home/user/comps/rerankings/src/requirements-cpu.txt; \
else \
$uvpip -r /home/user/comps/rerankings/src/requirements-gpu.txt; \
fi

COPY comps /home/user/comps
ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user

WORKDIR /home/user/comps/rerankings/src

ENTRYPOINT ["python", "opea_reranking_microservice.py"]
43 changes: 43 additions & 0 deletions comps/retrievers/src/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

FROM openeuler/python:3.11.13-oe2403lts

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 && \
yum clean all && \
rm -rf /var/cache/yum

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

COPY comps /home/user/comps

ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
if [ ${ARCH} = "cpu" ]; then \
$uvpip torch torchvision --index-url https://download.pytorch.org/whl/cpu; \
$uvpip -r /home/user/comps/retrievers/src/requirements-cpu.txt; \
else \
$uvpip -r /home/user/comps/retrievers/src/requirements-gpu.txt; \
fi

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"]
25 changes: 25 additions & 0 deletions comps/third_parties/nginx/src/Dockerfile.openEuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: Apache-2.0


FROM openeuler/nginx:1.29.0-oe2403lts

RUN yum update -y && \
yum install -y gettext && \
yum clean all && \
rm -fr /var/cache/yum

COPY comps/third_parties/nginx/src/nginx.conf.template /etc/nginx/nginx.conf.template

ENV FRONTEND_SERVICE_IP=localhost
ENV FRONTEND_SERVICE_PORT=5173
ENV BACKEND_SERVICE_NAME=chatqna
ENV BACKEND_SERVICE_IP=localhost
ENV BACKEND_SERVICE_PORT=8888
ENV DATAPREP_SERVICE_IP=localhost
ENV DATAPREP_SERVICE_PORT=6007

COPY comps/third_parties/nginx/deployment/docker_compose/start-nginx.sh /usr/local/bin/start-nginx.sh
RUN chmod +x /usr/local/bin/start-nginx.sh

CMD ["/usr/local/bin/start-nginx.sh"]
Loading
Loading