From c4a982e9fa00e81f408485cc4ff76657f5b5a25f Mon Sep 17 00:00:00 2001 From: longbingljw Date: Mon, 19 Jan 2026 16:07:43 +0800 Subject: [PATCH] feat: add seekdb which is lite version of oceanbase (#12692) ### What problem does this PR solve? Add seekdb as doc_engine wich is the lite version of oceanbase. close #12691 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- .gitignore | 3 +++ common/settings.py | 3 +++ docker/.env | 14 ++++++++++++++ docker/docker-compose-base.yml | 26 ++++++++++++++++++++++++++ docker/service_conf.yaml.template | 8 ++++++++ 5 files changed, 54 insertions(+) diff --git a/.gitignore b/.gitignore index 310629bfa..bc2bb8abe 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,9 @@ docker/data docker/oceanbase/conf docker/oceanbase/data +# SeekDB data and conf +docker/seekdb + #--------------------------------------------------# # The following was generated with gitignore.nvim: # diff --git a/common/settings.py b/common/settings.py index 7b19357ad..efdd1fe36 100644 --- a/common/settings.py +++ b/common/settings.py @@ -257,6 +257,9 @@ def init_settings(): elif lower_case_doc_engine == "oceanbase": OB = get_base_config("oceanbase", {}) docStoreConn = rag.utils.ob_conn.OBConnection() + elif lower_case_doc_engine == "seekdb": + OB = get_base_config("seekdb", {}) + docStoreConn = rag.utils.ob_conn.OBConnection() else: raise Exception(f"Not supported doc engine: {DOC_ENGINE}") diff --git a/docker/.env b/docker/.env index 2d31177d7..c939cc8d5 100644 --- a/docker/.env +++ b/docker/.env @@ -16,6 +16,7 @@ # - `infinity` (https://github.com/infiniflow/infinity) # - `oceanbase` (https://github.com/oceanbase/oceanbase) # - `opensearch` (https://github.com/opensearch-project/OpenSearch) +# - `seekdb` (https://github.com/oceanbase/seekdb) DOC_ENGINE=${DOC_ENGINE:-elasticsearch} # Device on which deepdoc inference run. @@ -92,6 +93,19 @@ OB_SYSTEM_MEMORY=${OB_SYSTEM_MEMORY:-2G} OB_DATAFILE_SIZE=${OB_DATAFILE_SIZE:-20G} OB_LOG_DISK_SIZE=${OB_LOG_DISK_SIZE:-20G} +# The hostname where the SeekDB service is exposed +SEEKDB_HOST=seekdb +# The port used to expose the SeekDB service +SEEKDB_PORT=2881 +# The username for SeekDB +SEEKDB_USER=root +# The password for SeekDB +SEEKDB_PASSWORD=infini_rag_flow +# The doc database of the SeekDB service to use +SEEKDB_DOC_DBNAME=ragflow_doc +# SeekDB memory limit +SEEKDB_MEMORY_LIMIT=2G + # The password for MySQL. # WARNING: Change this for production! MYSQL_PASSWORD=infini_rag_flow diff --git a/docker/docker-compose-base.yml b/docker/docker-compose-base.yml index 11104aef5..0d265d8bf 100644 --- a/docker/docker-compose-base.yml +++ b/docker/docker-compose-base.yml @@ -121,6 +121,30 @@ services: - ragflow restart: unless-stopped + seekdb: + profiles: + - seekdb + image: oceanbase/seekdb:latest + container_name: seekdb + volumes: + - ./seekdb:/var/lib/oceanbase + ports: + - ${SEEKDB_PORT:-2881}:2881 + env_file: .env + environment: + - ROOT_PASSWORD=${SEEKDB_PASSWORD:-infini_rag_flow} + - MEMORY_LIMIT=${SEEKDB_MEMORY_LIMIT:-2G} + - REPORTER=ragflow-seekdb + mem_limit: ${MEM_LIMIT} + healthcheck: + test: ['CMD-SHELL', 'mysql -h127.0.0.1 -P2881 -uroot -p${SEEKDB_PASSWORD:-infini_rag_flow} -e "CREATE DATABASE IF NOT EXISTS ${SEEKDB_DOC_DBNAME:-ragflow_doc};"'] + interval: 5s + retries: 60 + timeout: 5s + networks: + - ragflow + restart: unless-stopped + sandbox-executor-manager: profiles: - sandbox @@ -283,6 +307,8 @@ volumes: driver: local ob_data: driver: local + seekdb_data: + driver: local mysql_data: driver: local minio_data: diff --git a/docker/service_conf.yaml.template b/docker/service_conf.yaml.template index 1500c2eaf..6e08e962a 100644 --- a/docker/service_conf.yaml.template +++ b/docker/service_conf.yaml.template @@ -38,6 +38,14 @@ oceanbase: password: '${OCEANBASE_PASSWORD:-infini_rag_flow}' host: '${OCEANBASE_HOST:-oceanbase}' port: ${OCEANBASE_PORT:-2881} +seekdb: + scheme: 'oceanbase' # SeekDB is the lite version of OceanBase + config: + db_name: '${SEEKDB_DOC_DBNAME:-ragflow_doc}' + user: '${SEEKDB_USER:-root}' + password: '${SEEKDB_PASSWORD:-infini_rag_flow}' + host: '${SEEKDB_HOST:-seekdb}' + port: ${SEEKDB_PORT:-2881} redis: db: 1 username: '${REDIS_USERNAME:-}'