Skip to content

refactor: decouple the dependency on ProcessSpec for cnative app #1726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 19, 2024

Conversation

jamesgetx
Copy link
Collaborator

@jamesgetx jamesgetx commented Nov 12, 2024

解耦云原生应用对 paas_wl 侧 ProcessSpec 等模型的依赖,改为直接从线上解析 Spec

@jamesgetx jamesgetx requested review from piglei and narasux November 12, 2024 12:30
from paasng.platform.engine.models.deployment import ProcessTmpl


def _list_proc_specs(env: ModuleEnvironment) -> List[Dict]:
"""Return all processes specs of an app
@define
Copy link
Collaborator

Choose a reason for hiding this comment

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

之前是不是讨论过 shim 模块的定位模糊,这些代码是不是不要放在 shim 里面?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已统一调整至 processes.py

procs = self.deployment.get_processes()
proc_mgr = ProcessManager(self.engine_app.env)
proc_mgr.sync_processes_specs(procs)
proc_mgr.sync_processes_probes(procs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里不能完全去除,比如 sync_processes_probes 仍然需要(刚好在改这块)

Copy link
Collaborator Author

@jamesgetx jamesgetx Nov 15, 2024

Choose a reason for hiding this comment

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

这里是处理的云原生应用,云原生应用的探针都在 ModuleProcessSpec.probes 定义, 如果有的话,应该想办法统一到 ModuleProcessSpec.probes 中。sync_processes_probes 主要是同步到 paas_wl.bk_app.processes.models.ProcessProbe 中,里面的探针仅用于普通应用

@jamesgetx jamesgetx closed this Nov 19, 2024
@jamesgetx jamesgetx reopened this Nov 19, 2024
@jamesgetx jamesgetx merged commit 4ff4374 into TencentBlueKing:main Nov 19, 2024
7 checks passed
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.

3 participants