-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ai): ai 增加vnc, shell 到容器, ai提交作业优化 (#1202)
# ai 提交作业优化 1. 支持多个挂载点 2. 镜像支持手动输入 3. 已分享的镜像,数据集,以及模型,选取私有时,取privatePath而不是分享后的路径 4. 将提交作业时ai相关的参数都放入extra_options里 # ai 新增以shell 的方式进入容器的功能 ai 新增进入训练中的作业的容器并执行 shell 操作的功能。该功能依赖于 k8s 的 api server,所以需要一份 kubectl config 配置文件。 ![image](https://github.com/PKUHPC/SCOW/assets/140392039/8c01af88-ffac-41fd-9600-1658a7b6c24d) ![image](https://github.com/PKUHPC/SCOW/assets/140392039/1e9b433d-b18c-4cc1-88c1-b667f70c2070) # ai 增加 vnc Ai模块新增vnc应用 --------- Co-authored-by: Miracle575 <[email protected]>
- Loading branch information
1 parent
a4d36e2
commit e312efb
Showing
31 changed files
with
1,326 additions
and
163 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
--- | ||
"@scow/config": patch | ||
"@scow/cli": patch | ||
"@scow/ai": patch | ||
--- | ||
|
||
AI 模块支持创建 vnc 类型应用 |
This file contains 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,10 @@ | ||
--- | ||
"@scow/scheduler-adapter-protos": patch | ||
"@scow/test-adapter": patch | ||
"@scow/config": patch | ||
"@scow/cli": patch | ||
"@scow/ai": patch | ||
"@scow/docs": patch | ||
--- | ||
|
||
ai 增加 vnc 功能,以 shell 方式进入容器功能和提交作业的优化 |
This file contains 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,5 @@ | ||
--- | ||
"@scow/ai": patch | ||
--- | ||
|
||
ai 新增以 shell 的方式进入容器的功能 |
This file contains 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
//TODO | ||
#!/bin/bash | ||
|
||
export PORT=$1 | ||
export HOST=$2 | ||
export SVCPORT=$3 |
This file contains 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 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 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
94 changes: 94 additions & 0 deletions
94
apps/ai/src/app/(auth)/jobShell/[clusterId]/[jobId]/page.tsx
This file contains 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,94 @@ | ||
/** | ||
* Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy | ||
* SCOW is licensed under Mulan PSL v2. | ||
* You can use this software according to the terms and conditions of the Mulan PSL v2. | ||
* You may obtain a copy of Mulan PSL v2 at: | ||
* http://license.coscl.org.cn/MulanPSL2 | ||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | ||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
* See the Mulan PSL v2 for more details. | ||
*/ | ||
|
||
"use client"; | ||
|
||
import "xterm/css/xterm.css"; | ||
|
||
import { Button, Space } from "antd"; | ||
import dynamic from "next/dynamic"; | ||
import { usePublicConfig } from "src/app/(auth)/context"; | ||
import { Head } from "src/utils/head"; | ||
import { styled } from "styled-components"; | ||
|
||
const Container = styled.div` | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
height: 100%; | ||
width: 100%; | ||
z-index: 2000; | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const Header = styled.div` | ||
padding: 8px 16px; | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: #333; | ||
h2 { color: white; margin: 0px; } | ||
.ant-popover-content p { | ||
margin: 0; | ||
} | ||
`; | ||
|
||
|
||
const TerminalContainer = styled.div` | ||
display: flex; | ||
flex: 1; | ||
height: 100%; | ||
`; | ||
|
||
const Black = styled.div` | ||
height: 100%; | ||
background-color: black; | ||
`; | ||
|
||
const JobShellComponent = dynamic( | ||
() => import("src/components/shell/JobShell").then((x) => x.JobShell), { | ||
ssr: false, | ||
loading: Black, | ||
}); | ||
|
||
export default function Page({ params }: {params: {clusterId: string, jobId: string}}) { | ||
|
||
const { clusterId, jobId } = params; | ||
const { publicConfig, user } = usePublicConfig(); | ||
|
||
const clusterName = publicConfig.CLUSTERS.find((x) => x.id === clusterId)?.name || clusterId; | ||
|
||
return ( | ||
<Container> | ||
<Head title={`${clusterId}的终端`} /> | ||
<Header> | ||
<h2> | ||
{`用户 ${user.identityId} 连接到集群 ${clusterName} 的作业 ${jobId}`} | ||
</h2> | ||
<Space wrap> | ||
<Button onClick={() => window.location.reload()}> | ||
{"刷新并重新连接"} | ||
</Button> | ||
</Space> | ||
</Header> | ||
<TerminalContainer> | ||
<JobShellComponent | ||
user={user} | ||
cluster={clusterId} | ||
jobId={jobId} | ||
/> | ||
</TerminalContainer> | ||
</Container> | ||
); | ||
}; |
This file contains 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 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
Oops, something went wrong.