diff --git a/Dockerfile b/Dockerfile index 6b519073be8..ba274ddbb34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -183,8 +183,8 @@ COPY graphrag graphrag COPY pyproject.toml uv.lock ./ COPY docker/service_conf.yaml.template ./conf/service_conf.yaml.template -COPY docker/entrypoint.sh ./entrypoint.sh -RUN chmod +x ./entrypoint.sh +COPY docker/entrypoint.sh docker/entrypoint_task_executor.sh ./ +RUN chmod +x ./entrypoint*.sh # Copy compiled web pages COPY --from=builder /ragflow/web/dist /ragflow/web/dist diff --git a/README.md b/README.md index afb48edc3e0..0baac4bd38a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ 简体中文 | 日本語 | 한국어 | - Bahasa Indonesia + Bahasa Indonesia | + Português (Brasil)
@@ -68,6 +69,7 @@ data. ## 🎮 Demo Try our demo at [https://demo.ragflow.io](https://demo.ragflow.io). +
@@ -65,6 +66,7 @@ ## 🎮 Demo Coba demo kami di [https://demo.ragflow.io](https://demo.ragflow.io). +
@@ -30,7 +31,6 @@
-@@ -30,7 +31,6 @@
-+ English | + 简体中文 | + 日本語 | + 한국어 | + Bahasa Indonesia | + Português (Brasil) +
+ ++ + + + + + + + + + + + + + + +
+ +@@ -30,7 +31,6 @@
-- diff --git a/README_zh.md b/README_zh.md index 88e7aa351d7..de162f7f1e7 100644 --- a/README_zh.md +++ b/README_zh.md @@ -9,7 +9,8 @@ 简体中文 | 日本語 | 한국어 | - Bahasa Indonesia + Bahasa Indonesia | + Português (Brasil)
@@ -30,7 +31,6 @@
-- diff --git a/agent/__init__.py b/agent/__init__.py index 6bfdd33d0ba..643f79713c8 100644 --- a/agent/__init__.py +++ b/agent/__init__.py @@ -1,2 +1,18 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + from beartype.claw import beartype_this_package beartype_this_package() diff --git a/agent/component/__init__.py b/agent/component/__init__.py index 0d414fca997..da06c878c04 100644 --- a/agent/component/__init__.py +++ b/agent/component/__init__.py @@ -1,3 +1,19 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import importlib from .begin import Begin, BeginParam from .generate import Generate, GenerateParam diff --git a/agent/settings.py b/agent/settings.py index fbdb263dc74..932cb1d57a5 100644 --- a/agent/settings.py +++ b/agent/settings.py @@ -1,5 +1,5 @@ # -# Copyright 2019 The FATE Authors. All Rights Reserved. +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/api/__init__.py b/api/__init__.py index 6bfdd33d0ba..643f79713c8 100644 --- a/api/__init__.py +++ b/api/__init__.py @@ -1,2 +1,18 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + from beartype.claw import beartype_this_package beartype_this_package() diff --git a/api/utils/t_crypt.py b/api/utils/t_crypt.py index 67fd69c627a..cd9d1edcc9f 100644 --- a/api/utils/t_crypt.py +++ b/api/utils/t_crypt.py @@ -1,3 +1,19 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import base64 import os import sys diff --git a/api/utils/web_utils.py b/api/utils/web_utils.py index 687d683acbe..084b7a6f73f 100644 --- a/api/utils/web_utils.py +++ b/api/utils/web_utils.py @@ -1,3 +1,19 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import re import socket from urllib.parse import urlparse diff --git a/deepdoc/__init__.py b/deepdoc/__init__.py index 6bfdd33d0ba..643f79713c8 100644 --- a/deepdoc/__init__.py +++ b/deepdoc/__init__.py @@ -1,2 +1,18 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + from beartype.claw import beartype_this_package beartype_this_package() diff --git a/deepdoc/parser/__init__.py b/deepdoc/parser/__init__.py index 2a62a989468..1597ed08169 100644 --- a/deepdoc/parser/__init__.py +++ b/deepdoc/parser/__init__.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/docx_parser.py b/deepdoc/parser/docx_parser.py index 1910f4380c4..dfe3f37fd16 100644 --- a/deepdoc/parser/docx_parser.py +++ b/deepdoc/parser/docx_parser.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/excel_parser.py b/deepdoc/parser/excel_parser.py index 77cc7a058a3..bb9d65b00fc 100644 --- a/deepdoc/parser/excel_parser.py +++ b/deepdoc/parser/excel_parser.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/html_parser.py b/deepdoc/parser/html_parser.py index 973dbbd4644..29cc43a1d44 100644 --- a/deepdoc/parser/html_parser.py +++ b/deepdoc/parser/html_parser.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + from rag.nlp import find_codec import readability import html_text diff --git a/deepdoc/parser/json_parser.py b/deepdoc/parser/json_parser.py index fa30debdfe1..dc73246ef7e 100644 --- a/deepdoc/parser/json_parser.py +++ b/deepdoc/parser/json_parser.py @@ -1,4 +1,20 @@ # -*- coding: utf-8 -*- +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # The following documents are mainly referenced, and only adaptation modifications have been made # from https://github.com/langchain-ai/langchain/blob/master/libs/text-splitters/langchain_text_splitters/json.py diff --git a/deepdoc/parser/markdown_parser.py b/deepdoc/parser/markdown_parser.py index 60e6ba49834..d5d13837706 100644 --- a/deepdoc/parser/markdown_parser.py +++ b/deepdoc/parser/markdown_parser.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import re class RAGFlowMarkdownParser: diff --git a/deepdoc/parser/pdf_parser.py b/deepdoc/parser/pdf_parser.py index 5ff216edfa7..114339fa58c 100644 --- a/deepdoc/parser/pdf_parser.py +++ b/deepdoc/parser/pdf_parser.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/ppt_parser.py b/deepdoc/parser/ppt_parser.py index eca952badc9..4e459d19333 100644 --- a/deepdoc/parser/ppt_parser.py +++ b/deepdoc/parser/ppt_parser.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import logging from io import BytesIO from pptx import Presentation diff --git a/deepdoc/parser/resume/__init__.py b/deepdoc/parser/resume/__init__.py index 1038bf2b7b1..5006d7fbcc5 100644 --- a/deepdoc/parser/resume/__init__.py +++ b/deepdoc/parser/resume/__init__.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/entities/__init__.py b/deepdoc/parser/resume/entities/__init__.py index e69de29bb2d..e156bc93dde 100644 --- a/deepdoc/parser/resume/entities/__init__.py +++ b/deepdoc/parser/resume/entities/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# \ No newline at end of file diff --git a/deepdoc/parser/resume/entities/corporations.py b/deepdoc/parser/resume/entities/corporations.py index faeae4061f0..a52bfa14a58 100644 --- a/deepdoc/parser/resume/entities/corporations.py +++ b/deepdoc/parser/resume/entities/corporations.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/entities/degrees.py b/deepdoc/parser/resume/entities/degrees.py index 47a90b58211..ddb936e0b8f 100644 --- a/deepdoc/parser/resume/entities/degrees.py +++ b/deepdoc/parser/resume/entities/degrees.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/entities/industries.py b/deepdoc/parser/resume/entities/industries.py index 4768ceb50e8..c2b1b8e8261 100644 --- a/deepdoc/parser/resume/entities/industries.py +++ b/deepdoc/parser/resume/entities/industries.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/entities/regions.py b/deepdoc/parser/resume/entities/regions.py index 4c3f0d722fc..ac37f6ea1d8 100644 --- a/deepdoc/parser/resume/entities/regions.py +++ b/deepdoc/parser/resume/entities/regions.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import re TBL = { diff --git a/deepdoc/parser/resume/entities/schools.py b/deepdoc/parser/resume/entities/schools.py index c6b0bf7fdbc..2bc40e83638 100644 --- a/deepdoc/parser/resume/entities/schools.py +++ b/deepdoc/parser/resume/entities/schools.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/step_one.py b/deepdoc/parser/resume/step_one.py index 96cc668d316..4c65a97fe85 100644 --- a/deepdoc/parser/resume/step_one.py +++ b/deepdoc/parser/resume/step_one.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/parser/resume/step_two.py b/deepdoc/parser/resume/step_two.py index 9e4376735c3..6097a0132dc 100644 --- a/deepdoc/parser/resume/step_two.py +++ b/deepdoc/parser/resume/step_two.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import logging import re import copy diff --git a/deepdoc/parser/txt_parser.py b/deepdoc/parser/txt_parser.py index 93b52eea32d..7f21799237d 100644 --- a/deepdoc/parser/txt_parser.py +++ b/deepdoc/parser/txt_parser.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import re from deepdoc.parser.utils import get_text diff --git a/deepdoc/parser/utils.py b/deepdoc/parser/utils.py index 58be06c915e..85a3554955b 100644 --- a/deepdoc/parser/utils.py +++ b/deepdoc/parser/utils.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/__init__.py b/deepdoc/vision/__init__.py index 1410efc2581..c2c964326ee 100644 --- a/deepdoc/vision/__init__.py +++ b/deepdoc/vision/__init__.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/layout_recognizer.py b/deepdoc/vision/layout_recognizer.py index 1cf3aa1a2c8..467a22ee9cf 100644 --- a/deepdoc/vision/layout_recognizer.py +++ b/deepdoc/vision/layout_recognizer.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import os import re from collections import Counter diff --git a/deepdoc/vision/ocr.py b/deepdoc/vision/ocr.py index b6f81574120..9d9d44cde80 100644 --- a/deepdoc/vision/ocr.py +++ b/deepdoc/vision/ocr.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/postprocess.py b/deepdoc/vision/postprocess.py index 6fb111de3bb..2da1477b3e3 100644 --- a/deepdoc/vision/postprocess.py +++ b/deepdoc/vision/postprocess.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/recognizer.py b/deepdoc/vision/recognizer.py index 0695005c766..aeef52d5783 100644 --- a/deepdoc/vision/recognizer.py +++ b/deepdoc/vision/recognizer.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/seeit.py b/deepdoc/vision/seeit.py index 6064bc4843e..e820e89a51d 100644 --- a/deepdoc/vision/seeit.py +++ b/deepdoc/vision/seeit.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/t_ocr.py b/deepdoc/vision/t_ocr.py index 041c7710754..2165449de28 100644 --- a/deepdoc/vision/t_ocr.py +++ b/deepdoc/vision/t_ocr.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/deepdoc/vision/t_recognizer.py b/deepdoc/vision/t_recognizer.py index e81a57b843b..1db3356a9d6 100644 --- a/deepdoc/vision/t_recognizer.py +++ b/deepdoc/vision/t_recognizer.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + import logging import os import sys diff --git a/deepdoc/vision/table_structure_recognizer.py b/deepdoc/vision/table_structure_recognizer.py index be48ca95e4c..e31fd901e36 100644 --- a/deepdoc/vision/table_structure_recognizer.py +++ b/deepdoc/vision/table_structure_recognizer.py @@ -1,3 +1,6 @@ +# +# Copyright 2025 The InfiniFlow Authors. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 00901ddc7cf..676f167d6c7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -26,6 +26,28 @@ services: - ragflow restart: on-failure # https://docs.docker.com/engine/daemon/prometheus/#create-a-prometheus-configuration - # If you're using Docker Desktop, the --add-host flag is optional. This flag makes sure that the host's internal IP gets exposed to the Prometheus container. + # If you're using Docker Desktop, the --add-host flag is optional. This flag makes sure that the host's internal IP gets exposed to the Prometheus container. extra_hosts: - "host.docker.internal:host-gateway" + # executor: + # depends_on: + # mysql: + # condition: service_healthy + # image: ${RAGFLOW_IMAGE} + # container_name: ragflow-executor + # volumes: + # - ./ragflow-logs:/ragflow/logs + # - ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf + # env_file: .env + # environment: + # - TZ=${TIMEZONE} + # - HF_ENDPOINT=${HF_ENDPOINT} + # - MACOS=${MACOS} + # entrypoint: "/ragflow/entrypoint_task_executor.sh 1 3" + # networks: + # - ragflow + # restart: on-failure + # # https://docs.docker.com/engine/daemon/prometheus/#create-a-prometheus-configuration + # # If you're using Docker Desktop, the --add-host flag is optional. This flag makes sure that the host's internal IP gets exposed to the Prometheus container. + # extra_hosts: + # - "host.docker.internal:host-gateway" diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 792bbca7a60..3881029601b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,9 +7,6 @@ while IFS= read -r line || [[ -n "$line" ]]; do eval "echo \"$line\"" >> /ragflow/conf/service_conf.yaml done < /ragflow/conf/service_conf.yaml.template -# unset http proxy which maybe set by docker daemon -export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY="" - /usr/sbin/nginx export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ diff --git a/docker/entrypoint_task_executor.sh b/docker/entrypoint_task_executor.sh new file mode 100755 index 00000000000..899f16f8fb9 --- /dev/null +++ b/docker/entrypoint_task_executor.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# replace env variables in the service_conf.yaml file +rm -rf /ragflow/conf/service_conf.yaml +while IFS= read -r line || [[ -n "$line" ]]; do + # Use eval to interpret the variable with default values + eval "echo \"$line\"" >> /ragflow/conf/service_conf.yaml +done < /ragflow/conf/service_conf.yaml.template + +export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ + +PY=python3 + +CONSUMER_NO_BEG=$1 +CONSUMER_NO_END=$2 + +function task_exe(){ + while [ 1 -eq 1 ]; do + $PY rag/svr/task_executor.py $1; + done +} + +for ((i=CONSUMER_NO_BEG; i