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(mis): 增加允许改变作业时限的hook: allowChangeJobTimeLimit #1229

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tongchong
Copy link
Contributor

增加改变作业时限的hook: allowChangeJobTimeLimit

功能:

当修改作业时限时,将cluster、limitMinutes、jobId、operatorUserId作为传参调用hook,可以由外部hook调用的服务来决定允许修改或者抛出错误。

Copy link

changeset-bot bot commented Apr 26, 2024

🦋 Changeset detected

Latest commit: 29199d6

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

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

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

@tongchong tongchong changed the title feat(mis): 增加改变作业时限的hook: allowChangeJobTimeLimit feat(mis): 增加允许改变作业时限的hook: allowChangeJobTimeLimit Apr 26, 2024
const { cluster, limitMinutes, jobId } = request;
const { cluster, limitMinutes, jobId, operatorUserId } = request;

await callHook("allowChangeJobTimeLimit", { cluster, limitMinutes, jobId, operatorUserId }, logger);
Copy link
Member

Choose a reason for hiding this comment

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

这个调用时机应该是改变了作业时限changeJobTimeLimit,而不是允许改变吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个hook是让外界的服务来决定是否能够修改作业时限,所以要在调用适配器之前就调用。暂时想法是外界如果有hook服务,如果 该hook正常返回,就继续执行,如果外界服务不允许更改作业时限,那将返回错误,scow这边再抛出错误

@pkuhpc-review-bot pkuhpc-review-bot bot added the Code-ReviewRequested Code Review Requested label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code-ReviewRequested Code Review Requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants