Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Update CI (#13774)

Jin Hai24fcd6bbc726
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index ebf62ee7d3..0bd3fc2967 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -164,96 +164,101 @@ jobs:
echo "Start to run unit test"
python3 run_tests.py
- - name: Start ragflow:nightly
+ - name: Prepare function test environment
working-directory: docker
run: |
# Determine runner number (default to 1 if not found)
- RUNNER_NUM=$(sudo docker inspect $(hostname) --format '{{index .Config.Labels "com.docker.compose.container-number"}}' 2>/dev/null || true)
- RUNNER_NUM=${RUNNER_NUM:-1}
+ RUNNER_NUM=$(sudo docker inspect $(hostname) --format '{{index .Config.Labels "com.docker.compose.container-number"}}' 2>/dev/null || true)
+ RUNNER_NUM=${RUNNER_NUM:-1}
# Compute port numbers using bash arithmetic
- ES_PORT=$((1200 + RUNNER_NUM * 10))
- OS_PORT=$((1201 + RUNNER_NUM * 10))
- INFINITY_THRIFT_PORT=$((23817 + RUNNER_NUM * 10))
- INFINITY_HTTP_PORT=$((23820 + RUNNER_NUM * 10))
- INFINITY_PSQL_PORT=$((5432 + RUNNER_NUM * 10))
- EXPOSE_MYSQL_PORT=$((5455 + RUNNER_NUM * 10))
- MINIO_PORT=$((9000 + RUNNER_NUM * 10))
- MINIO_CONSOLE_PORT=$((9001 + RUNNER_NUM * 10))
- REDIS_PORT=$((6379 + RUNNER_NUM * 10))
- TEI_PORT=$((6380 + RUNNER_NUM * 10))
- KIBANA_PORT=$((6601 + RUNNER_NUM * 10))
- SVR_HTTP_PORT=$((9380 + RUNNER_NUM * 10))
- ADMIN_SVR_HTTP_PORT=$((9381 + RUNNER_NUM * 10))
- SVR_MCP_PORT=$((9382 + RUNNER_NUM * 10))
- GO_HTTP_PORT=$((9384 + RUNNER_NUM * 10))
- GO_ADMIN_PORT=$((9383 + RUNNER_NUM * 10))
- SANDBOX_EXECUTOR_MANAGER_PORT=$((9385 + RUNNER_NUM * 10))
- SVR_WEB_HTTP_PORT=$((80 + RUNNER_NUM * 10))
- SVR_WEB_HTTPS_PORT=$((443 + RUNNER_NUM * 10))
+ ES_PORT=$((1200 + RUNNER_NUM * 10))
+ OS_PORT=$((1201 + RUNNER_NUM * 10))
+ INFINITY_THRIFT_PORT=$((23817 + RUNNER_NUM * 10))
+ INFINITY_HTTP_PORT=$((23820 + RUNNER_NUM * 10))
+ INFINITY_PSQL_PORT=$((5432 + RUNNER_NUM * 10))
+ EXPOSE_MYSQL_PORT=$((5455 + RUNNER_NUM * 10))
+ MINIO_PORT=$((9000 + RUNNER_NUM * 10))
+ MINIO_CONSOLE_PORT=$((9001 + RUNNER_NUM * 10))
+ REDIS_PORT=$((6379 + RUNNER_NUM * 10))
+ TEI_PORT=$((6380 + RUNNER_NUM * 10))
+ KIBANA_PORT=$((6601 + RUNNER_NUM * 10))
+ SVR_HTTP_PORT=$((9380 + RUNNER_NUM * 10))
+ ADMIN_SVR_HTTP_PORT=$((9381 + RUNNER_NUM * 10))
+ SVR_MCP_PORT=$((9382 + RUNNER_NUM * 10))
+ GO_HTTP_PORT=$((9384 + RUNNER_NUM * 10))
+ GO_ADMIN_PORT=$((9383 + RUNNER_NUM * 10))
+ SANDBOX_EXECUTOR_MANAGER_PORT=$((9385 + RUNNER_NUM * 10))
+ SVR_WEB_HTTP_PORT=$((80 + RUNNER_NUM * 10))
+ SVR_WEB_HTTPS_PORT=$((443 + RUNNER_NUM * 10))
# Persist computed ports into .env so docker-compose uses the correct host bindings
- echo "" >> .env
- echo -e "ES_PORT=${ES_PORT}" >> .env
- echo -e "OS_PORT=${OS_PORT}" >> .env
- echo -e "INFINITY_THRIFT_PORT=${INFINITY_THRIFT_PORT}" >> .env
- echo -e "INFINITY_HTTP_PORT=${INFINITY_HTTP_PORT}" >> .env
- echo -e "INFINITY_PSQL_PORT=${INFINITY_PSQL_PORT}" >> .env
- echo -e "EXPOSE_MYSQL_PORT=${EXPOSE_MYSQL_PORT}" >> .env
- echo -e "MINIO_PORT=${MINIO_PORT}" >> .env
- echo -e "MINIO_CONSOLE_PORT=${MINIO_CONSOLE_PORT}" >> .env
- echo -e "REDIS_PORT=${REDIS_PORT}" >> .env
- echo -e "TEI_PORT=${TEI_PORT}" >> .env
- echo -e "KIBANA_PORT=${KIBANA_PORT}" >> .env
- echo -e "SVR_HTTP_PORT=${SVR_HTTP_PORT}" >> .env
- echo -e "ADMIN_SVR_HTTP_PORT=${ADMIN_SVR_HTTP_PORT}" >> .env
- echo -e "SVR_MCP_PORT=${SVR_MCP_PORT}" >> .env
- echo -e "GO_HTTP_PORT=${GO_HTTP_PORT}" >> .env
- echo -e "GO_ADMIN_PORT=${GO_ADMIN_PORT}" >> .env
- echo -e "SANDBOX_EXECUTOR_MANAGER_PORT=${SANDBOX_EXECUTOR_MANAGER_PORT}" >> .env
- echo -e "SVR_WEB_HTTP_PORT=${SVR_WEB_HTTP_PORT}" >> .env
- echo -e "SVR_WEB_HTTPS_PORT=${SVR_WEB_HTTPS_PORT}" >> .env
-
- echo -e "COMPOSE_PROFILES=\${COMPOSE_PROFILES},tei-cpu" >> .env
- echo -e "TEI_MODEL=BAAI/bge-small-en-v1.5" >> .env
- echo -e "RAGFLOW_IMAGE=${RAGFLOW_IMAGE}" >> .env
- echo "HOST_ADDRESS=http://host.docker.internal:${SVR_HTTP_PORT}" >> ${GITHUB_ENV}
-
- # Patch entrypoint.sh for coverage
- sed -i '/"\$PY" api\/ragflow_server.py \${INIT_SUPERUSER_ARGS} &/c\ echo "Ensuring coverage is installed..."\n "$PY" -m pip install coverage -i https://mirrors.aliyun.com/pypi/simple\n export COVERAGE_FILE=/ragflow/logs/.coverage\n echo "Starting ragflow_server with coverage..."\n "$PY" -m coverage run --source=./api/apps --omit="*/tests/*,*/migrations/*" -a api/ragflow_server.py ${INIT_SUPERUSER_ARGS} &' ./entrypoint.sh
-
- sudo docker compose -f docker-compose.yml -p ${GITHUB_RUN_ID} up -d
- cd ..
- uv sync --python 3.12 --group test --frozen && uv pip install -e sdk/python
+ echo "" >> .env
+ echo -e "ES_PORT=${ES_PORT}" >> .env
+ echo -e "OS_PORT=${OS_PORT}" >> .env
+ echo -e "INFINITY_THRIFT_PORT=${INFINITY_THRIFT_PORT}" >> .env
+ echo -e "INFINITY_HTTP_PORT=${INFINITY_HTTP_PORT}" >> .env
+ echo -e "INFINITY_PSQL_PORT=${INFINITY_PSQL_PORT}" >> .env
+ echo -e "EXPOSE_MYSQL_PORT=${EXPOSE_MYSQL_PORT}" >> .env
+ echo -e "MINIO_PORT=${MINIO_PORT}" >> .env
+ echo -e "MINIO_CONSOLE_PORT=${MINIO_CONSOLE_PORT}" >> .env
+ echo -e "REDIS_PORT=${REDIS_PORT}" >> .env
+ echo -e "TEI_PORT=${TEI_PORT}" >> .env
+ echo -e "KIBANA_PORT=${KIBANA_PORT}" >> .env
+ echo -e "SVR_HTTP_PORT=${SVR_HTTP_PORT}" >> .env
+ echo -e "ADMIN_SVR_HTTP_PORT=${ADMIN_SVR_HTTP_PORT}" >> .env
+ echo -e "SVR_MCP_PORT=${SVR_MCP_PORT}" >> .env
+ echo -e "GO_HTTP_PORT=${GO_HTTP_PORT}" >> .env
+ echo -e "GO_ADMIN_PORT=${GO_ADMIN_PORT}" >> .env
+ echo -e "SANDBOX_EXECUTOR_MANAGER_PORT=${SANDBOX_EXECUTOR_MANAGER_PORT}" >> .env
+ echo -e "SVR_WEB_HTTP_PORT=${SVR_WEB_HTTP_PORT}" >> .env
+ echo -e "SVR_WEB_HTTPS_PORT=${SVR_WEB_HTTPS_PORT}" >> .env
+
+ echo -e "COMPOSE_PROFILES=\${COMPOSE_PROFILES},tei-cpu" >> .env
+ echo -e "TEI_MODEL=BAAI/bge-small-en-v1.5" >> .env
+ echo -e "RAGFLOW_IMAGE=${RAGFLOW_IMAGE}" >> .env
+ echo "HOST_ADDRESS=http://host.docker.internal:${SVR_HTTP_PORT}" >> ${GITHUB_ENV}
+
+ # Patch entrypoint.sh for coverage
+ sed -i '/"\$PY" api\/ragflow_server.py \${INIT_SUPERUSER_ARGS} &/c\ echo "Ensuring coverage is installed..."\n "$PY" -m pip install coverage -i https://mirrors.aliyun.com/pypi/simple\n export COVERAGE_FILE=/ragflow/logs/.coverage\n echo "Starting ragflow_server with coverage..."\n "$PY" -m coverage run --source=./api/apps --omit="*/tests/*,*/migrations/*" -a api/ragflow_server.py ${INIT_SUPERUSER_ARGS} &' ./entrypoint.sh
+ cd ..
+ uv sync --python 3.12 --group test --frozen && uv pip install -e sdk/python
+
+
+ - name: Start ragflow:nightly for Infinity
+ run: |
+ sed -i 's/^DOC_ENGINE=.*$/DOC_ENGINE=infinity/' docker/.env
+ sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} up -d
- - name: Run sdk tests against Elasticsearch
+ - name: Run sdk tests against Infinity
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} --junitxml=pytest-infinity-sdk.xml --cov=sdk/python/ragflow_sdk --cov-branch --cov-report=xml:coverage-es-sdk.xml test/testcases/test_sdk_api 2>&1 | tee es_sdk_test.log
+ echo "Start to run test sdk on Infinity"
+ source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} --junitxml=pytest-infinity-sdk.xml --cov=sdk/python/ragflow_sdk --cov-branch --cov-report=xml:coverage-infinity-sdk.xml test/testcases/test_sdk_api 2>&1 | tee infinity_sdk_test.log
- - name: Run web api tests against Elasticsearch
+ - name: Run web api tests against Infinity
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api 2>&1 | tee es_web_api_test.log
+ source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api/test_api_app 2>&1 | tee infinity_web_api_test.log
- - name: Run http api tests against Elasticsearch
+ - name: Run http api tests against Infinity
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_http_api 2>&1 | tee es_http_api_test.log
+ source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_http_api 2>&1 | tee infinity_http_api_test.log
- - name: RAGFlow CLI retrieval test Elasticsearch
+ - name: RAGFlow CLI retrieval test Infinity
env:
PYTHONPATH: ${{ github.workspace }}
run: |
@@ -268,7 +273,7 @@ jobs:
CLI="python admin/client/ragflow_cli.py"
- LOG_FILE="es_cli_test.log"
+ LOG_FILE="infinity_cli_test.log"
: > "${LOG_FILE}"
ERROR_RE='Traceback|ModuleNotFoundError|ImportError|Parse error|Bad response|Fail to|code:\\s*[1-9]'
@@ -313,8 +318,8 @@ jobs:
ADMIN_HOST="${USER_HOST}"
ADMIN_PORT="${ADMIN_SVR_HTTP_PORT}"
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
@@ -354,7 +359,7 @@ jobs:
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "parse dataset '$DATASET' sync"
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "Benchmark 16 100 search 'what are these documents about' on datasets '$DATASET'"
- - name: Stop ragflow to save coverage Elasticsearch
+ - name: Stop ragflow to save coverage Infinity
if: ${{ !cancelled() }}
run: |
# Send SIGINT to ragflow_server.py to trigger coverage save
@@ -369,7 +374,7 @@ jobs:
fi
sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} stop
- - name: Generate server coverage report Elasticsearch
+ - name: Generate server coverage report Infinity
if: ${{ !cancelled() }}
run: |
# .coverage file should be in docker/ragflow-logs/.coverage
@@ -382,64 +387,71 @@ jobs:
echo "source =" >> .coveragerc
echo " ." >> .coveragerc
echo " /ragflow" >> .coveragerc
- coverage xml -o coverage-es-server.xml
+ coverage xml -o coverage-infinity-server.xml
rm .coveragerc
- # Clean up for next run
- sudo rm docker/ragflow-logs/.coverage
else
echo ".coverage file not found!"
fi
-
- - name: Collect ragflow log Elasticsearch
+
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v5
+ if: ${{ !cancelled() }}
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ fail_ci_if_error: false
+
+ - name: Collect ragflow log Infinity
if: ${{ !cancelled() }}
run: |
if [ -d docker/ragflow-logs ]; then
- cp -r docker/ragflow-logs ${ARTIFACTS_DIR}/ragflow-logs-es
+ cp -r docker/ragflow-logs ${ARTIFACTS_DIR}/ragflow-logs-infinity
echo "ragflow log" && tail -n 200 docker/ragflow-logs/ragflow_server.log || true
else
echo "No docker/ragflow-logs directory found; skipping log collection"
fi
sudo rm -rf docker/ragflow-logs || true
- - name: Stop ragflow:nightly
+ - name: Stop ragflow:nightly for Infinity
if: always() # always run this step even if previous steps failed
run: |
+ # Sometimes `docker compose down` fail due to hang container, heavy load etc. Need to remove such containers to release resources(for example, listen ports).
sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} down -v || true
sudo docker ps -a --filter "label=com.docker.compose.project=${GITHUB_RUN_ID}" -q | xargs -r sudo docker rm -f
- - name: Start ragflow:nightly
+ - name: Start ragflow:nightly for Elasticsearch
run: |
- sed -i '1i DOC_ENGINE=infinity' docker/.env
+ sed -i 's/^DOC_ENGINE=.*$/DOC_ENGINE=elasticsearch/' docker/.env
sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} up -d
- - name: Run sdk tests against Infinity
+ - name: Run sdk tests against Elasticsearch
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} --junitxml=pytest-infinity-sdk.xml --cov=sdk/python/ragflow_sdk --cov-branch --cov-report=xml:coverage-infinity-sdk.xml test/testcases/test_sdk_api 2>&1 | tee infinity_sdk_test.log
+ echo "Start to run test sdk on Elasticsearch"
+ source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} --junitxml=pytest-infinity-sdk.xml --cov=sdk/python/ragflow_sdk --cov-branch --cov-report=xml:coverage-es-sdk.xml test/testcases/test_sdk_api 2>&1 | tee es_sdk_test.log
- - name: Run web api tests against Infinity
+ - name: Run web api tests against Elasticsearch
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api/test_api_app 2>&1 | tee infinity_web_api_test.log
+ source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_web_api 2>&1 | tee es_web_api_test.log
- - name: Run http api tests against Infinity
+ - name: Run http api tests against Elasticsearch
run: |
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
- source .venv/bin/activate && set -o pipefail; DOC_ENGINE=infinity pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_http_api 2>&1 | tee infinity_http_api_test.log
+ source .venv/bin/activate && set -o pipefail; pytest -s --tb=short --level=${HTTP_API_TEST_LEVEL} test/testcases/test_http_api 2>&1 | tee es_http_api_test.log
- - name: RAGFlow CLI retrieval test Infinity
+ - name: RAGFlow CLI retrieval test Elasticsearch
env:
PYTHONPATH: ${{ github.workspace }}
run: |
@@ -454,7 +466,7 @@ jobs:
CLI="python admin/client/ragflow_cli.py"
- LOG_FILE="infinity_cli_test.log"
+ LOG_FILE="es_cli_test.log"
: > "${LOG_FILE}"
ERROR_RE='Traceback|ModuleNotFoundError|ImportError|Parse error|Bad response|Fail to|code:\\s*[1-9]'
@@ -499,8 +511,8 @@ jobs:
ADMIN_HOST="${USER_HOST}"
ADMIN_PORT="${ADMIN_SVR_HTTP_PORT}"
- until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null; do
- echo "Waiting for service to be available..."
+ until sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/v1/system/ping > /dev/null 2>&1; do
+ echo "Waiting for service to be available... (last exit code: $?)"
sleep 5
done
@@ -540,7 +552,7 @@ jobs:
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "parse dataset '$DATASET' sync"
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "Benchmark 16 100 search 'what are these documents about' on datasets '$DATASET'"
- - name: Stop ragflow to save coverage Infinity
+ - name: Stop ragflow to save coverage Elasticsearch
if: ${{ !cancelled() }}
run: |
# Send SIGINT to ragflow_server.py to trigger coverage save
@@ -555,7 +567,7 @@ jobs:
fi
sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} stop
- - name: Generate server coverage report Infinity
+ - name: Generate server coverage report Elasticsearch
if: ${{ !cancelled() }}
run: |
# .coverage file should be in docker/ragflow-logs/.coverage
@@ -568,36 +580,30 @@ jobs:
echo "source =" >> .coveragerc
echo " ." >> .coveragerc
echo " /ragflow" >> .coveragerc
- coverage xml -o coverage-infinity-server.xml
+ coverage xml -o coverage-es-server.xml
rm .coveragerc
+ # Clean up for next run
+ sudo rm docker/ragflow-logs/.coverage
else
echo ".coverage file not found!"
fi
- - name: Upload coverage reports to Codecov
- uses: codecov/codecov-action@v5
- if: ${{ !cancelled() }}
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- fail_ci_if_error: false
-
- - name: Collect ragflow log
+ - name: Collect ragflow log Elasticsearch
if: ${{ !cancelled() }}
run: |
if [ -d docker/ragflow-logs ]; then
- cp -r docker/ragflow-logs ${ARTIFACTS_DIR}/ragflow-logs-infinity
+ cp -r docker/ragflow-logs ${ARTIFACTS_DIR}/ragflow-logs-es
echo "ragflow log" && tail -n 200 docker/ragflow-logs/ragflow_server.log || true
else
echo "No docker/ragflow-logs directory found; skipping log collection"
fi
sudo rm -rf docker/ragflow-logs || true
- - name: Stop ragflow:nightly
+ - name: Stop ragflow:nightly for Elasticsearch
if: always() # always run this step even if previous steps failed
- working-directory: docker
run: |
# Sometimes `docker compose down` fail due to hang container, heavy load etc. Need to remove such containers to release resources(for example, listen ports).
- sudo docker compose -f docker-compose.yml -p ${GITHUB_RUN_ID} down -v || true
+ sudo docker compose -f docker/docker-compose.yml -p ${GITHUB_RUN_ID} down -v || true
sudo docker ps -a --filter "label=com.docker.compose.project=${GITHUB_RUN_ID}" -q | xargs -r sudo docker rm -f
if [[ -n ${RAGFLOW_IMAGE} ]]; then
sudo docker rmi -f ${RAGFLOW_IMAGE}
diff --git a/admin/server/admin_server.py b/admin/server/admin_server.py
index 2fbb4174c0..b7eca4aa9d 100644
--- a/admin/server/admin_server.py
+++ b/admin/server/admin_server.py
@@ -58,7 +58,7 @@ if __name__ == '__main__':
os.environ.get("MAX_CONTENT_LENGTH", 1024 * 1024 * 1024)
)
Session(app)
- logging.info(f'RAGFlow version: {get_ragflow_version()}')
+ logging.info(f'RAGFlow admin version: {get_ragflow_version()}')
show_configs()
login_manager = LoginManager()
login_manager.init_app(app)
diff --git a/api/ragflow_server.py b/api/ragflow_server.py
index 1beb0cd099..a9896ecaa9 100644
--- a/api/ragflow_server.py
+++ b/api/ragflow_server.py
@@ -14,9 +14,7 @@
# limitations under the License.
#
-# from beartype import BeartypeConf
-# from beartype.claw import beartype_all # <-- you didn't sign up for this
-# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
+print("Start RAGFlow server...")
import time
start_ts = time.time()
diff --git a/docker/.env b/docker/.env
index 858c053d85..6665c08b98 100644
--- a/docker/.env
+++ b/docker/.env
@@ -288,4 +288,4 @@ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
THREAD_POOL_MAX_WORKERS=128
#Option to disable login form for SSO
-DISABLE_PASSWORD_LOGIN=false
\ No newline at end of file
+DISABLE_PASSWORD_LOGIN=false
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 97b1ec6990..a07c148a63 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -234,8 +234,9 @@ function ensure_docling() {
}
function ensure_db_init() {
- echo "Initializing database tables..."
- "$PY" -c "from api.db.db_models import init_database_tables as init_web_db; init_web_db()"
+ echo "Initializing database tables..."
+ "$PY" -c "from api.db.db_models import init_database_tables as init_web_db; init_web_db()"
+ echo "Database tables initialized."
}
function wait_for_server() {
@@ -266,38 +267,48 @@ if [[ "${ENABLE_WEBSERVER}" -eq 1 ]]; then
echo "Starting nginx..."
/usr/sbin/nginx
- echo "Starting ragflow_server..."
while true; do
- "$PY" api/ragflow_server.py ${INIT_SUPERUSER_ARGS} &
-
- if [[ "${API_PROXY_SCHEME}" == "hybrid" ]]; then
- wait_for_server "http://127.0.0.1:9380/healthz" "ragflow_server"
- echo "Starting RAGFlow server in hybrid mode..."
- bin/server_main &
- fi
- wait;
+ echo "Attempt to start RAGFlow server..."
+ "$PY" api/ragflow_server.py ${INIT_SUPERUSER_ARGS}
+ echo "RAGFlow python server started."
sleep 1;
done &
+
+ if [[ "${API_PROXY_SCHEME}" == "hybrid" ]]; then
+ while true; do
+ echo "Attempt to start RAGFlow go server..."
+ wait_for_server "http://127.0.0.1:9380/healthz" "ragflow_server"
+ echo "Starting RAGFlow go server..."
+ bin/server_main
+ sleep 1;
+ done &
+ fi
fi
-if [[ "${ENABLE_DATASYNC}" -eq 1 ]]; then
- echo "Starting data sync..."
+
+if [[ "${ENABLE_ADMIN_SERVER}" -eq 1 ]]; then
while true; do
- "$PY" rag/svr/sync_data_source.py &
- wait;
+ echo "Attempt to start Admin python server..."
+ "$PY" admin/server/admin_server.py
+ echo "Admin python server started"
sleep 1;
done &
+
+ if [[ "${API_PROXY_SCHEME}" == "hybrid" ]]; then
+ while true; do
+ echo "Attempt to starting Admin go server..."
+ wait_for_server "http://127.0.0.1:9381/api/v1/admin/ping" "admin_server"
+ echo "Starting Admin go server..."
+ bin/admin_server
+ sleep 1;
+ done &
+ fi
fi
-if [[ "${ENABLE_ADMIN_SERVER}" -eq 1 ]]; then
- echo "Starting admin_server..."
+if [[ "${ENABLE_DATASYNC}" -eq 1 ]]; then
+ echo "Starting data sync..."
while true; do
- "$PY" admin/server/admin_server.py &
- if [[ "${API_PROXY_SCHEME}" == "hybrid" ]]; then
- wait_for_server "http://127.0.0.1:9381/api/v1/admin/ping" "admin_server"
- echo "Starting Admin server in hybrid mode..."
- bin/admin_server &
- fi
+ "$PY" rag/svr/sync_data_source.py &
wait;
sleep 1;
done &
diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py
index 7dd1a51cb6..9fde44222d 100644
--- a/rag/svr/sync_data_source.py
+++ b/rag/svr/sync_data_source.py
@@ -1432,7 +1432,7 @@ async def main():
__/ |
|___/
""")
- logging.info(f"RAGFlow version: {get_ragflow_version()}")
+ logging.info(f"RAGFlow data sync version: {get_ragflow_version()}")
show_configs()
settings.init_settings()
if sys.platform != "win32":
diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py
index 3a12f78266..2909181c8f 100644
--- a/rag/svr/task_executor.py
+++ b/rag/svr/task_executor.py
@@ -1385,7 +1385,7 @@ async def main():
/___/_/ /_/\__, /\___/____/\__/_/\____/_/ /_/ /____/\___/_/ |___/\___/_/
/____/
""")
- logging.info(f'RAGFlow version: {get_ragflow_version()}')
+ logging.info(f'RAGFlow ingestion version: {get_ragflow_version()}')
show_configs()
settings.init_settings()
settings.check_and_install_torch()