-
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.
完成 scow 对接 scowd 一期的改造,主要完成 HPC 文件和桌面相关功能改造 --------- Co-authored-by: Chen Junda <[email protected]>
- Loading branch information
1 parent
5b6af87
commit 806f778
Showing
37 changed files
with
5,943 additions
and
4,014 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,8 @@ | ||
--- | ||
"@scow/portal-server": minor | ||
"@scow/scowd-protos": minor | ||
"@scow/lib-scowd": minor | ||
"@scow/cli": minor | ||
--- | ||
|
||
增加 HPC 文件和桌面功能的 scowd 支持 |
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/config": minor | ||
--- | ||
|
||
增加 scowd 配置 |
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/grpc-api": minor | ||
--- | ||
|
||
获取配置时返回 scowd 的配置 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
import { Logger } from "ts-log"; | ||
|
||
export interface CreateDesktopRequest { | ||
loginNode: string; | ||
userId: string; | ||
wm: string; | ||
desktopName: string; | ||
} | ||
|
||
export interface CreateDesktopReply { | ||
host: string; | ||
port: number; | ||
password: string; | ||
} | ||
|
||
export interface KillDesktopRequest { | ||
loginNode: string; | ||
userId: string; | ||
displayId: number; | ||
} | ||
|
||
export interface KillDesktopReply {} | ||
|
||
export interface ConnectToDesktopRequest { | ||
loginNode: string; | ||
userId: string; | ||
displayId: number; | ||
} | ||
|
||
export interface ConnectToDesktopReply { | ||
host: string; | ||
port: number; | ||
password: string; | ||
} | ||
|
||
export interface ListUserDesktopsRequest { | ||
userId: string; | ||
loginNode: string; | ||
} | ||
|
||
export interface Desktop { | ||
displayId: number; | ||
desktopName: string; | ||
wm: string; | ||
createTime?: string; | ||
} | ||
|
||
export interface ListUserDesktopsReply { | ||
host: string; | ||
desktops: Desktop[] | ||
} | ||
|
||
export interface DesktopOps { | ||
createDesktop(req: CreateDesktopRequest, logger: Logger): Promise<CreateDesktopReply>; | ||
killDesktop(req: KillDesktopRequest, logger: Logger): Promise<KillDesktopReply>; | ||
connectToDesktop(req: ConnectToDesktopRequest, logger: Logger): Promise<ConnectToDesktopReply>; | ||
listUserDesktops(req: ListUserDesktopsRequest, logger: Logger): Promise<ListUserDesktopsReply>; | ||
} |
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,162 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
import { ReaderExtensions } from "@ddadaal/tsgrpc-common"; | ||
import { ObjectWritable } from "@grpc/grpc-js/build/src/object-stream"; | ||
import { Logger } from "ts-log"; | ||
|
||
export interface CopyRequest { | ||
userId: string; | ||
fromPath: string; | ||
toPath: string; | ||
} | ||
|
||
export interface CopyReply {} | ||
|
||
export interface MoveRequest { | ||
userId: string; | ||
fromPath: string; | ||
toPath: string; | ||
} | ||
|
||
export interface MoveReply {} | ||
|
||
export interface ExistsRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface ExistsReply { | ||
exists: boolean; | ||
} | ||
|
||
|
||
export interface CreateFileRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface CreateFileReply {} | ||
|
||
export interface DeleteDirectoryRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface DeleteDirectoryReply {} | ||
|
||
export interface DeleteFileRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface DeleteFileReply {} | ||
|
||
export interface ReadDirectoryRequest { | ||
userId: string; | ||
path: string; | ||
updateAccessTime?: boolean | ||
} | ||
|
||
export interface FileInfo { | ||
name: string; | ||
type: FileInfo_FileType; | ||
mtime: string; | ||
mode: number; | ||
size: number; | ||
} | ||
|
||
export enum FileInfo_FileType { | ||
FILE = 0, | ||
DIR = 1, | ||
} | ||
|
||
export interface ReadDirectoryReply { | ||
results: FileInfo[]; | ||
} | ||
|
||
|
||
export interface GetHomeDirectoryRequest { | ||
userId: string; | ||
} | ||
|
||
export interface GetHomeDirectoryReply { | ||
path: string; | ||
} | ||
|
||
export interface MakeDirectoryRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface MakeDirectoryReply {} | ||
|
||
export interface DownloadRequest { | ||
userId: string; | ||
path: string; | ||
call: ObjectWritable<{ chunk: Uint8Array }> | ||
} | ||
|
||
export interface DownloadReply {} | ||
|
||
interface UploadRequest_Info { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
interface UploadRequest_ReadStream { | ||
message?: { $case: "info"; info: UploadRequest_Info } | { $case: "chunk"; chunk: Uint8Array } | undefined | ||
} | ||
|
||
export interface UploadRequest { | ||
userId: string; | ||
path: string; | ||
call: ReaderExtensions<UploadRequest_ReadStream> | ||
} | ||
|
||
export interface UploadReply { | ||
writtenBytes: number; | ||
} | ||
|
||
export interface GetFileMetadataRequest { | ||
userId: string; | ||
path: string; | ||
} | ||
|
||
export interface GetFileMetadataReply { | ||
size: number; | ||
type: string; | ||
} | ||
|
||
export interface FileOps { | ||
copy(req: CopyRequest, logger: Logger): Promise<CopyReply>; | ||
move(req: MoveRequest, logger: Logger): Promise<MoveReply>; | ||
exists(req: ExistsRequest, logger: Logger): Promise<ExistsReply>; | ||
|
||
createFile(req: CreateFileRequest, logger: Logger): Promise<CreateFileReply>; | ||
deleteFile(req: DeleteFileRequest, logger: Logger): Promise<DeleteFileReply>; | ||
|
||
readDirectory(req: ReadDirectoryRequest, logger: Logger): Promise<ReadDirectoryReply>; | ||
deleteDirectory(req: DeleteDirectoryRequest, logger: Logger): Promise<DeleteDirectoryReply>; | ||
getHomeDirectory(req: GetHomeDirectoryRequest, logger: Logger): Promise<GetHomeDirectoryReply>; | ||
makeDirectory(req: MakeDirectoryRequest, logger: Logger): Promise<MakeDirectoryReply>; | ||
|
||
upload(req: UploadRequest, logger: Logger): Promise<UploadReply>; | ||
download(req: DownloadRequest, logger: Logger): Promise<DownloadReply>; | ||
|
||
getFileMetadata(req: GetFileMetadataRequest, logger: Logger): Promise<GetFileMetadataReply>; | ||
|
||
// StartFileTransfer(req: StartFileTransferRequest, logger: Logger): Promise<StartFileTransferReply>; | ||
// QueryFileTransfer(req: QueryFileTransferRequest, logger: Logger): Promise<QueryFileTransferReply>; | ||
// TerminateFileTransfer(req: TerminateFileTransferRequest, logger: Logger): Promise<TerminateFileTransferReply>; | ||
// CheckTransferKey(req: CheckTransferKeyRequest, logger: Logger): Promise<CheckTransferKeyReply>; | ||
} |
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.