From 12a9e2972a097ccec5608cc8fe1a188af549de90 Mon Sep 17 00:00:00 2001 From: powerfool Date: Thu, 7 Nov 2024 13:22:09 +0800 Subject: [PATCH] Adjusted docker manifests and environment variables for OceanBase vector database (#10395) --- .gitignore | 1 + api/.env.example | 4 ++-- docker/.env.example | 6 +++--- docker/docker-compose.yaml | 12 +++++++++--- docker/volumes/oceanbase/init.d/vec_memory.sql | 1 + 5 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 docker/volumes/oceanbase/init.d/vec_memory.sql diff --git a/.gitignore b/.gitignore index 60b5781733..1423bfee56 100644 --- a/.gitignore +++ b/.gitignore @@ -175,6 +175,7 @@ docker/volumes/pgvector/data/* docker/volumes/pgvecto_rs/data/* docker/volumes/couchbase/* docker/volumes/oceanbase/* +!docker/volumes/oceanbase/init.d docker/nginx/conf.d/default.conf docker/nginx/ssl/* diff --git a/api/.env.example b/api/.env.example index 6fc58263c4..a92490608f 100644 --- a/api/.env.example +++ b/api/.env.example @@ -121,7 +121,7 @@ WEB_API_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,* CONSOLE_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,* -# Vector database configuration, support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, couchbase, vikingdb, upstash, lindorm +# Vector database configuration, support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, couchbase, vikingdb, upstash, lindorm, oceanbase VECTOR_STORE=weaviate # Weaviate configuration @@ -273,7 +273,7 @@ LINDORM_PASSWORD=admin OCEANBASE_VECTOR_HOST=127.0.0.1 OCEANBASE_VECTOR_PORT=2881 OCEANBASE_VECTOR_USER=root@test -OCEANBASE_VECTOR_PASSWORD= +OCEANBASE_VECTOR_PASSWORD=difyai123456 OCEANBASE_VECTOR_DATABASE=test OCEANBASE_MEMORY_LIMIT=6G diff --git a/docker/.env.example b/docker/.env.example index aa5e102bd0..9a178dc44c 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -374,7 +374,7 @@ SUPABASE_URL=your-server-url # ------------------------------ # The type of vector store to use. -# Supported values are `weaviate`, `qdrant`, `milvus`, `myscale`, `relyt`, `pgvector`, `pgvecto-rs`, `chroma`, `opensearch`, `tidb_vector`, `oracle`, `tencent`, `elasticsearch`, `analyticdb`, `couchbase`, `vikingdb`. +# Supported values are `weaviate`, `qdrant`, `milvus`, `myscale`, `relyt`, `pgvector`, `pgvecto-rs`, `chroma`, `opensearch`, `tidb_vector`, `oracle`, `tencent`, `elasticsearch`, `analyticdb`, `couchbase`, `vikingdb`, `oceanbase`. VECTOR_STORE=weaviate # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`. @@ -537,10 +537,10 @@ LINDORM_USERNAME=username LINDORM_PASSWORD=password # OceanBase Vector configuration, only available when VECTOR_STORE is `oceanbase` -OCEANBASE_VECTOR_HOST=oceanbase-vector +OCEANBASE_VECTOR_HOST=oceanbase OCEANBASE_VECTOR_PORT=2881 OCEANBASE_VECTOR_USER=root@test -OCEANBASE_VECTOR_PASSWORD= +OCEANBASE_VECTOR_PASSWORD=difyai123456 OCEANBASE_VECTOR_DATABASE=test OCEANBASE_MEMORY_LIMIT=6G diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index cdcc62e127..a7cb8576fd 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -266,8 +266,9 @@ x-shared-env: &shared-api-worker-env OCEANBASE_VECTOR_HOST: ${OCEANBASE_VECTOR_HOST:-http://oceanbase-vector} OCEANBASE_VECTOR_PORT: ${OCEANBASE_VECTOR_PORT:-2881} OCEANBASE_VECTOR_USER: ${OCEANBASE_VECTOR_USER:-root@test} - OCEANBASE_VECTOR_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-""} + OCEANBASE_VECTOR_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456} OCEANBASE_VECTOR_DATABASE: ${OCEANBASE_VECTOR_DATABASE:-test} + OCEANBASE_CLUSTER_NAME: ${OCEANBASE_CLUSTER_NAME:-difyai} OCEANBASE_MEMORY_LIMIT: ${OCEANBASE_MEMORY_LIMIT:-6G} services: @@ -597,16 +598,21 @@ services: IS_PERSISTENT: ${CHROMA_IS_PERSISTENT:-TRUE} # OceanBase vector database - oceanbase-vector: + oceanbase: image: quay.io/oceanbase/oceanbase-ce:4.3.3.0-100000142024101215 profiles: - - oceanbase-vector + - oceanbase restart: always volumes: - ./volumes/oceanbase/data:/root/ob - ./volumes/oceanbase/conf:/root/.obd/cluster + - ./volumes/oceanbase/init.d:/root/boot/init.d environment: OB_MEMORY_LIMIT: ${OCEANBASE_MEMORY_LIMIT:-6G} + OB_SYS_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456} + OB_TENANT_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456} + OB_CLUSTER_NAME: ${OCEANBASE_CLUSTER_NAME:-difyai} + OB_SERVER_IP: '127.0.0.1' # Oracle vector database oracle: diff --git a/docker/volumes/oceanbase/init.d/vec_memory.sql b/docker/volumes/oceanbase/init.d/vec_memory.sql new file mode 100644 index 0000000000..f4c283fdf4 --- /dev/null +++ b/docker/volumes/oceanbase/init.d/vec_memory.sql @@ -0,0 +1 @@ +ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30; \ No newline at end of file