mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-06 02:07:49 +08:00
Disable benchmark (#13370)
### What problem does this PR solve? benchmark always failed in new CI machine. please enable it after the issue is fixed. ### Type of change - [x] Other (please describe): disable benchmark Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
200
.github/workflows/tests.yml
vendored
200
.github/workflows/tests.yml
vendored
@ -421,106 +421,106 @@ jobs:
|
|||||||
done
|
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; 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 Infinity
|
# - name: RAGFlow CLI retrieval test Infinity
|
||||||
env:
|
# env:
|
||||||
PYTHONPATH: ${{ github.workspace }}
|
# PYTHONPATH: ${{ github.workspace }}
|
||||||
run: |
|
# run: |
|
||||||
set -euo pipefail
|
# set -euo pipefail
|
||||||
source .venv/bin/activate
|
# source .venv/bin/activate
|
||||||
|
#
|
||||||
export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
|
# export http_proxy=""; export https_proxy=""; export no_proxy=""; export HTTP_PROXY=""; export HTTPS_PROXY=""; export NO_PROXY=""
|
||||||
|
#
|
||||||
EMAIL="ci-${GITHUB_RUN_ID}@example.com"
|
# EMAIL="ci-${GITHUB_RUN_ID}@example.com"
|
||||||
PASS="ci-pass-${GITHUB_RUN_ID}"
|
# PASS="ci-pass-${GITHUB_RUN_ID}"
|
||||||
DATASET="ci_dataset_${GITHUB_RUN_ID}"
|
# DATASET="ci_dataset_${GITHUB_RUN_ID}"
|
||||||
|
#
|
||||||
CLI="python admin/client/ragflow_cli.py"
|
# CLI="python admin/client/ragflow_cli.py"
|
||||||
|
#
|
||||||
LOG_FILE="infinity_cli_test.log"
|
# LOG_FILE="infinity_cli_test.log"
|
||||||
: > "${LOG_FILE}"
|
# : > "${LOG_FILE}"
|
||||||
|
#
|
||||||
ERROR_RE='Traceback|ModuleNotFoundError|ImportError|Parse error|Bad response|Fail to|code:\\s*[1-9]'
|
# ERROR_RE='Traceback|ModuleNotFoundError|ImportError|Parse error|Bad response|Fail to|code:\\s*[1-9]'
|
||||||
run_cli() {
|
# run_cli() {
|
||||||
local logfile="$1"
|
# local logfile="$1"
|
||||||
shift
|
# shift
|
||||||
local allow_re=""
|
# local allow_re=""
|
||||||
if [[ "${1:-}" == "--allow" ]]; then
|
# if [[ "${1:-}" == "--allow" ]]; then
|
||||||
allow_re="$2"
|
# allow_re="$2"
|
||||||
shift 2
|
# shift 2
|
||||||
fi
|
# fi
|
||||||
local cmd_display="$*"
|
# local cmd_display="$*"
|
||||||
echo "===== $(date -u +\"%Y-%m-%dT%H:%M:%SZ\") CMD: ${cmd_display} =====" | tee -a "${logfile}"
|
# echo "===== $(date -u +\"%Y-%m-%dT%H:%M:%SZ\") CMD: ${cmd_display} =====" | tee -a "${logfile}"
|
||||||
local tmp_log
|
# local tmp_log
|
||||||
tmp_log="$(mktemp)"
|
# tmp_log="$(mktemp)"
|
||||||
set +e
|
# set +e
|
||||||
timeout 180s "$@" 2>&1 | tee "${tmp_log}"
|
# timeout 180s "$@" 2>&1 | tee "${tmp_log}"
|
||||||
local status=${PIPESTATUS[0]}
|
# local status=${PIPESTATUS[0]}
|
||||||
set -e
|
# set -e
|
||||||
cat "${tmp_log}" >> "${logfile}"
|
# cat "${tmp_log}" >> "${logfile}"
|
||||||
if grep -qiE "${ERROR_RE}" "${tmp_log}"; then
|
# if grep -qiE "${ERROR_RE}" "${tmp_log}"; then
|
||||||
if [[ -n "${allow_re}" ]] && grep -qiE "${allow_re}" "${tmp_log}"; then
|
# if [[ -n "${allow_re}" ]] && grep -qiE "${allow_re}" "${tmp_log}"; then
|
||||||
echo "Allowed CLI error markers in ${logfile}"
|
# echo "Allowed CLI error markers in ${logfile}"
|
||||||
rm -f "${tmp_log}"
|
# rm -f "${tmp_log}"
|
||||||
return 0
|
# return 0
|
||||||
fi
|
# fi
|
||||||
echo "Detected CLI error markers in ${logfile}"
|
# echo "Detected CLI error markers in ${logfile}"
|
||||||
rm -f "${tmp_log}"
|
# rm -f "${tmp_log}"
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
rm -f "${tmp_log}"
|
# rm -f "${tmp_log}"
|
||||||
return ${status}
|
# return ${status}
|
||||||
}
|
# }
|
||||||
|
#
|
||||||
set -a
|
# set -a
|
||||||
source docker/.env
|
# source docker/.env
|
||||||
set +a
|
# set +a
|
||||||
|
#
|
||||||
HOST_ADDRESS="http://host.docker.internal:${SVR_HTTP_PORT}"
|
# HOST_ADDRESS="http://host.docker.internal:${SVR_HTTP_PORT}"
|
||||||
USER_HOST="$(echo "${HOST_ADDRESS}" | sed -E 's#^https?://([^:/]+).*#\1#')"
|
# USER_HOST="$(echo "${HOST_ADDRESS}" | sed -E 's#^https?://([^:/]+).*#\1#')"
|
||||||
USER_PORT="${SVR_HTTP_PORT}"
|
# USER_PORT="${SVR_HTTP_PORT}"
|
||||||
ADMIN_HOST="${USER_HOST}"
|
# ADMIN_HOST="${USER_HOST}"
|
||||||
ADMIN_PORT="${ADMIN_SVR_HTTP_PORT}"
|
# 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
|
# 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..."
|
# echo "Waiting for service to be available..."
|
||||||
sleep 5
|
# sleep 5
|
||||||
done
|
# done
|
||||||
|
#
|
||||||
admin_ready=0
|
# admin_ready=0
|
||||||
for i in $(seq 1 30); do
|
# for i in $(seq 1 30); do
|
||||||
if run_cli "${LOG_FILE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "ping"; then
|
# if run_cli "${LOG_FILE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "ping"; then
|
||||||
admin_ready=1
|
# admin_ready=1
|
||||||
break
|
# break
|
||||||
fi
|
# fi
|
||||||
sleep 1
|
# sleep 1
|
||||||
done
|
# done
|
||||||
if [[ "${admin_ready}" -ne 1 ]]; then
|
# if [[ "${admin_ready}" -ne 1 ]]; then
|
||||||
echo "Admin service did not become ready"
|
# echo "Admin service did not become ready"
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
run_cli "${LOG_FILE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "show version"
|
# run_cli "${LOG_FILE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "show version"
|
||||||
ALLOW_USER_EXISTS_RE='already exists|already exist|duplicate|already.*registered|exist(s)?'
|
# ALLOW_USER_EXISTS_RE='already exists|already exist|duplicate|already.*registered|exist(s)?'
|
||||||
run_cli "${LOG_FILE}" --allow "${ALLOW_USER_EXISTS_RE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "create user '$EMAIL' '$PASS'"
|
# run_cli "${LOG_FILE}" --allow "${ALLOW_USER_EXISTS_RE}" $CLI --type admin --host "$ADMIN_HOST" --port "$ADMIN_PORT" --username "admin@ragflow.io" --password "admin" command "create user '$EMAIL' '$PASS'"
|
||||||
|
#
|
||||||
user_ready=0
|
# user_ready=0
|
||||||
for i in $(seq 1 30); do
|
# for i in $(seq 1 30); do
|
||||||
if run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "ping"; then
|
# if run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "ping"; then
|
||||||
user_ready=1
|
# user_ready=1
|
||||||
break
|
# break
|
||||||
fi
|
# fi
|
||||||
sleep 1
|
# sleep 1
|
||||||
done
|
# done
|
||||||
if [[ "${user_ready}" -ne 1 ]]; then
|
# if [[ "${user_ready}" -ne 1 ]]; then
|
||||||
echo "User service did not become ready"
|
# echo "User service did not become ready"
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "show version"
|
# run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "show version"
|
||||||
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "create dataset '$DATASET' with embedding 'BAAI/bge-small-en-v1.5@Builtin' parser 'auto'"
|
# run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "create dataset '$DATASET' with embedding 'BAAI/bge-small-en-v1.5@Builtin' parser 'auto'"
|
||||||
run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "import 'test/benchmark/test_docs/Doc1.pdf,test/benchmark/test_docs/Doc2.pdf' into dataset '$DATASET'"
|
# run_cli "${LOG_FILE}" $CLI --type user --host "$USER_HOST" --port "$USER_PORT" --username "$EMAIL" --password "$PASS" command "import 'test/benchmark/test_docs/Doc1.pdf,test/benchmark/test_docs/Doc2.pdf' into dataset '$DATASET'"
|
||||||
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 "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'"
|
# 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 Infinity
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
|||||||
Reference in New Issue
Block a user