-
Notifications
You must be signed in to change notification settings - Fork 217
Support for openEuler #1813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Support for openEuler #1813
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
47407b2
add openEuler support and update some tests
zhihangdeng 873160f
add openEuler support for NGINX
zhihangdeng ad75c36
update copyright and add test for nginx
zhihangdeng 7a8e09e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Copyright (C) 2025 Intel Corporation | ||
| # 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"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
chensuyue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # 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 \ | ||
| mesa-libGL \ | ||
| jemalloc-devel \ | ||
| mariadb-connector-c-devel-3.3.8 \ | ||
| libpq-devel \ | ||
| poppler-utils \ | ||
| tesseract \ | ||
| ffmpeg \ | ||
| wget curl \ | ||
| shadow && \ | ||
| yum clean all && \ | ||
| rm -rf /var/cache/yum | ||
|
|
||
| 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* | ||
|
|
||
| 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')"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # 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')"] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # 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"] |
chensuyue marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.