【DO NOT MERGE!!!】init commit on deployment related configs(coding structure)#3
【DO NOT MERGE!!!】init commit on deployment related configs(coding structure)#3hsballoon wants to merge 7 commits into
Conversation
| database: DatabaseConfig = field(default_factory=DatabaseConfig) | ||
| execution: ExecutionConfig = field(default_factory=ExecutionConfig) | ||
| runtime: RuntimeConfig = field(default_factory=RuntimeConfig) | ||
| deployment: DeploymentConfig = field(default_factory=DeploymentConfig) |
There was a problem hiding this comment.
让全局config对象能带上新加的部署策略
|
|
||
|
|
||
| VALID_NETWORK_MODES = {"online", "offline"} | ||
| VALID_RESOURCE_TIERS = {"light", "standard", "full"} |
There was a problem hiding this comment.
定义合法值枚举类,校验的时候会用到。 如果资源配置需要改,这里也要改掉。
| return self.network_mode == "offline" | ||
|
|
||
| @property | ||
| def light_resource_tier(self) -> bool: |
There was a problem hiding this comment.
根据resource_tier自动判断资源档位。可以直接读这些 property,或者读policy.resource_tier。
如果后续资源配置改了,这里也跟着改一下。
| level: str | ||
| code: str | ||
| message: str | ||
| checker_name: str | None = None |
There was a problem hiding this comment.
用来统一表示preflight问题。 后面做network_mode / resource_tier相关的校验时安札个结构返回。
|
|
||
|
|
||
| def handle_preflight_issues( | ||
| issues: list[PreflightIssue], |
|
|
||
|
|
||
| def validate_selected_checkers( | ||
| *, |
There was a problem hiding this comment.
第二层tool run preflight的检查总入口,会对每个最终选中的checker依次调用validate_checker_network_availability和validate_checker_resource_tier_availability。
各自实现具体逻辑。
|
|
||
|
|
||
| def validate_checker_resource_tier_availability( | ||
| *, |
There was a problem hiding this comment.
在这儿做checker min tier、显式的heavy checker报错、自动策略过滤等逻辑。自己决定
| ), | ||
| strict=runtime_policy.strict_preflight, | ||
| logger=context.logger, | ||
| ) |
There was a problem hiding this comment.
执行前加了个tool run preflight校验。
用户自然语言指定checker后,最终的checker集合会在这儿被检查。offline缺模型、缺LLM endpoint等问题会在run sample前失败。
hsballoon
left a comment
There was a problem hiding this comment.
Comments added
…able this check before release)
Co-authored-by: chenbei <chenbei@pjlab.org.cn>
* add spacy model default config * add resource-tier checker preflight --------- Co-authored-by: chenbei <chenbei@pjlab.org.cn>
* enhance validation * fix agent pipeline postfix issue * refine security audit tool workflow --------- Co-authored-by: Shan He <t-shh@microsoft.com>
No description provided.