Skip to content

【DO NOT MERGE!!!】init commit on deployment related configs(coding structure)#3

Open
hsballoon wants to merge 7 commits into
mainfrom
addDeploymentConfig
Open

【DO NOT MERGE!!!】init commit on deployment related configs(coding structure)#3
hsballoon wants to merge 7 commits into
mainfrom
addDeploymentConfig

Conversation

@hsballoon
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread config/config_loader.py
database: DatabaseConfig = field(default_factory=DatabaseConfig)
execution: ExecutionConfig = field(default_factory=ExecutionConfig)
runtime: RuntimeConfig = field(default_factory=RuntimeConfig)
deployment: DeploymentConfig = field(default_factory=DeploymentConfig)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

让全局config对象能带上新加的部署策略

Comment thread config/runtime_policy.py


VALID_NETWORK_MODES = {"online", "offline"}
VALID_RESOURCE_TIERS = {"light", "standard", "full"}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

定义合法值枚举类,校验的时候会用到。 如果资源配置需要改,这里也要改掉。

Comment thread config/runtime_policy.py
return self.network_mode == "offline"

@property
def light_resource_tier(self) -> bool:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

根据resource_tier自动判断资源档位。可以直接读这些 property,或者读policy.resource_tier。
如果后续资源配置改了,这里也跟着改一下。

Comment thread config/runtime_policy.py
level: str
code: str
message: str
checker_name: str | None = None
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用来统一表示preflight问题。 后面做network_mode / resource_tier相关的校验时安札个结构返回。

Comment thread config/runtime_policy.py


def handle_preflight_issues(
issues: list[PreflightIssue],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

统一处理preflight结果

Comment thread tools/security_audit/policy.py Outdated


def validate_selected_checkers(
*,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第二层tool run preflight的检查总入口,会对每个最终选中的checker依次调用validate_checker_network_availability和validate_checker_resource_tier_availability。
各自实现具体逻辑。

Comment thread tools/security_audit/policy.py Outdated


def validate_checker_resource_tier_availability(
*,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这儿做checker min tier、显式的heavy checker报错、自动策略过滤等逻辑。自己决定

),
strict=runtime_policy.strict_preflight,
logger=context.logger,
)
Copy link
Copy Markdown
Collaborator Author

@hsballoon hsballoon May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

执行前加了个tool run preflight校验。
用户自然语言指定checker后,最终的checker集合会在这儿被检查。offline缺模型、缺LLM endpoint等问题会在run sample前失败。

Copy link
Copy Markdown
Collaborator Author

@hsballoon hsballoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments added

Shan He and others added 6 commits May 19, 2026 16:03
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants