Skip to content
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

Merged
merged 43 commits into from
Jun 18, 2024
Merged

feat: 接入 scowd #1193

merged 43 commits into from
Jun 18, 2024

Conversation

Miracle575
Copy link
Contributor

@Miracle575 Miracle575 commented Apr 2, 2024

完成 scow 对接 scowd 一期的改造,主要完成 HPC 文件和桌面相关功能改造

Copy link

changeset-bot bot commented Apr 2, 2024

🦋 Changeset detected

Latest commit: a0b276b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@scow/portal-server Minor
@scow/scowd-protos Minor
@scow/lib-scowd Minor
@scow/cli Minor
@scow/config Minor
@scow/grpc-api Minor
@scow/lib-hook Patch
@scow/lib-operation-log Patch
@scow/lib-server Patch
@scow/lib-web Patch
@scow/ai Patch
@scow/audit-server Patch
@scow/auth Minor
@scow/mis-server Minor
@scow/mis-web Minor
@scow/portal-web Minor
@scow/protos Patch
@scow/lib-scheduler-adapter Patch
@scow/gateway Minor

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

@Miracle575 Miracle575 marked this pull request as ready for review April 18, 2024 02:27
@pkuhpc-review-bot pkuhpc-review-bot bot added the Code-ReviewRequested Code Review Requested label Apr 18, 2024
apps/portal-server/src/services/scowd/desktop.ts Outdated Show resolved Hide resolved
libs/config/src/cluster.ts Outdated Show resolved Hide resolved
apps/cli/src/config/install.ts Outdated Show resolved Hide resolved
apps/portal-server/package.json Outdated Show resolved Hide resolved
@@ -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 }),
Copy link
Member

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,有的没有的场景

Comment on lines 48 to 49
// 函数将 Code 转换为 @grpc/grpc-js 的 status
export function convertCodeToGrpcStatus(code: Code): status {
Copy link
Member

Choose a reason for hiding this comment

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

这个居然connectrpc没有提供?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个翻了一下文档,只看到 转为 http 的 status code 的,没找到转为 grpc 的

Copy link
Member

Choose a reason for hiding this comment

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

可以去对比一下,connect的code和grpc的code定义是一模一样的,不需要转换

libs/config/src/cluster.ts Outdated Show resolved Hide resolved
Comment on lines 43 to 45
export const getScowdClient = (cluster: string) => {
return scowdClientForClusters[cluster];
};
Copy link
Member

Choose a reason for hiding this comment

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

如果所有getScowdClient的调用都会在返回undefined的时候报错,可以把异常直接写在这个函数里,即使不是,也需要显式指定返回值为可能是undefined的,以免调用者忘记处理undefined的情况。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

考虑直接从这个函数中抛出异常

libs/scowd/src/ssl.ts Outdated Show resolved Hide resolved
@pkuhpc-review-bot pkuhpc-review-bot bot added Code-ChangeRequested and removed Code-ReviewRequested Code Review Requested labels Apr 27, 2024
@Miracle575 Miracle575 requested a review from ddadaal April 28, 2024 09:46
@pkuhpc-review-bot pkuhpc-review-bot bot added Code-ReviewRequested Code Review Requested and removed Code-ChangeRequested labels Apr 28, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot added the E2E-ReviewRequested E2E Test requested label Jun 5, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot added Code-Approved Code Review approved and removed Code-ReviewRequested Code Review Requested labels Jun 12, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot added E2E-Approved E2E Test approved ReadyForMerge Ready for merge and removed E2E-ReviewRequested E2E Test requested labels Jun 14, 2024
@ddadaal ddadaal merged commit 806f778 into master Jun 18, 2024
9 checks passed
@ddadaal ddadaal deleted the feat-scowd branch June 18, 2024 13:29
OYX-1 pushed a commit that referenced this pull request Jul 4, 2024
完成 scow 对接 scowd 一期的改造,主要完成 HPC 文件和桌面相关功能改造

---------

Co-authored-by: Chen Junda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code-Approved Code Review approved E2E-Approved E2E Test approved ReadyForMerge Ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants