-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: 接入 scowd #1193
feat: 接入 scowd #1193
Conversation
🦋 Changeset detectedLatest commit: a0b276b The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
apps/portal-server/src/config/env.ts
Outdated
@@ -30,6 +30,13 @@ export const config = envConfig({ | |||
SSH_PUBLIC_KEY_PATH: str({ desc: "SSH公钥路径", default: join(homedir(), ".ssh", "id_rsa.pub") }), | |||
|
|||
DOWNLOAD_CHUNK_SIZE: num({ desc: "grpc下载文件时,每个message中的chunk的大小。单位字节", default: 3 * 1024 * 1024 }), | |||
|
|||
SCOWD_ENABLED: bool({ desc: "是否开启 SCOWD", default: false }), |
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.
现在实际上调用的grpc service是多态的,是否启用scowd影响不同的service,但是更好的方式应该是抽象在clusterops部分,apps/portal-server/src/clusterops这里已经为job和app定义了接口,job和app部分的grpc service会调用clusterops部分的逻辑,不同的cluster可以用不同的clusterops逻辑。这样可以支持有的cluster启用了scowd,有的没有的场景
// 函数将 Code 转换为 @grpc/grpc-js 的 status | ||
export function convertCodeToGrpcStatus(code: Code): status { |
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.
这个居然connectrpc没有提供?
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.
这个翻了一下文档,只看到 转为 http 的 status code 的,没找到转为 grpc 的
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.
可以去对比一下,connect的code和grpc的code定义是一模一样的,不需要转换
export const getScowdClient = (cluster: string) => { | ||
return scowdClientForClusters[cluster]; | ||
}; |
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.
如果所有getScowdClient的调用都会在返回undefined的时候报错,可以把异常直接写在这个函数里,即使不是,也需要显式指定返回值为可能是undefined的,以免调用者忘记处理undefined的情况。
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.
考虑直接从这个函数中抛出异常
完成 scow 对接 scowd 一期的改造,主要完成 HPC 文件和桌面相关功能改造 --------- Co-authored-by: Chen Junda <[email protected]>
完成 scow 对接 scowd 一期的改造,主要完成 HPC 文件和桌面相关功能改造