Skip to content

Commit

Permalink
feat(ai): AI 新增再次提交作业功能 (#1225)
Browse files Browse the repository at this point in the history
## 改动
AI 平台 作业提交时保存 提交参数,用户可以在作业列表点击该作业的再次提交按钮 进入创建应用或者训练页面,
获取上次提交参数后回填表单数据,用户可依据需求自己修改参数再次提交

1. 提交作业时保存参数


![image](https://github.com/PKUHPC/SCOW/assets/130351655/1c47b32e-4fb8-45b3-a1ce-9158452afd3e)


![image](https://github.com/PKUHPC/SCOW/assets/130351655/4a000669-c507-4df7-b12e-ce155ceacfe8)

2. 在正在运行作业或已完成作业中,作业操作新增 再次提交

![image](https://github.com/PKUHPC/SCOW/assets/130351655/23b6d7a1-0f3a-41b0-bb56-33f414e49b80)

3. 跳转至对应的创建应用和训练页面, 参数回填,供用户修改后再次提交新的作业

![image](https://github.com/PKUHPC/SCOW/assets/130351655/572b33e4-b672-4797-b5a6-7eff3108ed47)

---------

Co-authored-by: Miracle575 <[email protected]>
  • Loading branch information
ZihanChen821 and Miracle575 authored May 16, 2024
1 parent f534377 commit 7bcf3bb
Show file tree
Hide file tree
Showing 16 changed files with 582 additions and 125 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-flowers-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/ai": patch
---

AI 新增再次提交作业功能
1 change: 1 addition & 0 deletions apps/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"@types/url-join": "4.0.3",
"@types/ws": "8.5.10",
"@types/shell-quote": "1.7.5",
"@types/ssh2": "1.15.0",
"fs-extra": "11.2.0",
"jest-environment-jsdom": "29.7.0",
"nextjs-node-loader": "1.1.5",
Expand Down
19 changes: 19 additions & 0 deletions apps/ai/src/app/(auth)/jobs/[clusterId]/AppSessionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,25 @@ export const AppSessionsTable: React.FC<Props> = ({ cluster, status }) => {
>保存镜像</SaveImageModalButton>
) : undefined
}
<Button
type="link"
onClick={async () => {
let basePath = `/jobs/${cluster.id}`;
const searchParams = new URLSearchParams({
jobId: record.jobId.toString(),
jobName: record.sessionId,
});

if (record.jobType === JobType.APP) {
if (record.appId) {
basePath += `/createApps/${record.appId}`;
}
} else if (record.jobType === JobType.TRAIN) {
basePath += "/trainJobs";
}
router.push(`${basePath}?${searchParams.toString()}`);
}}
>再次提交</Button>
<a onClick={() => {
router.push(join("/files", cluster.id, record.dataPath));
}}
Expand Down
Loading

0 comments on commit 7bcf3bb

Please sign in to comment.