-
Notifications
You must be signed in to change notification settings - Fork 84
Add Zhizhangyi MBS service adapter #429
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
Closed
tongzhouli
wants to merge
2
commits into
chaitin:main
from
tongzhouli:add-zhizhangyi-mbs-service-clean
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { runServiceMain } from "@chaitin-ai/octobus-sdk"; | ||
|
|
||
| import { service } from "../src/service.js"; | ||
|
|
||
| runServiceMain(service); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "endpoint": { | ||
| "type": "string", | ||
| "description": "MBS REST API base URL. Example: https://mbs.example.com:9074" | ||
| }, | ||
| "baseUrl": { | ||
| "type": "string", | ||
| "description": "Legacy alias for endpoint." | ||
| }, | ||
| "skipTlsVerify": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Skip TLS certificate verification. Enable only when the target MBS endpoint uses a trusted self-signed certificate." | ||
| }, | ||
| "timeoutMs": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "default": 30000, | ||
| "description": "HTTP timeout in milliseconds." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "name": "zhizhangyi-mbs", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "files": [ | ||
| "bin/zhizhangyi-mbs.js", | ||
| "config.schema.json", | ||
| "secret.schema.json", | ||
| "service.json", | ||
| "proto", | ||
| "src" | ||
| ], | ||
| "bin": { | ||
| "zhizhangyi-mbs": "bin/zhizhangyi-mbs.js" | ||
| }, | ||
| "dependencies": { | ||
| "@chaitin-ai/octobus-sdk": "^0.5.0" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supervisor.stopProcess 未调用 state.cleanup(),可能导致 secret 临时文件泄漏
本次改动在 cleanupFailedStart 与 wait 中新增了 state.cleanup() 调用,用于清理 runtimeSecretArg 创建的 secret 资源(如 Windows ARM64 下的 secret.runtime.json)。但 stopProcess() 在发送 SIGINT/SIGKILL 并等待 state.done 超时(最多 4 秒)后直接返回,未主动调用 state.cleanup()。若进程未在超时内退出,wait() 持续阻塞,secret 临时文件不会被及时清理,敏感凭证可能残留在磁盘上;对于停止后不再重启的实例,该文件可能长期泄漏。
Problem code:
Recommendation:
在 stopProcess 等待进程退出结束后(包括超时场景),主动调用 state.cleanup() 以确保 secret 资源被释放。文件删除与管道关闭操作可安全重复执行,与 wait() 中的调用不冲突。
Suggested diff: