diff --git a/apps/common/config.py b/apps/common/config.py index 0f44e8aacaa0b83dbfdf421b03952576406223bc..9d2332e574fe34bce87dc69ea42eb62c57ab15f3 100644 --- a/apps/common/config.py +++ b/apps/common/config.py @@ -50,11 +50,6 @@ class ConfigModel(BaseModel): DETECT_TYPE: Optional[str] = Field(description="敏感词检测系统类型", default=None) WORDS_CHECK: Optional[str] = Field(description="AutoGPT敏感词检测系统API URL", default=None) WORDS_LIST: Optional[str] = Field(description="敏感词列表文件路径", default=None) - SCAS_APP_ID: Optional[str] = Field(description="SCAS敏感词检测系统 APP ID", default=None) - SCAS_SIGN_KEY: Optional[str] = Field(description="SCAS敏感词检测系统 请求签名密钥", default=None) - SCAS_BUSINESS_ID: Optional[str] = Field(description="SCAS敏感词检测系统 业务ID", default=None) - SCAS_SCENE_ID: Optional[str] = Field(description="SCAS敏感词检测系统 场景ID", default=None) - SCAS_URL: Optional[str] = Field(description="SCAS实例域名", default=None) # CSRF ENABLE_CSRF: bool = Field(description="是否启用CSRF Token功能", default=True) # MongoDB @@ -89,11 +84,9 @@ class ConfigModel(BaseModel): SCHEDULER_MAX_TOKENS: int = Field(description="参数猜解最大Token数", default=8192) SCHEDULER_TEMPERATURE: float = Field(description="参数猜解温度", default=0.07) # 插件位置 - PLUGIN_DIR: Optional[str] = Field(description="插件路径", default=None) + SERVICE_DIR: Optional[str] = Field(description="插件路径", default=None) # SQL接口路径 SQL_URL: str = Field(description="Chat2DB接口路径") - # Gitee白名单路径 - GITEE_WHITELIST: Optional[str] = Field(description="Gitee白名单路径") class Config: diff --git a/apps/common/oidc.py b/apps/common/oidc.py index 6b82636a16e1597c86b770a96adb8e437a04437e..cd8ab287af8e6bfb6f7194892358e2c006c6d7cc 100644 --- a/apps/common/oidc.py +++ b/apps/common/oidc.py @@ -5,11 +5,10 @@ Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. from typing import Any import aiohttp -from fastapi import HTTPException, status +from fastapi import status from apps.common.config import config from apps.constants import LOGGER -from apps.manager.gitee_white_list import GiteeIDManager from apps.models.redis import RedisConnectionPool @@ -52,8 +51,6 @@ async def get_oidc_user(access_token: str, refresh_token: str) -> dict: """获取OIDC用户""" if config["DEPLOY_MODE"] == "local": return await get_local_oidc_user(access_token, refresh_token) - if config["DEPLOY_MODE"] == "gitee": - return await get_gitee_oidc_user(access_token, refresh_token) if not access_token: err = "Access token is empty." @@ -134,32 +131,3 @@ async def get_local_oidc_user(access_token: str, refresh_token: str) -> dict: return { "user_sub": user_sub, } - - -async def get_gitee_oidc_user(access_token: str, refresh_token: str) -> dict: - """获取Gitee用户信息""" - if not access_token: - err = "Access token is empty." - raise ValueError(err) - - url = f"{config['OIDC_USER_URL']}?access_token={access_token}" - result = None - async with aiohttp.ClientSession() as session, session.get(url, timeout=10) as resp: - if resp.status != status.HTTP_200_OK: - err = f"Get OIDC user error: {resp.status}, full response is: {await resp.text()}" - raise RuntimeError(err) - LOGGER.info(f"full response is {await resp.text()}") - result = await resp.json() - - user_sub = result["login"] - if not GiteeIDManager().check_user_exist_or_not(user_sub): - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="auth error", - ) - await set_redis_token(user_sub, access_token, refresh_token) - - return { - "user_sub": user_sub, - } - diff --git a/apps/common/wordscheck.py b/apps/common/wordscheck.py index c6ae8eb79c8dd69be5423b5a7424c4526500f98e..d6c81c944e4f03faf8101462ca31988f92bb7a8f 100644 --- a/apps/common/wordscheck.py +++ b/apps/common/wordscheck.py @@ -2,19 +2,11 @@ Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. """ -import base64 -import hashlib -import hmac import http -import json import re -import uuid -from datetime import datetime -from typing import Any, Optional, Union +from typing import Union -import pytz import requests -from fastapi import status from apps.common.config import config from apps.constants import LOGGER @@ -42,155 +34,6 @@ class APICheck: LOGGER.info("过滤敏感词错误:" + str(e)) return -1 - -class SCAS: - """使用SCAS接口检查敏感词""" - - app_id: Optional[str] - sign_key: Optional[str] - business_id: Optional[str] - scene_id: Optional[str] - url: str - retry: int = 2 - timeout: int = 3 - count: int = 0 - enable: bool = True - THRESHOLD: int = 100 - - def __init__(self) -> None: - """初始化SCAS""" - self.app_id = config["SCAS_APP_ID"] - if self.app_id is None: - err = "配置文件中未设置SCAS_APP_ID" - raise ValueError(err) - - self.sign_key = config["SCAS_SIGN_KEY"] - if self.sign_key is None: - err = "配置文件中未设置SCAS_SIGN_KEY" - raise ValueError(err) - - self.business_id = config["SCAS_BUSINESS_ID"] - if self.business_id is None: - err = "配置文件中未设置SCAS_BUSINESS_ID" - raise ValueError(err) - - self.scene_id = config["SCAS_SCENE_ID"] - if self.scene_id is None: - err = "配置文件中未设置SCAS_SCENE_ID" - raise ValueError(err) - - self.url = config["SCAS_URL"] + "/scas/v1/textIdentify" - if self.url is None: - err = "配置文件中未设置SCAS_URL" - raise ValueError(err) - - def _make_auth_header(self, request: str, time: datetime) -> str: - """生成认证头""" - auth_param = 'CLOUDSOA-HMAC-SHA256 appid={}, timestamp={}, signature="{}"' - sign_format = "{}&{}&{}&{}&appid={}×tamp={}" - - current_timestamp = int(time.timestamp() * 1000) - - sign_str = sign_format.format("POST", "/scas/v1/textIdentify", "", request, - self.app_id, current_timestamp) - if self.sign_key is None: - err = "配置文件中未设置SCAS_SIGN_KEY" - raise ValueError(err) - - sign_value = base64.b64encode( - hmac.new( - bytes.fromhex(self.sign_key), - bytes(sign_str, "utf-8"), - hashlib.sha256, - ).digest()).decode("utf-8") - - return auth_param.format(self.app_id, current_timestamp, sign_value) - - def _make_request_body(self, message: str) -> tuple[dict[str, Any], str]: - """生成SCAS请求体""" - if not message: - return {}, "" - - task_id = str(uuid.uuid4()) - - current_time = datetime.now(pytz.timezone("Asia/Shanghai")) - timestamp = current_time.isoformat(sep=" ", timespec="milliseconds")[:-6] - timestamp += current_time.strftime("%z") - - post_data = { - "taskID": task_id, - "message": { - "text": message, - }, - "businessID": self.business_id, - "sceneID": self.scene_id, - "uid": "-1", - "reqTime": timestamp, - "returnCleanText": 0, - "loginType": "WEB", - } - header = self._make_auth_header(json.dumps(post_data), current_time) - - return post_data, header - - def _post_with_retry(self, post_data: dict[str, Any], header: str) -> Optional[requests.Response]: - for _ in range(self.retry): - try: - return requests.post(self.url, json=post_data, headers={ - "Content-Type": "application/json", - "Authorization": header, - }, timeout=self.timeout) - except Exception as e: # noqa: PERF203 - LOGGER.error(f"检查敏感词错误:{e!s}") - continue - return None - - def _check_message(self, message: str) -> int: # noqa: PLR0911 - """使用SCAS检查敏感词""" - # -1: 异常,0: 不通过,1: 通过 - post_data, header = self._make_request_body(message) - if not post_data and not header: - LOGGER.info("待审核信息错误") - return -1 - - req = self._post_with_retry(post_data, header) - if req is None: - LOGGER.info("风控接口调用参数错误") - return -1 - - if req.status_code != status.HTTP_200_OK: - LOGGER.info(f"风控HTTP错误:{req.status_code}") - return -1 - - return_data = req.json() - if "resultCode" not in return_data or "securityResult" not in return_data: - LOGGER.info("风控接口返回错误") - return -1 - - if return_data["resultCode"]: - LOGGER.info("风控处理错误:{}".format(return_data["resultCode"])) - return -1 - - if return_data["securityResult"] == "ACCEPT": - return 1 - return 0 - - def check(self, message: str) -> int: - """使用SCAS检查消息""" - ret = self._check_message(message) - if ret == -1: - if not self.enable: - # 放通 - return 1 - self.count += 1 - if self.count >= self.THRESHOLD: - self.enable = False - else: - self.enable = True - self.count = 0 - return ret - - class KeywordCheck: """使用关键词列表检查敏感词""" @@ -211,14 +54,12 @@ class KeywordCheck: class WordsCheck: """敏感词检查工具""" - tool: Union[APICheck, KeywordCheck, SCAS, None] = None + tool: Union[APICheck, KeywordCheck, None] = None @classmethod def init(cls) -> None: """初始化敏感词检查器""" - if config["DETECT_TYPE"] == "scas": - cls.tool = SCAS() - elif config["DETECT_TYPE"] == "keyword": + if config["DETECT_TYPE"] == "keyword": cls.tool = KeywordCheck() elif config["DETECT_TYPE"] == "wordscheck": cls.tool = APICheck() diff --git a/apps/manager/gitee_white_list.py b/apps/manager/gitee_white_list.py deleted file mode 100644 index 43ee236105e5b8fb863dd2bcca51f59a8465af4a..0000000000000000000000000000000000000000 --- a/apps/manager/gitee_white_list.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Gitee ID 白名单 Manager - -Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. -""" -import os -from pathlib import Path -from typing import ClassVar - -from apps.common.config import config -from apps.common.singleton import Singleton -from apps.constants import LOGGER - - -class GiteeIDManager(metaclass=Singleton): - """Gitee ID 白名单 Manager""" - - whitelist: ClassVar[list[str]] = [] - - def __init__(self) -> None: - """读取白名单文件""" - config_path = os.getenv("CONFIG") - if not config_path: - err = "CONFIG is not set." - raise ValueError(err) - - if not config["GITEE_WHITELIST"]: - LOGGER.warning("未设置GITEE白名单路径,不做处理。") - return - - path = Path(config_path, config["GITEE_WHITELIST"]) - with open(path, encoding="utf-8") as f: - for line in f: - line_strip = line.strip() - if not line_strip or line_strip.startswith("#"): - continue - GiteeIDManager.whitelist.append(line_strip) - - @staticmethod - def check_user_exist_or_not(gitee_id: str) -> bool: - """检查用户是否在白名单中 - - :param gitee_id: Gitee ID - :return: 是否在白名单中 - """ - return gitee_id in GiteeIDManager.whitelist diff --git a/assets/.env.example b/assets/.env.example index bae83ccf972037783bde50b6b131390dae9e8913..e8bacf378fc6828a455d7e92f6b14a1befe5c70b 100644 --- a/assets/.env.example +++ b/assets/.env.example @@ -27,11 +27,6 @@ SESSION_TTL= DETECT_TYPE= WORDS_CHECK= WORDS_LIST= -SCAS_APP_ID= -SCAS_SIGN_KEY= -SCAS_BUSINESS_ID= -SCAS_SCENE_ID= -SCAS_URL= # logging LOG= @@ -47,16 +42,6 @@ DOMAIN= JWT_KEY= PICKLE_KEY= -# 风控 -DETECT_TYPE= -WORDS_CHECK= -WORDS_LIST= -SCAS_APP_ID= -SCAS_SIGN_KEY= -SCAS_BUSINESS_ID= -SCAS_SCENE_ID= -SCAS_URL= - # CSRF ENABLE_CSRF=True @@ -85,14 +70,6 @@ HALF_KEY2= HALF_KEY3= # LLM -MODEL= -## Spark -SPARK_APP_ID= -SPARK_API_KEY= -SPARK_API_SECRET= -SPARK_API_URL= -SPARK_LLM_DOMAIN= -## OpenAI Compatible LLM_URL= LLM_KEY= LLM_MODEL_NAME= @@ -106,10 +83,7 @@ SCHEDULER_MAX_TOKENS=8192 SCHEDULER_TEMPERATURE=0.07 # 插件 -PLUGIN_DIR= +SERVICE_DIR= # SQL SQL_URL= - -# Gitee -GITEE_WHITELIST= diff --git a/deploy/chart/agents/.helmignore b/deploy/chart/agents/.helmignore new file mode 100644 index 0000000000000000000000000000000000000000..0e8a0eb36f4ca2c939201c0d54b5d82a1ea34778 --- /dev/null +++ b/deploy/chart/agents/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/chart/agents/Chart.yaml b/deploy/chart/agents/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..84e88fcb2268457b25ab8a7a9bf80edb27a26cfb --- /dev/null +++ b/deploy/chart/agents/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: euler-copilot-helm +description: Euler Copilot Helm部署包 +type: application +version: 0.9.1 +appVersion: "1.16.0" diff --git a/deploy/chart/agents/configs/ai-infra-agent/.env.yaml b/deploy/chart/agents/configs/ai-infra-agent/.env.yaml new file mode 100644 index 0000000000000000000000000000000000000000..26e477997460525c136f65be57b64334f98c6227 --- /dev/null +++ b/deploy/chart/agents/configs/ai-infra-agent/.env.yaml @@ -0,0 +1,3 @@ +# Fastapi +UVICORN_IP: 0.0.0.0 +UVICORN_PORT: 8101 \ No newline at end of file diff --git a/deploy/chart/agents/configs/rca-agent/config.json b/deploy/chart/agents/configs/rca-agent/config.json new file mode 100644 index 0000000000000000000000000000000000000000..f7df7983c9ea3121f02c1eae270273ed6ce15188 --- /dev/null +++ b/deploy/chart/agents/configs/rca-agent/config.json @@ -0,0 +1,343 @@ +{ + "profiling_config": { + "anomaly_mapping": { + "gala_gopher_container_cpu_user_seconds_total": [ + "oncpu_sample", + "oncpu" + ], + "gala_gopher_sli_container_cpu_rundelay": [ + "oncpu_sample", + "oncpu" + ], + "gala_gopher_container_cpu_system_seconds_total": [ + "oncpu_sample", + "oncpu" + ], + "gala_gopher_container_memory_working_set_bytes": [ + "mem_usage" + ], + "gala_gopher_container_memory_rss": [ + "mem_usage" + ], + "gala_gopher_container_memory_cache": [ + "mem_usage" + ], + "gala_gopher_container_memory_mapped_file": [ + "mem_usage" + ], + "gala_gopher_container_fs_reads_bytes_total": [ + "syscall_file" + ], + "gala_gopher_container_fs_read_seconds_total": [ + "syscall_file" + ], + "gala_gopher_container_fs_writes_bytes_total": [ + "syscall_file" + ], + "gala_gopher_container_fs_write_seconds_total": [ + "syscall_file" + ] + }, + "profiling_duration_mapping": { + "gala_gopher_container_cpu_user_seconds_total": 45, + "gala_gopher_sli_container_cpu_rundelay": 45, + "gala_gopher_container_cpu_system_seconds_total": 45, + "gala_gopher_container_memory_working_set_bytes": 45, + "gala_gopher_container_memory_rss": 45, + "gala_gopher_container_memory_cache": 45, + "gala_gopher_container_memory_mapped_file": 45, + "gala_gopher_container_fs_reads_bytes_total": 45, + "gala_gopher_container_fs_read_seconds_total": 45, + "gala_gopher_container_fs_writes_bytes_total": 45, + "gala_gopher_container_fs_write_seconds_total": 45 + }, + "gopher_container_id": "5e54f72e9921", + "remote_host": "192.168.10.33", + "remote_password": "bNM2RN/PvcLCDg==" + }, + "kafka": { + "server": "kafka.gala.svc.cluster.local", + "port": "9092", + "storage_topic": "usad_intermediate_results", + "anteater_result_topic": "gala_anteater_hybrid_model", + "rca_result_topic": "gala_cause_inference_test", + "meta_topic": "gala_gopher_metadata" + }, + "prometheus": { + "server": "kube-prometheus-stack-1711-prometheus.monitoring.svc.cluster.local", + "port": "9090", + "steps": 5 + }, + "elastic_search": { + "es_url": "http://10.137.17.123:9200/" + }, + "meta_graph": { + "a7d32826-2566-40f0-8cd4-feb1a925f4c0": [ + "9a571dfa-8fa3-4b08-ab8f-e86357e1c135", + "ebfde89e-5679-42c2-bc13-39f2a7c6a952" + ], + "ebfde89e-5679-42c2-bc13-39f2a7c6a952": [ + "9a571dfa-8fa3-4b08-ab8f-e86357e1c135", + "63487c96-d466-4fd7-9579-7599a73c222a", + "a7d32826-2566-40f0-8cd4-feb1a925f4c0" + ], + "63487c96-d466-4fd7-9579-7599a73c222a": [ + "9a571dfa-8fa3-4b08-ab8f-e86357e1c135", + "ebfde89e-5679-42c2-bc13-39f2a7c6a952" + ], + "6ed6ac36-3469-4ae8-a859-10256deda463": [ + "a7d32826-2566-40f0-8cd4-feb1a925f4c0", + "ebfde89e-5679-42c2-bc13-39f2a7c6a952", + "63487c96-d466-4fd7-9579-7599a73c222a" + ], + "7f47acbd-33b3-4b0c-a9bd-2d6b456d1b5b": [ + "a7d32826-2566-40f0-8cd4-feb1a925f4c0", + "ebfde89e-5679-42c2-bc13-39f2a7c6a952", + "63487c96-d466-4fd7-9579-7599a73c222a" + ], + "400024f2-15d6-4336-a725-117340f07e71": [ + "6ed6ac36-3469-4ae8-a859-10256deda463", + "7f47acbd-33b3-4b0c-a9bd-2d6b456d1b5b" + ], + "2489c586-b9d2-4759-b433-a6b4f7639389": [ + "400024f2-15d6-4336-a725-117340f07e71" + ], + "69712ca8-8e96-4a41-a84b-c693d8d79555": [ + "400024f2-15d6-4336-a725-117340f07e71" + ] + }, + "cause_root": [ + "nic", + "dns", + "container", + "sli", + "l7", + "cpu", + "disk", + "block", + "bulk", + "mem", + "tcp", + "endpoint", + "proc" + ], + "topology": { + "29a54915-7c9f-479a-9ec7-c1e2de78daf1": { + "front_end_metric": "gala_gopher_sli_rtt_nsec", + "type": "pod", + "point_to": [ + "0d25f2f2-b19b-4b24-b12e-94091ce4009c-192.168.122.18" + ] + }, + "02fa4f55-72bd-4c94-ba92-961bef614b63": { + "front_end_metric": "gala_gopher_sli_tps", + "type": "pod", + "point_to": [ + "0d25f2f2-b19b-4b24-b12e-94091ce4009c-192.168.122.18" + ] + }, + "3031c552-e6b0-43cf-9b2c-770d9c7fdfde": { + "front_end_metric": "gala_gopher_l7_latency_avg", + "type": "pod", + "point_to": [ + "9bd76d8e-25d7-43d1-adba-5230c5f7618c-192.168.122.17" + ] + }, + "e375c612-22a6-401e-928e-f076b56cdd0e": { + "front_end_metric": "gala_gopher_l7_latency_avg", + "type": "pod", + "point_to": [ + "1ea59cbc-f1e8-41a5-8684-eb04451cfefc-192.168.122.19" + ] + } + }, + "special_sli_metrics": [ + "gala_gopher_sli_rtt_nsec", + "gala_gopher_sli_tps", + "gala_gopher_l7_latency_avg", + "gala_gopher_l7_latency_sum", + "gala_gopher_l7_throughput_req", + "gala_gopher_l7_throughput_resp", + "gala_gopher_l7_err_ratio", + "gala_gopher_l7_err_count", + "gala_gopher_proc_flow_perf_tx_delay", + "gala_gopher_proc_flow_perf_rx_delay" + ], + "host_proc_mapping": { + "cpu": [ + "gala_gopher_proc_utime_jiffies", + "gala_gopher_proc_stime_jiffies", + "gala_gopher_proc_syscall_failed", + "gala_gopher_proc_sched_syscall" + ], + "mem": [ + "gala_gopher_proc_vm_size", + "gala_gopher_proc_pm_size", + "gala_gopher_proc_minor_pagefault_count", + "gala_gopher_proc_referenced_size" + ], + "disk": [ + "gala_gopher_proc_major_pagefault_count", + "gala_gopher_proc_syscr_count", + "gala_gopher_proc_syscw_count", + "gala_gopher_proc_write_bytes", + "gala_gopher_proc_read_bytes", + "gala_gopher_proc_greater_4k_io_write", + "gala_gopher_proc_less_4k_io_write", + "gala_gopher_proc_iowait_us" + ], + "nic": [ + "gala_gopher_proc_ns_sendmsg", + "gala_gopher_proc_ns_recvmsg" + ], + "tcp": [], + "fs": [ + "gala_gopher_proc_fd_count", + "gala_gopher_proc_rchar_bytes", + "gala_gopher_proc_wchar_bytes" + ] + }, + "args": { + "data_dir": "dataset", + "anomaly_topn": 10, + "smooth_window": 12, + "forward_extended_time": 480, + "backward_extended_time": 120, + "maxlag": 2, + "p_threshold": 0.05, + "front_end_metric": "kafka_topic_partition_current_offset", + "corr_type": "pearson", + "corr_prop": 0.3, + "r": 0.8, + "beta": 1, + "num_loop": 5000, + "remove_kpi": "True", + "ac_k": 3 + }, + "metrics": [ + "gala_gopher_sli_rtt_nsec", + "gala_gopher_sli_tps", + "gala_gopher_l7_latency_avg", + "gala_gopher_l7_latency_sum", + "gala_gopher_l7_throughput_req", + "gala_gopher_l7_throughput_resp", + "gala_gopher_l7_err_ratio", + "gala_gopher_l7_err_count", + "gala_gopher_proc_flow_perf_tx_delay", + "gala_gopher_proc_flow_perf_rx_delay", + "gala_gopher_block_count_latency_req", + "gala_gopher_block_latency_device_max", + "gala_gopher_block_latency_device_sum", + "gala_gopher_block_latency_driver_max", + "gala_gopher_block_latency_driver_sum", + "gala_gopher_block_latency_req_max", + "gala_gopher_block_latency_req_sum", + "gala_gopher_disk_aqu", + "gala_gopher_disk_r_await", + "gala_gopher_disk_rareq", + "gala_gopher_disk_rspeed", + "gala_gopher_disk_rspeed_kB", + "gala_gopher_disk_util", + "gala_gopher_disk_w_await", + "gala_gopher_disk_wareq", + "gala_gopher_disk_wspeed", + "gala_gopher_disk_wspeed_kB", + "gala_gopher_cpu_iowait_msec", + "gala_gopher_cpu_irq_msec", + "gala_gopher_cpu_net_rx", + "gala_gopher_cpu_rcu", + "gala_gopher_cpu_sched", + "gala_gopher_cpu_softirq_msec", + "gala_gopher_cpu_system_msec", + "gala_gopher_cpu_timer", + "gala_gopher_cpu_total_used_per", + "gala_gopher_cpu_user_msec", + "gala_gopher_mem_active_kB", + "gala_gopher_mem_cache_kB", + "gala_gopher_mem_free_kB", + "gala_gopher_mem_inactive_kB", + "gala_gopher_mem_util", + "gala_gopher_mem_dentry", + "gala_gopher_proc_bio_latency", + "gala_gopher_proc_iowait_us", + "gala_gopher_proc_bio_err_count", + "gala_gopher_proc_fd_count", + "gala_gopher_proc_fd_free_per", + "gala_gopher_proc_greater_4k_io_read", + "gala_gopher_proc_greater_4k_io_write", + "gala_gopher_proc_less_4k_io_write", + "gala_gopher_proc_less_4k_io_read", + "gala_gopher_proc_minor_pagefault_count", + "gala_gopher_proc_major_pagefault_count", + "gala_gopher_proc_rchar_bytes", + "gala_gopher_proc_read_bytes", + "gala_gopher_proc_pm_size", + "gala_gopher_proc_private_clean_size", + "gala_gopher_proc_private_dirty_size", + "gala_gopher_proc_shared_clean_size", + "gala_gopher_proc_shared_dirty_size", + "gala_gopher_proc_swap_data_size", + "gala_gopher_proc_vm_size", + "gala_gopher_proc_wchar_bytes", + "gala_gopher_proc_write_bytes", + "gala_gopher_proc_offcpu_ns", + "gala_gopher_proc_usr_cpu_ratio", + "gala_gopher_proc_sys_cpu_ratio", + "gala_gopher_tcp_link_rcv_rtt", + "gala_gopher_tcp_link_srtt", + "gala_gopher_tcp_link_retran_packets", + "gala_gopher_tcp_link_avl_snd_wnd", + "gala_gopher_tcp_link_lost_out", + "gala_gopher_tcp_link_rcv_wnd", + "gala_gopher_tcp_link_snd_cwnd", + "gala_gopher_tcp_link_snd_wnd", + "gala_gopher_tcp_link_zero_snd_wnd_count", + "gala_gopher_tcp_link_zero_rcv_wnd_count", + "gala_gopher_tcp_link_reordering", + "gala_gopher_tcp_link_sacked_out", + "gala_gopher_tcp_link_sk_drops", + "gala_gopher_tcp_link_backlog_drops", + "gala_gopher_endpoint_tcp_active_open_failed", + "gala_gopher_endpoint_tcp_passive_open_failed", + "gala_gopher_endpoint_tcp_rst_sent", + "gala_gopher_endpoint_tcp_rst_recv", + "gala_gopher_endpoint_tcp_retran_syn", + "gala_gopher_endpoint_tcp_retran_synacks", + "gala_gopher_dns_max_delay", + "gala_gopher_dns_error_ratio", + "gala_gopher_jvm_mem_bytes_used", + "gala_gopher_jvm_mem_pool_bytes_used", + "gala_gopher_jvm_buffer_pool_used_bytes", + "gala_gopher_jvm_gc_coll_secs_sum", + "gala_gopher_container_cpu_usage_seconds_total", + "gala_gopher_container_cpu_system_seconds_total", + "gala_gopher_container_cpu_user_seconds_total", + "gala_gopher_container_memory_mapped_file", + "gala_gopher_container_memory_cache", + "gala_gopher_container_memory_rss", + "gala_gopher_container_memory_working_set_bytes", + "gala_gopher_container_memory_usage_bytes", + "gala_gopher_container_fs_reads_bytes_total", + "gala_gopher_container_fs_writes_bytes_total", + "gala_gopher_container_fs_read_seconds_total", + "gala_gopher_container_fs_write_seconds_total", + "gala_gopher_container_fs_inodes_free", + "gala_gopher_container_fs_inodes_total", + "gala_gopher_nic_tx_dropped", + "gala_gopher_nic_rx_dropped", + "gala_gopher_nic_tc_enc_mark", + "gala_gopher_nic_tc_sent_drop", + "gala_gopher_jvm_info", + "gala_gopher_jvm_mem_bytes_max", + "gala_gopher_jvm_gc_coll_secs_count", + "gala_gopher_jvm_mem_bytes_commit", + "gala_gopher_jvm_mem_pool_bytes_max", + "gala_gopher_jvm_buffer_pool_capacity_bytes", + "gala_gopher_jvm_class_current_loaded", + "gala_gopher_jvm_threads_current", + "gala_gopher_block_read_bytes", + "gala_gopher_block_write_bytes", + "gala_gopher_tcp_link_notsent_bytes", + "gala_gopher_tcp_link_notack_bytes" + ] +} \ No newline at end of file diff --git a/deploy/chart/agents/configs/rca-agent/request_config.json b/deploy/chart/agents/configs/rca-agent/request_config.json new file mode 100644 index 0000000000000000000000000000000000000000..1b5339d7c6cd284624e404810c3a675340768fd4 --- /dev/null +++ b/deploy/chart/agents/configs/rca-agent/request_config.json @@ -0,0 +1,4 @@ +{ + "host": "0.0.0.0", + "port": "20030" +} \ No newline at end of file diff --git a/deploy/chart/agents/configs/tune/.env.yaml b/deploy/chart/agents/configs/tune/.env.yaml new file mode 100644 index 0000000000000000000000000000000000000000..925c1fa887bcb506f7cfa077f84b509f303daa6e --- /dev/null +++ b/deploy/chart/agents/configs/tune/.env.yaml @@ -0,0 +1,15 @@ +# Fastapi +UVICORN_IP: 0.0.0.0 +UVICORN_PORT: 8100 + +LLM_KEY: {{ .Values.agents.tune.llm.key }} +LLM_URL: {{ .Values.agents.tune.llm.url }} +LLM_MODEL_NAME: {{ .Values.agents.tune.llm.name }} +LLM_MAX_TOKENS: {{ .Values.agents.tune.llm.max_tokens }} + +# embedding +REMOTE_EMBEDDING_ENDPOINT: {{ .Values.agents.tune.embedding }} + +servers: + - ip: {{ .Values.agents.tune.machine.ip }} + password: {{ .Values.agents.tune.machine.password }} \ No newline at end of file diff --git a/deploy/chart/agents/configs/tune/app_config.yaml b/deploy/chart/agents/configs/tune/app_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..61f7ed7ecf67f0c6c911fa17680d27119a46d4fb --- /dev/null +++ b/deploy/chart/agents/configs/tune/app_config.yaml @@ -0,0 +1,3 @@ +MySQL: + user: {{ .Values.agents.tune.mysql.user }} + password: {{ .Values.agents.tune.mysql.password }} \ No newline at end of file diff --git a/deploy/chart/agents/configs/tune/knob_rag_config.json b/deploy/chart/agents/configs/tune/knob_rag_config.json new file mode 100644 index 0000000000000000000000000000000000000000..37d580487fd11c9f5ee1a5b144a8dc0d85fc1c61 --- /dev/null +++ b/deploy/chart/agents/configs/tune/knob_rag_config.json @@ -0,0 +1,4 @@ +{ + "threshold": 0.5, + "topk": 10 +} \ No newline at end of file diff --git a/deploy/chart/agents/configs/tune/optimize_config.yaml b/deploy/chart/agents/configs/tune/optimize_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..65ed37c486f28629dcf57b7fc585c351cc19eb4d --- /dev/null +++ b/deploy/chart/agents/configs/tune/optimize_config.yaml @@ -0,0 +1,3 @@ +knob_tuning : "static" +evaluations : "" +goal : "" \ No newline at end of file diff --git a/deploy/chart/agents/templates/NOTES.txt b/deploy/chart/agents/templates/NOTES.txt new file mode 100644 index 0000000000000000000000000000000000000000..5c28f225e1c3c053e36b20b50fd83d2db5b18700 --- /dev/null +++ b/deploy/chart/agents/templates/NOTES.txt @@ -0,0 +1 @@ +感谢您选择Euler Copilot! \ No newline at end of file diff --git a/deploy/chart/agents/templates/ai-infra-agent/ai-infra-deployment.yaml b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9b680c178c1394c021e02570a26920f8b03d94d0 --- /dev/null +++ b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-deployment.yaml @@ -0,0 +1,55 @@ +{{- if .Values.agents.ai_infra.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ai-infra-deploy-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app: ai-infra-{{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: ai-infra-{{ .Release.Name }} + template: + metadata: + annotations: + checksum/secret: {{ include (print $.Template.BasePath "/ai-infra-agent/ai-infra-secret.yaml") . | sha256sum }} + labels: + app: ai-infra-{{ .Release.Name }} + spec: + automountServiceAccountToken: false + containers: + - name: ai-infra + image: "{{if ne ( .Values.agents.ai_infra.image.registry | toString ) ""}}{{ .Values.agents.ai_infra.image.registry }}{{ else }}{{ .Values.globals.imageRegistry }}{{ end }}/{{ .Values.agents.ai_infra.image.name }}:{{ .Values.agents.ai_infra.image.tag | toString }}" + imagePullPolicy: {{ if ne ( .Values.agents.ai_infra.image.imagePullPolicy | toString ) "" }}{{ .Values.agents.ai_infra.image.imagePullPolicy }}{{ else }}{{ .Values.globals.imagePullPolicy }}{{ end }} + ports: + - containerPort: 8101 + protocol: TCP + env: + - name: TZ + value: Asia/Shanghai + - name: PYTHONPATH + value: /app + volumeMounts: + - mountPath: /app/config + name: ai-infra-secret-volume + securityContext: + readOnlyRootFilesystem: {{ .Values.agents.ai_infra.readOnly }} + capabilities: + drop: + - ALL + runAsUser: 1001 + runAsGroup: 1001 + runAsNonRoot: true + allowPrivilegeEscalation: false + resources: + {{- toYaml .Values.agents.ai_infra.resources | nindent 12 }} + volumes: + - name: ai-infra-secret-volume + secret: + secretName: ai-infra-secret-{{ .Release.Name }} + items: + - key: .env.yaml + path: .env.yaml +{{- end }} diff --git a/deploy/chart/agents/templates/ai-infra-agent/ai-infra-secret.yaml b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ba7c3ea75b0a4ceed7c6d1be14fb674f93ffaa6b --- /dev/null +++ b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.agents.ai_infra.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: ai-infra-secret-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +type: Opaque +stringData: + .env.yaml: | +{{ tpl (.Files.Get "configs/ai-infra-agent/.env.yaml") . | indent 4 }} +{{- end }} diff --git a/deploy/chart/agents/templates/ai-infra-agent/ai-infra-service.yaml b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..afa61529f24d21513e5187c50aa7916f816670a0 --- /dev/null +++ b/deploy/chart/agents/templates/ai-infra-agent/ai-infra-service.yaml @@ -0,0 +1,17 @@ +{{- if .Values.agents.ai_infra.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: ai-infra-service-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + type: {{ .Values.agents.ai_infra.service.type }} + selector: + app: ai-infra-{{ .Release.Name }} + ports: + - port: 8101 + targetPort: 8101 + {{- if (and (eq .Values.agents.ai_infra.service.type "") .Values.agents.ai_infra.service.nodePort) }} + nodePort: {{ .Values.agents.ai_infra.service.nodePort }} + {{- end }} +{{- end }} diff --git a/deploy/chart/agents/templates/rca-agent/rca-agent-config.yaml b/deploy/chart/agents/templates/rca-agent/rca-agent-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a2efca471c3c605e11bca9f6b22ddcf4f7214fd5 --- /dev/null +++ b/deploy/chart/agents/templates/rca-agent/rca-agent-config.yaml @@ -0,0 +1,12 @@ +{{- if .Values.agents.rca.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: rca-agent-config-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +data: + request_config.json: |- +{{ tpl (.Files.Get "configs/rca-agent/request_config.json") . | indent 4 }} + config.json: |- +{{ tpl (.Files.Get "configs/rca-agent/config.json") . | indent 4 }} +{{- end }} \ No newline at end of file diff --git a/deploy/chart/agents/templates/rca-agent/rca-agent-deployment.yaml b/deploy/chart/agents/templates/rca-agent/rca-agent-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..df41a69a21e323de3512bd3bffee9104e09789cc --- /dev/null +++ b/deploy/chart/agents/templates/rca-agent/rca-agent-deployment.yaml @@ -0,0 +1,51 @@ +{{- if .Values.agents.rca.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rca-agent-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app: rca-agent-{{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: rca-agent-{{ .Release.Name }} + template: + metadata: + labels: + app: rca-agent-{{ .Release.Name }} + spec: + automountServiceAccountToken: false + containers: + - name: rca-agent + image: "{{if ne ( .Values.agents.rca.image.registry | toString ) ""}}{{ .Values.agents.rca.image.registry }}{{ else }}{{ .Values.globals.imageRegistry }}{{ end }}/{{ .Values.agents.rca.image.name }}:{{ .Values.agents.rca.image.tag | toString }}" + imagePullPolicy: {{ if ne ( .Values.agents.rca.image.imagePullPolicy | toString ) "" }}{{ .Values.agents.rca.image.imagePullPolicy }}{{ else }}{{ .Values.globals.imagePullPolicy }}{{ end }} + ports: + - containerPort: 20030 + protocol: TCP + env: + - name: TZ + value: Asia/Shanghai + volumeMounts: + - mountPath: /var/log/gala-gopher + name: gopher-profile + - mountPath: /home/euler-copilot-rca/config/request_config.json + name: rca-config-volume + subPath: request_config.json + - mountPath: /home/euler-copilot-rca/config/config.json + name: rca-config-volume + subPath: config.json + securityContext: + readOnlyRootFilesystem: {{ .Values.agents.rca.readOnly }} + resources: + {{- toYaml .Values.agents.rca.resources | nindent 12 }} + volumes: + - name: rca-config-volume + configMap: + name: rca-agent-config-{{ .Release.Name }} + - name: gopher-profile + hostPath: + path: /var/log/gala-gopher + type: DirectoryOrCreate +{{- end }} \ No newline at end of file diff --git a/deploy/chart/agents/templates/rca-agent/rca-agent-service.yaml b/deploy/chart/agents/templates/rca-agent/rca-agent-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8cf69958e1844166496192d658708a4c22cc9776 --- /dev/null +++ b/deploy/chart/agents/templates/rca-agent/rca-agent-service.yaml @@ -0,0 +1,17 @@ +{{- if .Values.agents.rca.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: rca-agent-service-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + type: {{ .Values.agents.rca.service.type }} + selector: + app: rca-agent-{{ .Release.Name }} + ports: + - port: 20030 + targetPort: 20030 + {{- if (and (eq .Values.agents.rca.service.type "") .Values.agents.rca.service.nodePort) }} + nodePort: {{ .Values.agents.rca.service.nodePort }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/deploy/chart/agents/templates/tune/tune-deployment.yaml b/deploy/chart/agents/templates/tune/tune-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..53246440159c8190e4a072c4af3406425aa1ffe6 --- /dev/null +++ b/deploy/chart/agents/templates/tune/tune-deployment.yaml @@ -0,0 +1,52 @@ +{{- if .Values.agents.tune.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: tune-deploy-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app: tune-{{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: tune-{{ .Release.Name }} + template: + metadata: + labels: + app: tune-{{ .Release.Name }} + spec: + automountServiceAccountToken: false + containers: + - name: tune + image: "{{if ne ( .Values.agents.tune.image.registry | toString ) ""}}{{ .Values.agents.tune.image.registry }}{{ else }}{{ .Values.globals.imageRegistry }}{{ end }}/{{ .Values.agents.tune.image.name }}:{{ .Values.agents.tune.image.tag | toString }}" + imagePullPolicy: {{ if ne ( .Values.agents.tune.image.imagePullPolicy | toString ) "" }}{{ .Values.agents.tune.image.imagePullPolicy }}{{ else }}{{ .Values.globals.imagePullPolicy }}{{ end }} + ports: + - containerPort: 8100 + protocol: TCP + env: + - name: TZ + value: Asia/Shanghai + - name: PYTHONPATH + value: /app + volumeMounts: + - mountPath: /app/config + name: tune-secret-volume + securityContext: + readOnlyRootFilesystem: {{ .Values.agents.tune.readOnly }} + resources: + {{- toYaml .Values.agents.tune.resources | nindent 12 }} + volumes: + - name: tune-secret-volume + secret: + secretName: tune-secret-{{ .Release.Name }} + items: + - key: .env.yaml + path: .env.yaml + - key: app_config.yaml + path: app_config.yaml + - key: knob_rag_config.json + path: knob_rag_config.json + - key: optimize_config.yaml + path: optimize_config.yaml +{{- end }} diff --git a/deploy/chart/agents/templates/tune/tune-secret.yaml b/deploy/chart/agents/templates/tune/tune-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aced99207dfc9d97fa326ed027369882a30d9e24 --- /dev/null +++ b/deploy/chart/agents/templates/tune/tune-secret.yaml @@ -0,0 +1,17 @@ +{{- if .Values.agents.tune.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: tune-secret-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +type: Opaque +stringData: + .env.yaml: |- +{{ tpl (.Files.Get "configs/tune/.env.yaml") . | indent 4 }} + app_config.yaml: |- +{{ tpl (.Files.Get "configs/tune/app_config.yaml") . | indent 4 }} + knob_rag_config.json: |- +{{ tpl (.Files.Get "configs/tune/knob_rag_config.json") . | indent 4 }} + optimize_config.yaml: |- +{{ tpl (.Files.Get "configs/tune/optimize_config.yaml") . | indent 4 }} +{{- end }} \ No newline at end of file diff --git a/deploy/chart/agents/templates/tune/tune-service.yaml b/deploy/chart/agents/templates/tune/tune-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f2d8f7aeec9e337becb34cfea4333fd4d578db81 --- /dev/null +++ b/deploy/chart/agents/templates/tune/tune-service.yaml @@ -0,0 +1,17 @@ +{{- if .Values.agents.tune.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: tune-service-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + type: {{ .Values.agents.tune.service.type }} + selector: + app: tune-{{ .Release.Name }} + ports: + - port: 8100 + targetPort: 8100 + {{- if (and (eq .Values.agents.tune.service.type "") .Values.agents.tune.service.nodePort) }} + nodePort: {{ .Values.agents.tune.service.nodePort }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/deploy/chart/agents/values.yaml b/deploy/chart/agents/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..770c9f969445ab47ba9a915c4177c9388f6108b6 --- /dev/null +++ b/deploy/chart/agents/values.yaml @@ -0,0 +1,100 @@ +# 全局设置 +globals: + # 【必填】镜像仓库 + imageRegistry: "hub.oepkgs.net/neocopilot" + # 【必填】镜像拉取策略 + imagePullPolicy: IfNotPresent + +# OpenEuler产品Agents +agents: + ai_infra: + # 【必填】是否启用AI容器镜像Agent + enabled: true + # 镜像设置 + image: + # 镜像仓库。留空则使用全局设置。 + registry: "" + # 【必填】镜像名 + name: compatibility-ai-infra + # 【必填】镜像Tag + tag: "0.9.1" + # 拉取策略。留空则使用全局设置 + imagePullPolicy: "" + # 【必填】容器根目录只读 + readOnly: true + # 性能限制设置 + resources: {} + # Service设置 + service: + # 【必填】Service类型,ClusterIP或NodePort + type: ClusterIP + nodePort: + rca: + # 【必填】是否启用智能诊断Agent。必须配合智能诊断服务端使用。 + enabled: true + # 镜像设置 + image: + # 镜像仓库。留空则使用全局设置。 + registry: "hub.oepkgs.net/a-ops" + # 【必填】镜像名称 + name: euler-copilot-rca + # 【必填】镜像标签 + tag: "0.9.1" + # 拉取策略。留空则使用全局设置。 + imagePullPolicy: "" + # 【必填】容器根目录只读 + readOnly: true + # 性能限制设置 + resources: {} + # Service设置 + service: + # 【必填】Service类型,ClusterIP或NodePort + type: ClusterIP + nodePort: + tune: + # 【必填】是否启用智能调优Agent。 + enabled: true + # 镜像设置 + image: + # 镜像仓库。留空则使用全局设置。 + registry: "" + # 【必填】镜像名称 + name: euler-copilot-tune + # 【必填】镜像标签 + tag: "0.9.1" + # 拉取策略。留空则使用全局设置。 + imagePullPolicy: "" + # 【必填】容器根目录只读 + readOnly: true + # 性能限制设置 + resources: {} + # Service设置 + service: + # 【必填】Service类型,ClusterIP或NodePort + type: ClusterIP + nodePort: + # 大模型设置 + llm: + # 【必填】模型地址(需要包含v1后缀) + url: + # 【必填】模型名称 + name: "" + # 【必填】模型API Key + key: "" + # 【必填】模型最大Token数 + max_tokens: 8096 + # 【必填】Embedding地址 + embedding: "" + # 待优化机器信息 + machine: + # 【必填】IP地址 + ip: "" + # 【必填】Root用户密码 + # 注意:必需启用Root用户以密码形式SSH登录 + password: "" + # 待优化应用设置 + mysql: + # 【必填】数据库用户名 + user: "root" + # 【必填】数据库密码 + password: "" diff --git a/deploy/chart/euler_copilot/values.yaml b/deploy/chart/euler_copilot/values.yaml index 0f976ce117cfe98ea554132b55cf57b257f4c9b6..a2fa1e0dc4acad04caaa42196e84d286d976e956 100644 --- a/deploy/chart/euler_copilot/values.yaml +++ b/deploy/chart/euler_copilot/values.yaml @@ -121,7 +121,7 @@ euler_copilot: # Volume设置 volume: # [必填] 插件包路径 - plugin_dir: # 修改为实际的插件文件夹地址 + service_dir: # 修改为实际的插件文件夹地址 # [必填] Vectorize服务地址 vectorize: # [必填] 是否使用内部Vectorize服务 diff --git a/deploy/chart/rca/template/rca/rca-anteater/anteater-deployment.yaml b/deploy/chart/rca/template/rca/rca-anteater/anteater-deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23657ebf62eb1fc8c2c6b369421d78cd6b60fbc6 --- /dev/null +++ b/deploy/chart/rca/template/rca/rca-anteater/anteater-deployment.yaml @@ -0,0 +1,49 @@ +{{- if .Values.rca.anteater.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: anteater-deploy-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app: anteater-{{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: anteater-{{ .Release.Name }} + template: + metadata: + annotations: + checksum/secret: {{ include (print $.Template.BasePath "/rca/rca-anteater/anteater-secret.yaml") . | sha256sum }} + labels: + app: anteater-{{ .Release.Name }} + spec: + containers: + - name: anteater + image: "{{if ne ( .Values.rca.anteater.image.registry | toString ) ""}}{{ .Values.rca.anteater.image.registry }}{{ else }}{{ .Values.globals.imageRegistry }}{{ end }}/{{ .Values.rca.anteater.image.name }}:{{ .Values.rca.anteater.image.tag | toString }}" + imagePullPolicy: {{ if ne ( .Values.rca.anteater.image.imagePullPolicy | toString ) "" }}{{ .Values.rca.anteater.image.imagePullPolicy }}{{ else }}{{ .Values.globals.imagePullPolicy }}{{ end }} + ports: + - containerPort: 5210 + protocol: TCP + env: + - name: TZ + value: Asia/Shanghai + volumeMounts: + - mountPath: /etc/gala-anteater/config/log.settings.ini + name: anteater-config-volume + subPath: log.settings.ini + - mountPath: /etc/gala-anteater/config/gala-anteater.yaml + name: anteater-config-volume + subPath: gala-anteater.yaml + - mountPath: /home/llm_ops/config/config.json + name: anteater-config-volume + subPath: config.json + - mountPath: /home/gala-anteater/config/module/usad_model.job.json + name: anteater-config-volume + subPath: usad_model.job.json + restartPolicy: Always + volumes: + - name: anteater-config-volume + configMap: + name: anteater-config +{{- end }} \ No newline at end of file diff --git a/deploy/chart/rca/template/rca/rca-anteater/anteater-secret.yaml b/deploy/chart/rca/template/rca/rca-anteater/anteater-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..33a5c630aa138f1427bf45593ab54b0657e9814b --- /dev/null +++ b/deploy/chart/rca/template/rca/rca-anteater/anteater-secret.yaml @@ -0,0 +1,14 @@ +{{- if .Values.rca.anteater.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: gala-anteater-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + type: ClusterIP + selector: + app: anteater-{{ .Release.Name }} + ports: + - port: 5210 + targetPort: 5210 +{{- end }} \ No newline at end of file