From 9444fdb8fdcda8199a88327d35fb506fb66e747d Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 15:48:02 +0800 Subject: [PATCH 1/9] update file --- .../templates/backend/authhub-backend.yaml | 18 ++++++++++-- .../chart/authhub/templates/mysql/mysql.yaml | 9 +++++- .../authhub/templates/web/authhub-web.yaml | 9 +++++- .../databases/templates/minio/minio.yaml | 9 +++++- .../databases/templates/mongo/mongo.yaml | 9 +++++- .../databases/templates/pgsql/pgsql.yaml | 9 +++++- .../databases/templates/redis/redis.yaml | 9 +++++- .../templates/framework/framework.yaml | 18 ++++++++++-- .../templates/rag-web/rag-web.yaml | 9 +++++- .../euler_copilot/templates/rag/rag.yaml | 18 ++++++++++-- .../euler_copilot/templates/web/web.yaml | 9 +++++- .../scripts/2-install-tools/install_tools.sh | 2 +- .../modify_eulercopilot_yaml.py | 29 +++++++++++++++++-- 13 files changed, 139 insertions(+), 18 deletions(-) diff --git a/deploy/chart/authhub/templates/backend/authhub-backend.yaml b/deploy/chart/authhub/templates/backend/authhub-backend.yaml index 4a19b4ad4..35ef89236 100644 --- a/deploy/chart/authhub/templates/backend/authhub-backend.yaml +++ b/deploy/chart/authhub/templates/backend/authhub-backend.yaml @@ -37,7 +37,14 @@ spec: automountServiceAccountToken: false containers: - name: authhub-backend - image: {{ if .Values.authhub.backend.image }}{{ .Values.authhub.backend.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/authhub:0.9.3-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.authhub.backend.image }} + {{- .Values.authhub.backend.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/authhub:0.9.3-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 11120 @@ -61,7 +68,14 @@ spec: {{ toYaml .Values.authhub.backend.resourceLimits | nindent 14 }} initContainers: - name: authhub-backend-copy-secret - image: {{ if .Values.authhub.secret_inject.image }}{{ .Values.authhub.secret_inject.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/secret_inject:dev-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.authhub.secret_inject.image }} + {{- .Values.authhub.secret_inject.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /secrets/mysql-password diff --git a/deploy/chart/authhub/templates/mysql/mysql.yaml b/deploy/chart/authhub/templates/mysql/mysql.yaml index 6ff304051..cc2c97d15 100644 --- a/deploy/chart/authhub/templates/mysql/mysql.yaml +++ b/deploy/chart/authhub/templates/mysql/mysql.yaml @@ -37,7 +37,14 @@ spec: automountServiceAccountToken: false containers: - name: mysql - image: {{ if .Values.authhub.mysql.image }}{{ .Values.authhub.mysql.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/mysql:8-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.authhub.mysql.image }} + {{- .Values.authhub.mysql.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/mysql:8-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "--character-set-server=utf8mb4" diff --git a/deploy/chart/authhub/templates/web/authhub-web.yaml b/deploy/chart/authhub/templates/web/authhub-web.yaml index 66d9e689f..cd196b2e0 100644 --- a/deploy/chart/authhub/templates/web/authhub-web.yaml +++ b/deploy/chart/authhub/templates/web/authhub-web.yaml @@ -56,7 +56,14 @@ spec: automountServiceAccountToken: false containers: - name: authhub-web - image: {{ if .Values.authhub.web.image }}{{ .Values.authhub.web.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/authhub-web:0.9.3-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.authhub.web.image }} + {{- .Values.authhub.web.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/authhub-web:0.9.3-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 8000 diff --git a/deploy/chart/databases/templates/minio/minio.yaml b/deploy/chart/databases/templates/minio/minio.yaml index 767d4daa2..62c5312fb 100644 --- a/deploy/chart/databases/templates/minio/minio.yaml +++ b/deploy/chart/databases/templates/minio/minio.yaml @@ -59,7 +59,14 @@ spec: automountServiceAccountToken: false containers: - name: minio - image: {{ if .Values.databases.minio.image }}{{ .Values.databases.minio.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/minio:empty-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.databases.minio.image }} + {{- .Values.databases.minio.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/minio:empty-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "server" diff --git a/deploy/chart/databases/templates/mongo/mongo.yaml b/deploy/chart/databases/templates/mongo/mongo.yaml index 93d2b2562..389e4d172 100644 --- a/deploy/chart/databases/templates/mongo/mongo.yaml +++ b/deploy/chart/databases/templates/mongo/mongo.yaml @@ -37,7 +37,14 @@ spec: automountServiceAccountToken: false containers: - name: mongo - image: {{ if .Values.databases.mongo.image }}{{ .Values.databases.mongo.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/mongo:7.0.16-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.databases.mongo.image }} + {{- .Values.databases.mongo.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/mongo:7.0.16-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - bash diff --git a/deploy/chart/databases/templates/pgsql/pgsql.yaml b/deploy/chart/databases/templates/pgsql/pgsql.yaml index 791e79758..dd2078c0e 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql.yaml +++ b/deploy/chart/databases/templates/pgsql/pgsql.yaml @@ -37,7 +37,14 @@ spec: automountServiceAccountToken: false containers: - name: pgsql - image: {{ if .Values.databases.pgsql.image }}{{ .Values.databases.pgsql.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/pgsql-empty:pg16-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.databases.pgsql.image }} + {{- .Values.databases.pgsql.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/pgsqle-empty:pg16-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 5432 diff --git a/deploy/chart/databases/templates/redis/redis.yaml b/deploy/chart/databases/templates/redis/redis.yaml index 6b269a6c7..6525a6259 100644 --- a/deploy/chart/databases/templates/redis/redis.yaml +++ b/deploy/chart/databases/templates/redis/redis.yaml @@ -35,7 +35,14 @@ spec: automountServiceAccountToken: false containers: - name: redis - image: {{ if .Values.databases.redis.image }}{{ .Values.databases.redis.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/redis:7.4-alpine-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.databases.redis.image }} + {{- .Values.databases.redis.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/redis:7.4-alpine-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - redis-server diff --git a/deploy/chart/euler_copilot/templates/framework/framework.yaml b/deploy/chart/euler_copilot/templates/framework/framework.yaml index 33f186284..392224f97 100644 --- a/deploy/chart/euler_copilot/templates/framework/framework.yaml +++ b/deploy/chart/euler_copilot/templates/framework/framework.yaml @@ -38,7 +38,14 @@ spec: fsGroup: 1001 containers: - name: framework - image: {{ if .Values.euler_copilot.framework.image }}{{ .Values.euler_copilot.framework.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/euler-copilot-framework:0.9.4-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.framework.image }} + {{- .Values.euler_copilot.framework.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/euler-copilot-framework:0.9.4-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 8002 @@ -80,7 +87,14 @@ spec: {{ toYaml .Values.euler_copilot.framework.resourceLimits | nindent 14 }} initContainers: - name: framework-copy - image: {{ if .Values.euler_copilot.secret_inject.image }}{{ .Values.euler_copilot.secret_inject.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/secret_inject:dev-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.secret_inject.image }} + {{- .Values.euler_copilot.secret_inject.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml index a067d4835..7e2a0b6c7 100644 --- a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml +++ b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml @@ -56,7 +56,14 @@ spec: automountServiceAccountToken: false containers: - name: rag-web - image: {{ if .Values.euler_copilot.rag_web.image }}{{ .Values.euler_copilot.rag_web.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/data_chain_web:0.9.4-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.rag_web.image }} + {{- .Values.euler_copilot.rag_web.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/data_chain_web:0.9.4-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 9888 diff --git a/deploy/chart/euler_copilot/templates/rag/rag.yaml b/deploy/chart/euler_copilot/templates/rag/rag.yaml index 756609215..5d68ef858 100644 --- a/deploy/chart/euler_copilot/templates/rag/rag.yaml +++ b/deploy/chart/euler_copilot/templates/rag/rag.yaml @@ -37,7 +37,14 @@ spec: automountServiceAccountToken: false containers: - name: rag - image: {{ if .Values.euler_copilot.rag.image }}{{ .Values.euler_copilot.rag.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/data_chain_back_end:0.9.4-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.rag.image }} + {{- .Values.euler_copilot.rag.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/data_chain_back_end:0.9.4-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 9988 @@ -64,7 +71,14 @@ spec: {{ toYaml .Values.euler_copilot.rag.resourceLimits | nindent 14 }} initContainers: - name: rag-copy-secret - image: {{ if .Values.euler_copilot.secret_inject.image }}{{ .Values.euler_copilot.secret_inject.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/secret_inject:dev-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.secret_inject.image }} + {{- .Values.euler_copilot.secret_inject.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/web/web.yaml b/deploy/chart/euler_copilot/templates/web/web.yaml index e02a99d7a..47edfcaea 100644 --- a/deploy/chart/euler_copilot/templates/web/web.yaml +++ b/deploy/chart/euler_copilot/templates/web/web.yaml @@ -57,7 +57,14 @@ spec: fsGroup: 1001 containers: - name: web - image: {{ if .Values.euler_copilot.web.image }}{{ .Values.euler_copilot.web.image }}{{ else }}{{ .Values.globals.imageRegistry | default "hub.oepkgs.net" }}/neocopilot/euler-copilot-web:0.9.4-{{ .Values.globals.arch | default "x86" }}{{ end }} + image: {{- if .Values.euler_copilot.web.image }} + {{- .Values.euler_copilot.web.image }} + {{- else }} + {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} + {{- $arch := .Values.globals.arch | default "x86" }} + {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} + {{- printf "%s/neocopilot/euler-copilot-web:0.9.4-%s" $registry $suffix }} + {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 8080 diff --git a/deploy/scripts/2-install-tools/install_tools.sh b/deploy/scripts/2-install-tools/install_tools.sh index 5d5a9acea..a1e43987a 100644 --- a/deploy/scripts/2-install-tools/install_tools.sh +++ b/deploy/scripts/2-install-tools/install_tools.sh @@ -44,7 +44,7 @@ install_basic_tools() { # 使用 pip 安装 requests echo "Installing requests with pip..." - pip install requests + pip install requests ruamel.yaml echo "All basic tools have been installed." } diff --git a/deploy/scripts/9-other-script/modify_eulercopilot_yaml.py b/deploy/scripts/9-other-script/modify_eulercopilot_yaml.py index 0f474a578..d8e70eba9 100755 --- a/deploy/scripts/9-other-script/modify_eulercopilot_yaml.py +++ b/deploy/scripts/9-other-script/modify_eulercopilot_yaml.py @@ -1,13 +1,36 @@ -import argparse import sys +import argparse +import subprocess +# 尝试导入 YAML 库 try: from ruamel.yaml import YAML from ruamel.yaml.comments import CommentedMap USING_RUAMEL = True except ImportError: - import yaml # PyYAML - USING_RUAMEL = False + try: + import yaml # 回退到 PyYAML + USING_RUAMEL = False + except ImportError: + print("未检测到 YAML 处理库,正在自动安装 ruamel.yaml...") + try: + # 优先尝试安装 ruamel.yaml + subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'ruamel.yaml']) + from ruamel.yaml import YAML + from ruamel.yaml.comments import CommentedMap + USING_RUAMEL = True + print("ruamel.yaml 安装成功") + except Exception as e: + print(f"安装 ruamel.yaml 失败: {e}, 改为尝试安装 PyYAML") + try: + # 回退安装 PyYAML + subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'PyYAML']) + import yaml + USING_RUAMEL = False + print("PyYAML 安装成功") + except Exception as e: + print(f"安装 PyYAML 也失败: {e}") + sys.exit(1) def parse_value(value): """智能转换值的类型""" -- Gitee From d65539c9345ff5525960552e6eca5228d42e0c54 Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 15:54:40 +0800 Subject: [PATCH 2/9] update file --- deploy/chart/databases/templates/pgsql/pgsql.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/chart/databases/templates/pgsql/pgsql.yaml b/deploy/chart/databases/templates/pgsql/pgsql.yaml index dd2078c0e..cc3d8d5c9 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql.yaml +++ b/deploy/chart/databases/templates/pgsql/pgsql.yaml @@ -43,7 +43,7 @@ spec: {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} {{- $arch := .Values.globals.arch | default "x86" }} {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/pgsqle-empty:pg16-%s" $registry $suffix }} + {{- printf "%s/neocopilot/pgsql-empty:pg16-%s" $registry $suffix }} {{- end }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: -- Gitee From ebd8e9afaa5acefd8a8bf6f9c189dfd0ec374db2 Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 16:04:28 +0800 Subject: [PATCH 3/9] update file --- deploy/scripts/2-install-tools/install_tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 deploy/scripts/2-install-tools/install_tools.sh diff --git a/deploy/scripts/2-install-tools/install_tools.sh b/deploy/scripts/2-install-tools/install_tools.sh old mode 100644 new mode 100755 index a1e43987a..5d5a9acea --- a/deploy/scripts/2-install-tools/install_tools.sh +++ b/deploy/scripts/2-install-tools/install_tools.sh @@ -44,7 +44,7 @@ install_basic_tools() { # 使用 pip 安装 requests echo "Installing requests with pip..." - pip install requests ruamel.yaml + pip install requests echo "All basic tools have been installed." } -- Gitee From 9750a0a1961a579a3adaa08cdd158c263efe7fba Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 18:20:40 +0800 Subject: [PATCH 4/9] update file --- .../templates/backend/authhub-backend.yaml | 18 ++---------------- .../chart/authhub/templates/mysql/mysql.yaml | 9 +-------- .../authhub/templates/web/authhub-web.yaml | 9 +-------- .../chart/databases/templates/minio/minio.yaml | 9 +-------- .../chart/databases/templates/mongo/mongo.yaml | 9 +-------- .../chart/databases/templates/pgsql/pgsql.yaml | 9 +-------- .../chart/databases/templates/redis/redis.yaml | 9 +-------- .../templates/framework/framework.yaml | 18 ++---------------- .../templates/rag-web/rag-web.yaml | 9 +-------- .../chart/euler_copilot/templates/rag/rag.yaml | 18 ++---------------- .../chart/euler_copilot/templates/web/web.yaml | 9 +-------- .../scripts/3-install-ollama/install_ollama.sh | 2 +- 12 files changed, 15 insertions(+), 113 deletions(-) diff --git a/deploy/chart/authhub/templates/backend/authhub-backend.yaml b/deploy/chart/authhub/templates/backend/authhub-backend.yaml index 35ef89236..dc1fbe789 100644 --- a/deploy/chart/authhub/templates/backend/authhub-backend.yaml +++ b/deploy/chart/authhub/templates/backend/authhub-backend.yaml @@ -37,14 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: authhub-backend - image: {{- if .Values.authhub.backend.image }} - {{- .Values.authhub.backend.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/authhub:0.9.3-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.authhub.backend.image | default (printf "%s/neocopilot/authhub:0.9.3-%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: 11120 @@ -68,14 +61,7 @@ spec: {{ toYaml .Values.authhub.backend.resourceLimits | nindent 14 }} initContainers: - name: authhub-backend-copy-secret - image: {{- if .Values.authhub.secret_inject.image }} - {{- .Values.authhub.secret_inject.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.authhub.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /secrets/mysql-password diff --git a/deploy/chart/authhub/templates/mysql/mysql.yaml b/deploy/chart/authhub/templates/mysql/mysql.yaml index cc2c97d15..ce6b73f5a 100644 --- a/deploy/chart/authhub/templates/mysql/mysql.yaml +++ b/deploy/chart/authhub/templates/mysql/mysql.yaml @@ -37,14 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: mysql - image: {{- if .Values.authhub.mysql.image }} - {{- .Values.authhub.mysql.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/mysql:8-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.authhub.mysql.image | default (printf "%s/neocopilot/mysql:8-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "--character-set-server=utf8mb4" diff --git a/deploy/chart/authhub/templates/web/authhub-web.yaml b/deploy/chart/authhub/templates/web/authhub-web.yaml index cd196b2e0..047635215 100644 --- a/deploy/chart/authhub/templates/web/authhub-web.yaml +++ b/deploy/chart/authhub/templates/web/authhub-web.yaml @@ -56,14 +56,7 @@ spec: automountServiceAccountToken: false containers: - name: authhub-web - image: {{- if .Values.authhub.web.image }} - {{- .Values.authhub.web.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/authhub-web:0.9.3-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.authhub.web.image | default (printf "%s/neocopilot/authhub-web:0.9.3-%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: 8000 diff --git a/deploy/chart/databases/templates/minio/minio.yaml b/deploy/chart/databases/templates/minio/minio.yaml index 62c5312fb..b44608a3c 100644 --- a/deploy/chart/databases/templates/minio/minio.yaml +++ b/deploy/chart/databases/templates/minio/minio.yaml @@ -59,14 +59,7 @@ spec: automountServiceAccountToken: false containers: - name: minio - image: {{- if .Values.databases.minio.image }} - {{- .Values.databases.minio.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/minio:empty-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.databases.minio.image | default (printf "%s/neocopilot/minio:empty-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "server" diff --git a/deploy/chart/databases/templates/mongo/mongo.yaml b/deploy/chart/databases/templates/mongo/mongo.yaml index 389e4d172..029189161 100644 --- a/deploy/chart/databases/templates/mongo/mongo.yaml +++ b/deploy/chart/databases/templates/mongo/mongo.yaml @@ -37,14 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: mongo - image: {{- if .Values.databases.mongo.image }} - {{- .Values.databases.mongo.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/mongo:7.0.16-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.databases.mongo.image | default (printf "%s/neocopilot/mongo:7.0.16-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - bash diff --git a/deploy/chart/databases/templates/pgsql/pgsql.yaml b/deploy/chart/databases/templates/pgsql/pgsql.yaml index cc3d8d5c9..b696b3cf4 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql.yaml +++ b/deploy/chart/databases/templates/pgsql/pgsql.yaml @@ -37,14 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: pgsql - image: {{- if .Values.databases.pgsql.image }} - {{- .Values.databases.pgsql.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/pgsql-empty:pg16-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.databases.pgsql.image | default (printf "%s/neocopilot/pgsql-empty:pgsql-%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 diff --git a/deploy/chart/databases/templates/redis/redis.yaml b/deploy/chart/databases/templates/redis/redis.yaml index 6525a6259..3ca5eef48 100644 --- a/deploy/chart/databases/templates/redis/redis.yaml +++ b/deploy/chart/databases/templates/redis/redis.yaml @@ -35,14 +35,7 @@ spec: automountServiceAccountToken: false containers: - name: redis - image: {{- if .Values.databases.redis.image }} - {{- .Values.databases.redis.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/redis:7.4-alpine-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.databases.redis.image | default (printf "%s/neocopilot/redis:7.4-alpine-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - redis-server diff --git a/deploy/chart/euler_copilot/templates/framework/framework.yaml b/deploy/chart/euler_copilot/templates/framework/framework.yaml index 392224f97..e11d86ba4 100644 --- a/deploy/chart/euler_copilot/templates/framework/framework.yaml +++ b/deploy/chart/euler_copilot/templates/framework/framework.yaml @@ -38,14 +38,7 @@ spec: fsGroup: 1001 containers: - name: framework - image: {{- if .Values.euler_copilot.framework.image }} - {{- .Values.euler_copilot.framework.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/euler-copilot-framework:0.9.4-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.framework.image | default (printf "%s/neocopilot/euler-copilot-framework:0.9.4-%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: 8002 @@ -87,14 +80,7 @@ spec: {{ toYaml .Values.euler_copilot.framework.resourceLimits | nindent 14 }} initContainers: - name: framework-copy - image: {{- if .Values.euler_copilot.secret_inject.image }} - {{- .Values.euler_copilot.secret_inject.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml index 7e2a0b6c7..b13157037 100644 --- a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml +++ b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml @@ -56,14 +56,7 @@ spec: automountServiceAccountToken: false containers: - name: rag-web - image: {{- if .Values.euler_copilot.rag_web.image }} - {{- .Values.euler_copilot.rag_web.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/data_chain_web:0.9.4-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.rag_web.image | default (printf "%s/neocopilot/data_chain_web:0.9.4-%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: 9888 diff --git a/deploy/chart/euler_copilot/templates/rag/rag.yaml b/deploy/chart/euler_copilot/templates/rag/rag.yaml index 5d68ef858..c5f4a0315 100644 --- a/deploy/chart/euler_copilot/templates/rag/rag.yaml +++ b/deploy/chart/euler_copilot/templates/rag/rag.yaml @@ -37,14 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: rag - image: {{- if .Values.euler_copilot.rag.image }} - {{- .Values.euler_copilot.rag.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/data_chain_back_end:0.9.4-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.rag.image | default (printf "%s/neocopilot/data_chain_back_end:0.9.4-%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: 9988 @@ -71,14 +64,7 @@ spec: {{ toYaml .Values.euler_copilot.rag.resourceLimits | nindent 14 }} initContainers: - name: rag-copy-secret - image: {{- if .Values.euler_copilot.secret_inject.image }} - {{- .Values.euler_copilot.secret_inject.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/secret_inject:dev-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/web/web.yaml b/deploy/chart/euler_copilot/templates/web/web.yaml index 47edfcaea..5472baf0c 100644 --- a/deploy/chart/euler_copilot/templates/web/web.yaml +++ b/deploy/chart/euler_copilot/templates/web/web.yaml @@ -57,14 +57,7 @@ spec: fsGroup: 1001 containers: - name: web - image: {{- if .Values.euler_copilot.web.image }} - {{- .Values.euler_copilot.web.image }} - {{- else }} - {{- $registry := .Values.globals.imageRegistry | default "hub.oepkgs.net" }} - {{- $arch := .Values.globals.arch | default "x86" }} - {{- $suffix := ternary "arm" "x86" (eq $arch "arm") }} - {{- printf "%s/neocopilot/euler-copilot-web:0.9.4-%s" $registry $suffix }} - {{- end }} + image: {{ .Values.euler_copilot.web.image | default (printf "%s/neocopilot/euler-copilot-web:0.9.4-%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: 8080 diff --git a/deploy/scripts/3-install-ollama/install_ollama.sh b/deploy/scripts/3-install-ollama/install_ollama.sh index 368a7adb8..0e0850d45 100755 --- a/deploy/scripts/3-install-ollama/install_ollama.sh +++ b/deploy/scripts/3-install-ollama/install_ollama.sh @@ -202,7 +202,7 @@ After=network-online.target [Service] Environment="OLLAMA_MODELS=/var/lib/ollama/.ollama/models" -Environment=1"OLLAMA_HOST=0.0.0.0:11434" +Environment="OLLAMA_HOST=0.0.0.0:11434" ExecStart=$OLLAMA_BIN_PATH serve User=ollama Group=ollama -- Gitee From d676312df9ceabcc7ff64a8921b066f4f49830cf Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 18:44:22 +0800 Subject: [PATCH 5/9] update file --- deploy/chart/databases/templates/minio/minio.yaml | 2 +- deploy/chart/databases/templates/mongo/mongo.yaml | 2 +- deploy/chart/databases/templates/pgsql/pgsql.yaml | 2 +- deploy/chart/databases/templates/redis/redis.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/chart/databases/templates/minio/minio.yaml b/deploy/chart/databases/templates/minio/minio.yaml index b44608a3c..fd2fdc80d 100644 --- a/deploy/chart/databases/templates/minio/minio.yaml +++ b/deploy/chart/databases/templates/minio/minio.yaml @@ -59,7 +59,7 @@ spec: automountServiceAccountToken: false containers: - name: minio - image: {{ .Values.databases.minio.image | default (printf "%s/neocopilot/minio:empty-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.databases.minio.image | default (printf "%s/neocopilot/minio:empty-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "server" diff --git a/deploy/chart/databases/templates/mongo/mongo.yaml b/deploy/chart/databases/templates/mongo/mongo.yaml index 029189161..ec5774b6b 100644 --- a/deploy/chart/databases/templates/mongo/mongo.yaml +++ b/deploy/chart/databases/templates/mongo/mongo.yaml @@ -37,7 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: mongo - image: {{ .Values.databases.mongo.image | default (printf "%s/neocopilot/mongo:7.0.16-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.databases.mongo.image | default (printf "%s/neocopilot/mongo:7.0.16-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - bash diff --git a/deploy/chart/databases/templates/pgsql/pgsql.yaml b/deploy/chart/databases/templates/pgsql/pgsql.yaml index b696b3cf4..3fa5eb482 100644 --- a/deploy/chart/databases/templates/pgsql/pgsql.yaml +++ b/deploy/chart/databases/templates/pgsql/pgsql.yaml @@ -37,7 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: pgsql - image: {{ .Values.databases.pgsql.image | default (printf "%s/neocopilot/pgsql-empty:pgsql-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + 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"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} ports: - containerPort: 5432 diff --git a/deploy/chart/databases/templates/redis/redis.yaml b/deploy/chart/databases/templates/redis/redis.yaml index 3ca5eef48..c9e4d6afc 100644 --- a/deploy/chart/databases/templates/redis/redis.yaml +++ b/deploy/chart/databases/templates/redis/redis.yaml @@ -35,7 +35,7 @@ spec: automountServiceAccountToken: false containers: - name: redis - image: {{ .Values.databases.redis.image | default (printf "%s/neocopilot/redis:7.4-alpine-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.databases.redis.image | default (printf "%s/neocopilot/redis:7.4-alpine-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} command: - redis-server -- Gitee From 838ba28cd1745accddd394e8c9ebdbabbfbdd51e Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 18:47:50 +0800 Subject: [PATCH 6/9] update file --- deploy/chart/authhub/templates/backend/authhub-backend.yaml | 4 ++-- deploy/chart/authhub/templates/mysql/mysql.yaml | 2 +- deploy/chart/authhub/templates/web/authhub-web.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/chart/authhub/templates/backend/authhub-backend.yaml b/deploy/chart/authhub/templates/backend/authhub-backend.yaml index dc1fbe789..54884d24b 100644 --- a/deploy/chart/authhub/templates/backend/authhub-backend.yaml +++ b/deploy/chart/authhub/templates/backend/authhub-backend.yaml @@ -37,7 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: authhub-backend - image: {{ .Values.authhub.backend.image | default (printf "%s/neocopilot/authhub:0.9.3-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.authhub.backend.image | default (printf "%s/neocopilot/authhub:0.9.3-%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: 11120 @@ -61,7 +61,7 @@ spec: {{ toYaml .Values.authhub.backend.resourceLimits | nindent 14 }} initContainers: - name: authhub-backend-copy-secret - image: {{ .Values.authhub.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.authhub.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /secrets/mysql-password diff --git a/deploy/chart/authhub/templates/mysql/mysql.yaml b/deploy/chart/authhub/templates/mysql/mysql.yaml index ce6b73f5a..f9fdc318b 100644 --- a/deploy/chart/authhub/templates/mysql/mysql.yaml +++ b/deploy/chart/authhub/templates/mysql/mysql.yaml @@ -37,7 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: mysql - image: {{ .Values.authhub.mysql.image | default (printf "%s/neocopilot/mysql:8-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.authhub.mysql.image | default (printf "%s/neocopilot/mysql:8-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} args: - "--character-set-server=utf8mb4" diff --git a/deploy/chart/authhub/templates/web/authhub-web.yaml b/deploy/chart/authhub/templates/web/authhub-web.yaml index 047635215..05ca0315e 100644 --- a/deploy/chart/authhub/templates/web/authhub-web.yaml +++ b/deploy/chart/authhub/templates/web/authhub-web.yaml @@ -56,7 +56,7 @@ spec: automountServiceAccountToken: false containers: - name: authhub-web - image: {{ .Values.authhub.web.image | default (printf "%s/neocopilot/authhub-web:0.9.3-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.authhub.web.image | default (printf "%s/neocopilot/authhub-web:0.9.3-%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: 8000 -- Gitee From 75f7f33ca8d0ad573ef0706a187c6fa859e4aab6 Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 18:49:57 +0800 Subject: [PATCH 7/9] update file --- deploy/chart/euler_copilot/templates/framework/framework.yaml | 4 ++-- deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml | 2 +- deploy/chart/euler_copilot/templates/rag/rag.yaml | 4 ++-- deploy/chart/euler_copilot/templates/web/web.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy/chart/euler_copilot/templates/framework/framework.yaml b/deploy/chart/euler_copilot/templates/framework/framework.yaml index e11d86ba4..d5687123d 100644 --- a/deploy/chart/euler_copilot/templates/framework/framework.yaml +++ b/deploy/chart/euler_copilot/templates/framework/framework.yaml @@ -38,7 +38,7 @@ spec: fsGroup: 1001 containers: - name: framework - image: {{ .Values.euler_copilot.framework.image | default (printf "%s/neocopilot/euler-copilot-framework:0.9.4-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.framework.image | default (printf "%s/neocopilot/euler-copilot-framework:0.9.4-%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: 8002 @@ -80,7 +80,7 @@ spec: {{ toYaml .Values.euler_copilot.framework.resourceLimits | nindent 14 }} initContainers: - name: framework-copy - image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml index b13157037..7dcd40c5f 100644 --- a/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml +++ b/deploy/chart/euler_copilot/templates/rag-web/rag-web.yaml @@ -56,7 +56,7 @@ spec: automountServiceAccountToken: false containers: - name: rag-web - image: {{ .Values.euler_copilot.rag_web.image | default (printf "%s/neocopilot/data_chain_web:0.9.4-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.rag_web.image | default (printf "%s/neocopilot/data_chain_web:0.9.4-%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: 9888 diff --git a/deploy/chart/euler_copilot/templates/rag/rag.yaml b/deploy/chart/euler_copilot/templates/rag/rag.yaml index c5f4a0315..75dbd6ada 100644 --- a/deploy/chart/euler_copilot/templates/rag/rag.yaml +++ b/deploy/chart/euler_copilot/templates/rag/rag.yaml @@ -37,7 +37,7 @@ spec: automountServiceAccountToken: false containers: - name: rag - image: {{ .Values.euler_copilot.rag.image | default (printf "%s/neocopilot/data_chain_back_end:0.9.4-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.rag.image | default (printf "%s/neocopilot/data_chain_back_end:0.9.4-%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: 9988 @@ -64,7 +64,7 @@ spec: {{ toYaml .Values.euler_copilot.rag.resourceLimits | nindent 14 }} initContainers: - name: rag-copy-secret - image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm"))) }} imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }} volumeMounts: - mountPath: /config/.env diff --git a/deploy/chart/euler_copilot/templates/web/web.yaml b/deploy/chart/euler_copilot/templates/web/web.yaml index 5472baf0c..d0dacc4fe 100644 --- a/deploy/chart/euler_copilot/templates/web/web.yaml +++ b/deploy/chart/euler_copilot/templates/web/web.yaml @@ -57,7 +57,7 @@ spec: fsGroup: 1001 containers: - name: web - image: {{ .Values.euler_copilot.web.image | default (printf "%s/neocopilot/euler-copilot-web:0.9.4-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (ternary "arm" "x86" (eq (.Values.globals.arch | default "x86") "arm")) }} + image: {{ .Values.euler_copilot.web.image | default (printf "%s/neocopilot/euler-copilot-web:0.9.4-%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: 8080 -- Gitee From f03fbb4f7e0996f04f29dd4293222585ed2b4573 Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 19:37:31 +0800 Subject: [PATCH 8/9] update file --- .../7-install-authhub/install_authhub.sh | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) mode change 100644 => 100755 deploy/scripts/7-install-authhub/install_authhub.sh diff --git a/deploy/scripts/7-install-authhub/install_authhub.sh b/deploy/scripts/7-install-authhub/install_authhub.sh old mode 100644 new mode 100755 index cc8412247..168ca64c8 --- a/deploy/scripts/7-install-authhub/install_authhub.sh +++ b/deploy/scripts/7-install-authhub/install_authhub.sh @@ -1,6 +1,5 @@ #!/bin/bash - set -eo pipefail RED='\033[31m' @@ -26,7 +25,8 @@ get_architecture() { return 1 ;; esac - echo -e "${GREEN}检测到系统架构:$(uname -m)${NC}" + echo -e "${GREEN}检测到系统架构:$(uname -m)${NC}" >&2 + echo "$arch" } create_namespace() { @@ -61,9 +61,9 @@ delete_pvcs() { local pvc_name pvc_name=$(kubectl get pvc -n euler-copilot | grep 'mysql-pvc' 2>/dev/null || true) - if [ -n "$pvc_list" ]; then + if [ -n "$pvc_name" ]; then echo -e "${YELLOW}找到以下PVC,开始清理...${NC}" - kubectl delete pvc mysql-pvc -n euler-copilot --force --grace-period=0 || echo -e "${RED}PVC删除失败,继续执行...${NC}" + kubectl delete pvc mysql-pvc -n euler-copilot --force --grace-period=0 || echo -e "${RED}PVC删除失败,继续执行...${NC}" else echo -e "${YELLOW}未找到需要清理的PVC${NC}" fi @@ -88,6 +88,7 @@ get_user_input() { } helm_install() { + local arch="$1" echo -e "${BLUE}==> 进入部署目录...${NC}" [ ! -d "${DEPLOY_DIR}/chart" ] && { echo -e "${RED}错误:部署目录不存在 ${DEPLOY_DIR}/chart ${NC}" @@ -140,15 +141,20 @@ check_pods_status() { } main() { - get_architecture - create_namespace - delete_pvcs - get_user_input - helm_install - check_pods_status + local arch + arch=$(get_architecture) || exit 1 + create_namespace || exit 1 + delete_pvcs || exit 1 + get_user_input || exit 1 + helm_install "$arch" || exit 1 + check_pods_status || { + echo -e "${RED}部署失败:Pod状态检查未通过!${NC}" + exit 1 + } echo -e "\n${GREEN}=========================" - echo "Authhub 部署完成!" + echo -e "Authhub 部署完成!" + echo -e "查看pod状态:kubectl get pod -n euler-copilot" echo -e "Authhub登录地址为: https://${authhub_domain}" echo -e "默认账号密码: administrator/changeme" echo -e "=========================${NC}" @@ -156,4 +162,3 @@ main() { trap 'echo -e "${RED}操作被中断!${NC}"; exit 1' INT main "$@" - -- Gitee From f00fefa03628b740cbbe22b7b6ad11022a419e74 Mon Sep 17 00:00:00 2001 From: ylzhangah <1194926515@qq.com> Date: Thu, 27 Feb 2025 20:10:22 +0800 Subject: [PATCH 9/9] update file --- .../get_client_id_and_secret.py | 81 ++++++++++++++----- 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/deploy/scripts/9-other-script/get_client_id_and_secret.py b/deploy/scripts/9-other-script/get_client_id_and_secret.py index 49644f86c..834f5a254 100755 --- a/deploy/scripts/9-other-script/get_client_id_and_secret.py +++ b/deploy/scripts/9-other-script/get_client_id_and_secret.py @@ -31,11 +31,8 @@ def get_service_cluster_ip(namespace, service_name): # 从解析后的JSON中获取Cluster IP cluster_ip = service_info['spec'].get('clusterIP', 'No Cluster IP found') - return cluster_ip - - def get_user_token(auth_hub_url, username="administrator", password="changeme"): url = auth_hub_url + "/oauth2/manager-login" payload = { @@ -45,10 +42,31 @@ def get_user_token(auth_hub_url, username="administrator", password="changeme"): headers = { "Content-Type": "application/json", } - response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False) - if response.status_code == 200: - user_token = response.json()["data"]["user_token"] - return user_token + try: + response = requests.post(url, json=payload, headers=headers, verify=False, timeout=10) + response.raise_for_status() # 触发HTTPError异常如果状态码不是2xx + response_data = response.json() + + # 检查响应结构是否包含data.user_token + if "data" in response_data and "user_token" in response_data["data"]: + return response_data["data"]["user_token"] + else: + print("错误:响应中缺少预期的数据结构") + print("完整响应内容:", json.dumps(response_data, indent=2)) + sys.exit(1) + + except requests.exceptions.HTTPError as e: + print(f"登录请求失败,HTTP状态码:{response.status_code}") + print("响应内容:", response.text) + sys.exit(1) + except json.JSONDecodeError: + print("错误:无法解析响应为JSON") + print("原始响应:", response.text) + sys.exit(1) + except Exception as e: + print(f"发生未知错误:{str(e)}") + sys.exit(1) + def register_app(auth_hub_url, user_token, client_name, client_url, redierct_urls): url = auth_hub_url + "/oauth2/applications/register" @@ -71,21 +89,34 @@ def register_app(auth_hub_url, user_token, client_name, client_url, redierct_url response = requests.post(url, json=payload, headers=headers) return response.json() - -def get_client_secret(auth_hub_url, user_token): # 修改参数列表 +def get_client_secret(auth_hub_url, user_token): url = auth_hub_url + "/oauth2/applications" headers = { "Authorization": user_token, "Content-Type": "application/json" } - response = requests.get(url, headers=headers) - for app in response.json()['data']["applications"]: - if app["client_metadata"]["client_name"] == "EulerCopilot": - return { - "client_id": app["client_info"]["client_id"], - "client_secret": app["client_info"]["client_secret"] - } - return {"error": "Application not found"} + try: + response = requests.get(url, headers=headers, timeout=10) + response.raise_for_status() + apps_data = response.json() + + # 确保响应结构正确 + if "data" in apps_data and "applications" in apps_data["data"]: + for app in apps_data["data"]["applications"]: + if app.get("client_metadata", {}).get("client_name") == "EulerCopilot": + return { + "client_id": app["client_info"]["client_id"], + "client_secret": app["client_info"]["client_secret"] + } + return {"error": "Application not found"} + else: + print("错误:应用列表响应结构异常") + print("完整响应:", json.dumps(apps_data, indent=2)) + sys.exit(1) + + except requests.exceptions.RequestException as e: + print(f"获取客户端凭证失败:{str(e)}") + sys.exit(1) if __name__ == "__main__": namespace = "euler-copilot" @@ -101,13 +132,23 @@ if __name__ == "__main__": print("2. 服务尚未分配IP(查看状态: kubectl get svc/{service_name} -n {namespace} -w)") sys.exit(1) + print("\n请填写应用注册信息(直接回车使用默认值)") + # 注册应用 + client_name = input(f"请输入 client_name (默认:EulerCopilot):").strip() or "EulerCopilot" + client_url = input(f"请输入 client_url (默认:https://www.eulercopilot.local):").strip() or "https://www.eulercopilot.local" + + redirect_input = input( + f"请输入 redirect_urls (逗号分隔,默认:https://www.eulercopilot.local/api/auth/login):" +).strip() + if redirect_input: + redirect_urls = [url.strip() for url in redirect_input.split(",")] + else: + redirect_urls = ["https://www.eulercopilot.local/api/auth/login"] + auth_hub_url = f"http://{cluster_ip}:8000" user_token = get_user_token(auth_hub_url) # 注册应用 - client_name = "EulerCopilot" - client_url = "https://www.eulercopilot.local" - redirect_urls = ["https://www.eulercopilot.local/api/auth/login"] register_app(auth_hub_url, user_token, client_name, client_url, redirect_urls) # 获取客户端凭证 -- Gitee