diff --git a/deploy/chart/databases/templates/opengauss/opengauss-config.yaml b/deploy/chart/databases/templates/opengauss/opengauss-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cf88433f8b546a700def493013b79136766a2ac7 --- /dev/null +++ b/deploy/chart/databases/templates/opengauss/opengauss-config.yaml @@ -0,0 +1,13 @@ +{{- if .Values.databases.opengauss.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: opengauss-config + namespace: {{ .Release.Namespace }} +data: + init.sql: | + CREATE EXTENSION chparser; + CREATE TEXT SEARCH CONFIGURATION chparser (PARSER = chparser); + ALTER TEXT SEARCH CONFIGURATION chparser ADD MAPPING FOR n,v,a,i,e,l WITH simple; +{{- end -}} + diff --git a/deploy/chart/databases/templates/pgsql/pgsql-storage.yaml b/deploy/chart/databases/templates/opengauss/opengauss-storage.yaml similarity index 65% rename from deploy/chart/databases/templates/pgsql/pgsql-storage.yaml rename to deploy/chart/databases/templates/opengauss/opengauss-storage.yaml index 5b5a16a3189ad8c823811d464492b77fc6b6835b..307b464cb25b2c68e3d39ada22197ce336003467 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql-storage.yaml +++ b/deploy/chart/databases/templates/opengauss/opengauss-storage.yaml @@ -1,8 +1,8 @@ -{{- if and .Values.databases.pgsql.enabled -}} +{{- if and .Values.databases.opengauss.enabled -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: pgsql-storage + name: opengauss-storage namespace: {{ .Release.Namespace }} annotations: helm.sh/resource-policy: keep @@ -12,5 +12,6 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ default "10Gi" .Values.storage.pgsql }} -{{- end -}} \ No newline at end of file + storage: {{ default "10Gi" .Values.storage.opengauss }} +{{- end -}} + diff --git a/deploy/chart/databases/templates/pgsql/pgsql.yaml b/deploy/chart/databases/templates/opengauss/opengauss.yaml similarity index 54% rename from deploy/chart/databases/templates/pgsql/pgsql.yaml rename to deploy/chart/databases/templates/opengauss/opengauss.yaml index 3fa5eb482aeb0dfadf7af1fbcd1396121a2177b8..bff1c4f722428d76ec6526453497b4d3f1f3bcc0 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql.yaml +++ b/deploy/chart/databases/templates/opengauss/opengauss.yaml @@ -1,43 +1,43 @@ -{{- if .Values.databases.pgsql.enabled -}} +{{- if .Values.databases.opengauss.enabled -}} --- apiVersion: v1 kind: Service metadata: - name: pgsql-db + name: opengauss-db namespace: {{ .Release.Namespace }} spec: - type: {{ default "ClusterIP" .Values.databases.pgsql.service.type }} + type: {{ default "ClusterIP" .Values.databases.opengauss.service.type }} selector: - app: pgsql + app: opengauss ports: - port: 5432 targetPort: 5432 - nodePort: {{ default nil .Values.databases.pgsql.service.nodePort }} + nodePort: {{ default nil .Values.databases.opengauss.service.nodePort }} --- apiVersion: apps/v1 kind: Deployment metadata: - name: pgsql-deploy + name: opengauss-deploy namespace: {{ .Release.Namespace }} labels: - app: pgsql + app: opengauss spec: replicas: {{ default 1 .Values.globals.replicaCount }} selector: matchLabels: - app: pgsql + app: opengauss template: metadata: annotations: - checksum/config: {{ include (print $.Template.BasePath "/pgsql/pgsql-config.yaml") . | sha256sum }} + checksum/config: {{ include (print $.Template.BasePath "/opengauss/opengauss-config.yaml") . | sha256sum }} labels: - app: pgsql + app: opengauss spec: automountServiceAccountToken: false containers: - - name: pgsql - image: {{ .Values.databases.pgsql.image | default (printf "%s/neocopilot/pgsql-empty:pg16-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} + - name: opengauss + image: image: {{ .Values.databases.opengauss.image | default (printf "%s/neocopilot/opengauss:latest-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 5432 @@ -45,6 +45,7 @@ spec: livenessProbe: exec: command: + - gs_guc reload -D /var/lib/opengauss/data -c "behavior_compat_options='accept_empty_str'" - pg_isready - -d postgres -U postgres failureThreshold: 5 @@ -53,32 +54,33 @@ spec: env: - name: TZ value: "Asia/Shanghai" - - name: POSTGRES_DB + - name: GS_DB value: "postgres" - - name: POSTGRES_USER + - name: GS_USERNAME value: "postgres" - - name: POSTGRES_PASSWORD + - name: GS_PASSWORD valueFrom: secretKeyRef: name: euler-copilot-database - key: pgsql-password + key: gauss-password volumeMounts: - - mountPath: /var/lib/postgresql/data - name: pgsql-data + - mountPath: /var/lib/opengauss/data + name: opengauss-data - mountPath: /docker-entrypoint-initdb.d/init.sql - name: pgsql-init + name: opengauss-init subPath: init.sql resources: requests: cpu: 0.25 memory: 512Mi limits: - {{ toYaml .Values.databases.pgsql.resourceLimits | nindent 14 }} + {{ toYaml .Values.databases.opengauss.resourceLimits | indent 4 | trim }} volumes: - - name: pgsql-data + - name: opengauss-data persistentVolumeClaim: - claimName: pgsql-storage - - name: pgsql-init + claimName: opengauss-storage + - name: opengauss-init configMap: - name: pgsql-config + name: opengauss-config {{- end -}} + diff --git a/deploy/chart/databases/templates/pgsql/pgsql-config.yaml b/deploy/chart/databases/templates/pgsql/pgsql-config.yaml deleted file mode 100644 index 1f73664cdb897d645ab157be4e5b94cbb3a36f6e..0000000000000000000000000000000000000000 --- a/deploy/chart/databases/templates/pgsql/pgsql-config.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.databases.pgsql.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: pgsql-config - namespace: {{ .Release.Namespace }} -data: - init.sql: | - CREATE EXTENSION zhparser; - CREATE EXTENSION vector; - CREATE TEXT SEARCH CONFIGURATION zhparser (PARSER = zhparser); - ALTER TEXT SEARCH CONFIGURATION zhparser ADD MAPPING FOR n,v,a,i,e,l WITH simple; -{{- end -}} \ No newline at end of file diff --git a/deploy/chart/databases/templates/secrets.yaml b/deploy/chart/databases/templates/secrets.yaml index e2a4a071a87678b81b18c9e530f7707d24ba4ae2..ca75233ee6deb315dd2f051bc103a4baafd55772 100644 --- a/deploy/chart/databases/templates/secrets.yaml +++ b/deploy/chart/databases/templates/secrets.yaml @@ -12,7 +12,7 @@ stringData: redis-password: {{ index $databaseSecret.data "redis-password" | b64dec }} mongo-password: {{ index $databaseSecret.data "mongo-password" | b64dec }} minio-password: {{ index $databaseSecret.data "minio-password" | b64dec }} - pgsql-password: {{ index $databaseSecret.data "pgsql-password" | b64dec }} + gauss-password: "Huawei12#$" {{- else -}} apiVersion: v1 kind: Secret @@ -26,5 +26,5 @@ stringData: redis-password: {{ randAlphaNum 20 }} mongo-password: {{ randAlphaNum 20 }} minio-password: {{ randAlphaNum 20 }} - pgsql-password: {{ randAlphaNum 20 }} + gauss-password: "Huawei12#$" {{- end -}} diff --git a/deploy/chart/databases/values.yaml b/deploy/chart/databases/values.yaml index 6546e8bd7d34e966ff51dd61276793526ce75be7..4a0973cdae19a32151d3d77611db5a3d9633c264 100644 --- a/deploy/chart/databases/values.yaml +++ b/deploy/chart/databases/values.yaml @@ -17,7 +17,7 @@ storage: # MongoDB存储大小,默认为10GB mongo: # 向量数据库存储大小,默认为10GB - pgsql: + opengauss: # 域名设置 domain: @@ -75,11 +75,11 @@ databases: type: # 当类型为nodePort时,填写主机的端口号 nodePort: - pgsql: + opengauss: # [必填] 是否部署PostgreSQL实例 enabled: true - # 镜像设置,默认为hub.oepkgs.net/neocopilot/pgsql-empty:pg16-x86 - # 镜像版本: ["pg16-x86", "pg16-arm"] + # 镜像设置,默认为hub.oepkgs.net/neocopilot/opengauss:latest-x86 + # 镜像版本: ["latest-x86", "latest-arm"] image: # 性能限制设置 resourceLimits: {} diff --git a/deploy/chart/euler_copilot/configs/framework/config.toml b/deploy/chart/euler_copilot/configs/framework/config.toml index 69eacc8d6cee0d5eb544e511a29194cc83397c82..0e43bcbe6918cf37d2d6d91a56212997156c2a54 100644 --- a/deploy/chart/euler_copilot/configs/framework/config.toml +++ b/deploy/chart/euler_copilot/configs/framework/config.toml @@ -54,10 +54,10 @@ temperature = {{ default 0.7 .Values.models.answer.temperature }} [function_call] backend = '{{ default "ollama" .Values.models.functionCall.backend }}' -endpoint = '{{ .Values.models.functionCall.endpoint }}' -model = '{{ .Values.models.functionCall.model }}' -api_key = '{{ .Values.models.functionCall.key }}' -max_tokens = {{ default .Values.models.answer.maxTokens .Values.models.functionCall.maxTokens }} +endpoint = '{{ default .Values.models.answer.endpoint .Values.models.functionCall.endpoint }}' +model = '{{ default .Values.models.answer.name .Values.models.functionCall.name }}' +api_key = '{{ default .Values.models.answer.key .Values.models.functionCall.key }}' +max_tokens = '{{ default .Values.models.answer.maxTokens .Values.models.functionCall.maxTokens }}' temperature = {{ default 0.7 .Values.models.functionCall.temperature }} [check] diff --git a/deploy/chart/euler_copilot/configs/rag/.env b/deploy/chart/euler_copilot/configs/rag/.env index f7520d576bb3671ef388aba00817ddada78fee61..f9e46601d457e432a1ecb73bade930175bb24b88 100644 --- a/deploy/chart/euler_copilot/configs/rag/.env +++ b/deploy/chart/euler_copilot/configs/rag/.env @@ -6,8 +6,9 @@ SSL_KEYFILE= SSL_ENABLE=false LOG_METHOD=stdout -# Postgres -DATABASE_URL=postgresql+asyncpg://postgres:${pgsql-password}@pgsql-db.{{ .Release.Namespace }}.svc.cluster.local:5432/postgres +# opengauss +DATABASE_TYPE=opengauss +DATABASE_URL=opengauss+asyncpg://postgres:${gauss-password}@opengauss-db.{{ .Release.Namespace }}.svc.cluster.local:5432/postgres # MinIO MINIO_ENDPOINT=minio-service.{{ .Release.Namespace }}.svc.cluster.local:9000 diff --git a/deploy/scripts/6-install-databases/install_databases.sh b/deploy/scripts/6-install-databases/install_databases.sh index 81435e4100a044c66b551851a0d32d0f4a93354d..5f9c4a2efc76d59bbf462d94e436d555f0b295e9 100755 --- a/deploy/scripts/6-install-databases/install_databases.sh +++ b/deploy/scripts/6-install-databases/install_databases.sh @@ -72,7 +72,7 @@ uninstall_databases() { local pvc_list pvc_list=$(kubectl get pvc -n euler-copilot -o jsonpath='{.items[*].metadata.name}' 2>/dev/null \ | tr ' ' '\n' \ - | grep -E '^(pgsql-storage|mongo-storage|minio-storage)$' || true) # 精确匹配三个指定名称 + | grep -E '^(opengauss-storage|mongo-storage|minio-storage)$' || true) # 精确匹配三个指定名称 if [ -n "$pvc_list" ]; then echo -e "${YELLOW}找到以下PVC,开始清理...${NC}" diff --git a/deploy/scripts/9-other-script/import_images.sh b/deploy/scripts/9-other-script/import_images.sh index ed76552f49eaa14a2c4a482c2474426a6433eef4..ee801c42a7078a49c6bf70cfb59f0ca0fccd71f7 100755 --- a/deploy/scripts/9-other-script/import_images.sh +++ b/deploy/scripts/9-other-script/import_images.sh @@ -168,7 +168,7 @@ check_images() { "hub.oepkgs.net/neocopilot/data_chain_web:${version}-arm" "hub.oepkgs.net/neocopilot/authhub:0.9.3-arm" "hub.oepkgs.net/neocopilot/authhub-web:0.9.3-arm" - "hub.oepkgs.net/neocopilot/pgsql-empty:pg16-arm" + "hub.oepkgs.net/neocopilot/opengauss:latest-arm" "hub.oepkgs.net/neocopilot/redis:7.4-alpine-arm" "hub.oepkgs.net/neocopilot/mysql:8-arm" "hub.oepkgs.net/neocopilot/minio:empty-arm" diff --git a/deploy/scripts/9-other-script/save_images.sh b/deploy/scripts/9-other-script/save_images.sh index 09cadd8f696f9a05b2b8f4645037df90bcf5302d..d65d719092aad45eb5810efdc98f7526c9d60f51 100755 --- a/deploy/scripts/9-other-script/save_images.sh +++ b/deploy/scripts/9-other-script/save_images.sh @@ -28,7 +28,7 @@ BASE_IMAGES=( "hub.oepkgs.net/neocopilot/data_chain_web:${eulercopilot_version}-arm" "hub.oepkgs.net/neocopilot/authhub:0.9.3-arm" "hub.oepkgs.net/neocopilot/authhub-web:0.9.3-arm" - "hub.oepkgs.net/neocopilot/pgsql-empty:pg16-arm" + "hub.oepkgs.net/neocopilot/opengauss:latest-arm" "hub.oepkgs.net/neocopilot/redis:7.4-alpine-arm" "hub.oepkgs.net/neocopilot/mysql:8-arm" "hub.oepkgs.net/neocopilot/minio:empty-arm" @@ -44,7 +44,7 @@ FILE_NAMES=( "data_chain_web.tar" "authhub.tar" "authhub-web.tar" - "pgsql-empty.tar" + "opengauss.tar" "redis.tar" "mysql.tar" "minio.tar" diff --git a/deploy/scripts/deploy.sh b/deploy/scripts/deploy.sh index a22fb62defc1f90cb86cc059e0908179aa8275e9..1b4d69ceeb404832455fd792d2a39dbb05f2e94b 100755 --- a/deploy/scripts/deploy.sh +++ b/deploy/scripts/deploy.sh @@ -47,7 +47,7 @@ show_restart_menu() { echo "4) minio" echo "5) mongo" echo "6) mysql" - echo "7) pgsql" + echo "7) opengauss" echo "8) rag" echo "9) rag-web" echo "10) redis" @@ -294,7 +294,7 @@ while true; do 4) service="minio" ;; 5) service="mongo" ;; 6) service="mysql" ;; - 7) service="pgsql" ;; + 7) service="opengauss" ;; 8) service="rag" ;; 9) service="rag-web" ;; 10) service="redis" ;; diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/pictures/\351\203\250\347\275\262\350\247\206\345\233\276.png" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/pictures/\351\203\250\347\275\262\350\247\206\345\233\276.png" index 181bf1d2ddbe15cfd296c27df27d865bdbce8d69..ef8da73fe614ab57c4098f72bfc142cd06e16756 100644 Binary files "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/pictures/\351\203\250\347\275\262\350\247\206\345\233\276.png" and "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/pictures/\351\203\250\347\275\262\350\247\206\345\233\276.png" differ diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index f311f6075a22b19642bcc96eaff86663d98ca58a..5f47ee739070a8f5462b01c6cbec4839a8c3d1c5 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -20,10 +20,10 @@ EulerCopilot 是一款智能问答工具,使用 EulerCopilot 可以解决操 | authhub-backend-service | 11120 (内部端口) | 鉴权服务后端 | | authhub-web-service | 8000 | 鉴权服务前端 | | mysql | 3306 (内部端口) | MySQL数据库 | -| redis | 6379 (内部端口) | Redis数据库 | -| minio | 9000 (内部端口) 9001(外部部端口) | minio数据库 | +| redis | 6379 (内部端口) | Redis数据缓存 | +| minio | 9000 (内部端口) 9001(外部部端口) | minio对象存储库 | | mongo | 27017 (内部端口) | mongo数据库 | -| postgres | 5432 (内部端口) | 向量数据库 | +| openGauss | 5432 (内部端口) | 向量数据库 | | secret_inject | 无 | 配置文件安全复制工具 | ### 软件要求 @@ -82,7 +82,7 @@ EulerCopilot 是一款智能问答工具,使用 EulerCopilot 可以解决操 | 类型 | 资源文件/说明 | |------------|--------------| -| **镜像文件** | `hub.oepkgs.net/neocopilot/euler-copilot-framework:0.9.5-x86`
`hub.oepkgs.net/neocopilot/euler-copilot-web:0.9.5-x86`
`hub.oepkgs.net/neocopilot/data_chain_back_end:0.9.5-x86`
`hub.oepkgs.net/neocopilot/data_chain_web:0.9.5-x86`
`hub.oepkgs.net/neocopilot/authhub:0.9.3-x86`
`hub.oepkgs.net/neocopilot/authhub-web:0.9.3-x86`
`hub.oepkgs.net/neocopilot/pgsql-empty:pg16-x86`
`hub.oepkgs.net/neocopilot/redis:7.4-alpine-x86`
`hub.oepkgs.net/neocopilot/mysql:8-x86`
`hub.oepkgs.net/neocopilot/minio:empty-x86`
`hub.oepkgs.net/neocopilot/mongo:7.0.16-x86`
`hub.oepkgs.net/neocopilot/secret_inject:dev-x86`
| +| **镜像文件** | `hub.oepkgs.net/neocopilot/euler-copilot-framework:0.9.5-x86`
`hub.oepkgs.net/neocopilot/euler-copilot-web:0.9.5-x86`
`hub.oepkgs.net/neocopilot/data_chain_back_end:0.9.5-x86`
`hub.oepkgs.net/neocopilot/data_chain_web:0.9.5-x86`
`hub.oepkgs.net/neocopilot/authhub:0.9.3-x86`
`hub.oepkgs.net/neocopilot/authhub-web:0.9.3-x86`
`hub.oepkgs.net/neocopilot/opengauss:latest-x86`
`hub.oepkgs.net/neocopilot/redis:7.4-alpine-x86`
`hub.oepkgs.net/neocopilot/mysql:8-x86`
`hub.oepkgs.net/neocopilot/minio:empty-x86`
`hub.oepkgs.net/neocopilot/mongo:7.0.16-x86`
`hub.oepkgs.net/neocopilot/secret_inject:dev-x86`
| | **模型文件** | `bge-m3-Q4_K_M.gguf`
`deepseek-llm-7b-chat-Q4_K_M.gguf`
| | **工具包** | `helm-v3.15.0-linux-{arm64/amd64}.tar.gz`
`k3s-airgap-images-{arm64/amd64}.tar.zst`
`k3s-{arm64/amd64}`
`k3s-install.sh`
`ollama-linux-{arm64/amd64}.tgz` | @@ -184,7 +184,7 @@ bash deploy.sh 4) minio 5) mongo 6) mysql -7) pgsql +7) opengauss 8) rag 9) rag-web 10) redis diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index 61a847ada9a1dbea6d311e56c7a4f6797b8564de..77d9c469013f767fe14274614939a949b56a2637 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -2,7 +2,7 @@ 版本信息 当前版本:v0.9.5 -更新日期:2025年4月1日 +更新日期:2025年4月25日 ## 产品概述 @@ -19,11 +19,10 @@ EulerCopilot 是一款智能问答工具,使用 EulerCopilot 可以解决操 | euler-copilot-rag | 9988 (内部端口) | 检索增强服务 | | authhub-backend-service | 11120 (内部端口) | 鉴权服务后端 | | authhub-web-service | 8000 | 鉴权服务前端 | -| mysql | 3306 (内部端口) | MySQL数据库 | -| redis | 6379 (内部端口) | Redis数据库 | -| minio | 9000 (内部端口) 9001(外部部端口) | minio数据库 | -| mongo | 27017 (内部端口) | mongo数据库 | -| postgres | 5432 (内部端口) | 向量数据库 | +| redis | 6379 (内部端口) | Redis数据缓存 | +| minio | 9000 (内部端口) 9001(外部部端口) | minio对象存储 | +| mongo | 27017 (内部端口) | mongo数据库 | +| openGauss | 5432 (内部端口) | 向量数据库 | | secret_inject | 无 | 配置文件安全复制工具 | ### 软件要求 @@ -155,7 +154,7 @@ bash deploy.sh 4) minio 5) mongo 6) mysql -7) pgsql +7) opengauss 8) rag 9) rag-web 10) redis