@milabench/bujang 0.0.0-stage → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -2
- package/dist/api.d.ts +151 -0
- package/dist/components/AutocompleteInput.d.ts +15 -0
- package/dist/components/MonacoEditor.d.ts +11 -0
- package/dist/components/toaster.d.ts +2 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/constants.d.ts +3 -0
- package/dist/context.d.ts +44 -0
- package/dist/hooks/useColorMode.d.ts +4 -0
- package/dist/hooks/usePageTitle.d.ts +2 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +5036 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +26 -0
- package/dist/routes.d.ts +22 -0
- package/dist/theme.css +72 -0
- package/dist/toast.d.ts +18 -0
- package/dist/types.d.ts +474 -0
- package/dist/views/AgentActivityView.d.ts +8 -0
- package/dist/views/JobDetails.d.ts +2 -0
- package/dist/views/JobLogs.d.ts +4 -0
- package/dist/views/JobSubmit.d.ts +22 -0
- package/dist/views/JobSubmitView.d.ts +2 -0
- package/dist/views/JobsView.d.ts +4 -0
- package/dist/views/LogDisplay.d.ts +11 -0
- package/dist/views/PipelinesView.d.ts +2 -0
- package/dist/views/ScheduledJobsView.d.ts +2 -0
- package/package.json +70 -4
- package/src/api.ts +602 -0
- package/src/components/AutocompleteInput.tsx +253 -0
- package/src/components/MonacoEditor.tsx +163 -0
- package/src/components/toaster.tsx +38 -0
- package/src/components/tooltip.tsx +52 -0
- package/src/constants.ts +3 -0
- package/src/context.tsx +106 -0
- package/src/hooks/useColorMode.ts +31 -0
- package/src/hooks/usePageTitle.ts +21 -0
- package/src/index.ts +33 -0
- package/src/paths.ts +71 -0
- package/src/routes.tsx +55 -0
- package/src/theme.css +72 -0
- package/src/toast.ts +35 -0
- package/src/types.ts +542 -0
- package/src/views/AgentActivityView.tsx +262 -0
- package/src/views/JobDetails.tsx +675 -0
- package/src/views/JobLogs.tsx +987 -0
- package/src/views/JobSubmit.tsx +1272 -0
- package/src/views/JobSubmitView.tsx +69 -0
- package/src/views/JobsView.tsx +736 -0
- package/src/views/LogDisplay.tsx +171 -0
- package/src/views/PipelinesView.tsx +1318 -0
- package/src/views/ScheduledJobsView.tsx +735 -0
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Names of the bujang views. */
|
|
2
|
+
export type BujangView = 'jobs' | 'submitJob' | 'jobDetails' | 'jobLogs' | 'pipelines' | 'scheduled' | 'agent';
|
|
3
|
+
/** URL builders the views use to link to each other. */
|
|
4
|
+
export interface BujangPaths {
|
|
5
|
+
jobs: () => string;
|
|
6
|
+
submitJob: () => string;
|
|
7
|
+
jobDetails: (slurmJobId: string | number, jrJobId: string) => string;
|
|
8
|
+
jobLogs: (slurmJobId: string | number, jrJobId: string) => string;
|
|
9
|
+
pipelines: () => string;
|
|
10
|
+
scheduled: () => string;
|
|
11
|
+
/** Agent activity, optionally filtered on one session. */
|
|
12
|
+
agent: (session?: string) => string;
|
|
13
|
+
}
|
|
14
|
+
/** Default URL layout (react-router patterns), relative to the host's basePath. */
|
|
15
|
+
export declare const defaultRoutePatterns: Record<BujangView, string>;
|
|
16
|
+
/** Normalise "", "/", "/x/" to "", "", "/x". */
|
|
17
|
+
export declare function normalizeBasePath(basePath?: string): string;
|
|
18
|
+
/** Path builders for the default layout mounted under `basePath`. */
|
|
19
|
+
export declare function createBujangPaths(basePath?: string): BujangPaths;
|
|
20
|
+
export interface BujangNavItem {
|
|
21
|
+
view: BujangView;
|
|
22
|
+
label: string;
|
|
23
|
+
path: string;
|
|
24
|
+
}
|
|
25
|
+
/** Sidebar entries for the top-level bujang views. */
|
|
26
|
+
export declare function bujangNavItems(paths?: BujangPaths): BujangNavItem[];
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BujangView } from './paths';
|
|
3
|
+
export interface BujangRoutesOptions {
|
|
4
|
+
/** Prefix the routes are mounted under, e.g. "/slurm". Must match BujangProvider's basePath. Default "". */
|
|
5
|
+
basePath?: string;
|
|
6
|
+
/** Only mount these views (default: all). */
|
|
7
|
+
views?: BujangView[];
|
|
8
|
+
}
|
|
9
|
+
/** A plain route object, usable with <Route>, useRoutes() or createBrowserRouter(). */
|
|
10
|
+
export interface BujangRouteObject {
|
|
11
|
+
id: BujangView;
|
|
12
|
+
path: string;
|
|
13
|
+
element: React.ReactElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Route objects for the default bujang URL layout under `basePath`:
|
|
17
|
+
* /jobs, /jobs/submit, /jobrunner/:slurmJobId/:jrJobId, /joblogs/:slurmJobId/:jrJobId,
|
|
18
|
+
* /pipelines, /scheduled, /agent.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bujangRoutes(options?: BujangRoutesOptions): BujangRouteObject[];
|
|
21
|
+
/** The same routes as <Route> elements, to drop inside a host's <Routes>. */
|
|
22
|
+
export declare function bujangRouteElements(options?: BujangRoutesOptions): React.ReactElement[];
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Default colour tokens for @milabench/bujang (import "@milabench/bujang/theme.css").
|
|
3
|
+
*
|
|
4
|
+
* Every rule uses :where() so it has zero specificity: a host that defines the
|
|
5
|
+
* same --color-* variables (e.g. the theme.css of the host app) always wins.
|
|
6
|
+
* Dark mode follows the `dark` class (next-themes / Chakra) or data-theme="dark" on <html>.
|
|
7
|
+
*/
|
|
8
|
+
:where(:root) {
|
|
9
|
+
--color-bg-page: #f7fafc;
|
|
10
|
+
--color-bg-card: #ffffff;
|
|
11
|
+
--color-bg-header: #f7fafc;
|
|
12
|
+
--color-bg-hover: #edf2f7;
|
|
13
|
+
--color-bg-stripe: #f7fafc;
|
|
14
|
+
--color-border: #e2e8f0;
|
|
15
|
+
--color-text: #2d3748;
|
|
16
|
+
--color-text-muted: #718096;
|
|
17
|
+
--color-primary: #4299e1;
|
|
18
|
+
--color-primary-hover: #3182ce;
|
|
19
|
+
--color-primary-text: #ffffff;
|
|
20
|
+
--color-status-running: #48bb78;
|
|
21
|
+
--color-status-pending: #ecc94b;
|
|
22
|
+
--color-status-completed: #4299e1;
|
|
23
|
+
--color-status-failed: #f56565;
|
|
24
|
+
--color-status-cancelled: #718096;
|
|
25
|
+
--color-log-stdout-bg: #f7fafc;
|
|
26
|
+
--color-log-stderr-bg: #fff5f5;
|
|
27
|
+
--color-log-stdout-text: #1a202c;
|
|
28
|
+
--color-log-stderr-text: #822727;
|
|
29
|
+
--color-input-bg: #ffffff;
|
|
30
|
+
--color-input-border: #cbd5e0;
|
|
31
|
+
--color-freshness-good: #48bb78;
|
|
32
|
+
--color-freshness-stale: #7b341e;
|
|
33
|
+
--color-pipeline-job-bg: #fffaf0;
|
|
34
|
+
--color-pipeline-job-border: #fbd38d;
|
|
35
|
+
--color-pipeline-seq-bg: #f0fff4;
|
|
36
|
+
--color-pipeline-seq-border: #9ae6b4;
|
|
37
|
+
--color-pipeline-par-bg: #ebf8ff;
|
|
38
|
+
--color-pipeline-par-border: #90cdf4;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:where(html.dark, html[data-theme="dark"]) {
|
|
42
|
+
--color-bg-page: #171923;
|
|
43
|
+
--color-bg-card: #1a202c;
|
|
44
|
+
--color-bg-header: #1a202c;
|
|
45
|
+
--color-bg-hover: #2d3748;
|
|
46
|
+
--color-bg-stripe: #1a202c;
|
|
47
|
+
--color-border: #2d3748;
|
|
48
|
+
--color-text: #cbd5e0;
|
|
49
|
+
--color-text-muted: #a0aec0;
|
|
50
|
+
--color-primary: #63b3ed;
|
|
51
|
+
--color-primary-hover: #90cdf4;
|
|
52
|
+
--color-primary-text: #1a202c;
|
|
53
|
+
--color-status-running: #68d391;
|
|
54
|
+
--color-status-pending: #f6e05e;
|
|
55
|
+
--color-status-completed: #63b3ed;
|
|
56
|
+
--color-status-failed: #fc8181;
|
|
57
|
+
--color-status-cancelled: #a0aec0;
|
|
58
|
+
--color-log-stdout-bg: #171923;
|
|
59
|
+
--color-log-stderr-bg: #63171b;
|
|
60
|
+
--color-log-stdout-text: #edf2f7;
|
|
61
|
+
--color-log-stderr-text: #fed7d7;
|
|
62
|
+
--color-input-bg: #2d3748;
|
|
63
|
+
--color-input-border: #4a5568;
|
|
64
|
+
--color-freshness-good: #68d391;
|
|
65
|
+
--color-freshness-stale: #c05621;
|
|
66
|
+
--color-pipeline-job-bg: #1a202c;
|
|
67
|
+
--color-pipeline-job-border: #4a5568;
|
|
68
|
+
--color-pipeline-seq-bg: #1a202c;
|
|
69
|
+
--color-pipeline-seq-border: #4a5568;
|
|
70
|
+
--color-pipeline-par-bg: #1a202c;
|
|
71
|
+
--color-pipeline-par-border: #4a5568;
|
|
72
|
+
}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CreateToasterReturn } from '@chakra-ui/react';
|
|
3
|
+
export interface BujangToastOptions {
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
type?: 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
7
|
+
duration?: number;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type BujangToastHandler = (options: BujangToastOptions) => void;
|
|
11
|
+
/** Toaster rendered by <BujangToaster/> when the host does not provide its own `toast` handler. */
|
|
12
|
+
export declare const bujangToaster: CreateToasterReturn;
|
|
13
|
+
/** Set by BujangProvider. Passing undefined restores the built-in toaster. */
|
|
14
|
+
export declare function setBujangToastHandler(handler?: BujangToastHandler): void;
|
|
15
|
+
/** Internal toaster facade used by the views (same call shape as Chakra's toaster). */
|
|
16
|
+
export declare const toaster: {
|
|
17
|
+
create: (options: BujangToastOptions) => void;
|
|
18
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
export interface ApiError {
|
|
2
|
+
message: string;
|
|
3
|
+
status: number;
|
|
4
|
+
}
|
|
5
|
+
export interface SlurmJob {
|
|
6
|
+
job_id: string | null;
|
|
7
|
+
jr_job_id?: string | null;
|
|
8
|
+
/** Submitted by an agent through the MCP server */
|
|
9
|
+
agent?: AgentTag | null;
|
|
10
|
+
created_at?: string;
|
|
11
|
+
partition?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
job_name?: string;
|
|
14
|
+
user?: string;
|
|
15
|
+
user_name?: string;
|
|
16
|
+
status?: string;
|
|
17
|
+
state?: string;
|
|
18
|
+
job_state?: string[];
|
|
19
|
+
state_reason?: string;
|
|
20
|
+
state_description?: string;
|
|
21
|
+
time?: string;
|
|
22
|
+
time_limit?: {
|
|
23
|
+
number: number;
|
|
24
|
+
set: boolean;
|
|
25
|
+
infinite: boolean;
|
|
26
|
+
};
|
|
27
|
+
elapsed?: string;
|
|
28
|
+
nodes?: string;
|
|
29
|
+
nodelist?: string;
|
|
30
|
+
node_list?: string;
|
|
31
|
+
account?: string;
|
|
32
|
+
alloccpus?: string;
|
|
33
|
+
exit_code?: string;
|
|
34
|
+
raw_line?: string;
|
|
35
|
+
start_time?: {
|
|
36
|
+
number: number;
|
|
37
|
+
set: boolean;
|
|
38
|
+
infinite: boolean;
|
|
39
|
+
};
|
|
40
|
+
end_time?: {
|
|
41
|
+
number: number;
|
|
42
|
+
set: boolean;
|
|
43
|
+
infinite: boolean;
|
|
44
|
+
};
|
|
45
|
+
submit_time?: {
|
|
46
|
+
number: number;
|
|
47
|
+
set: boolean;
|
|
48
|
+
infinite: boolean;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** A Slurm numeric field as returned by the Slurm REST API (`scontrol`-style). */
|
|
52
|
+
export interface SlurmNumericField {
|
|
53
|
+
number: number;
|
|
54
|
+
set: boolean;
|
|
55
|
+
infinite: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface SlurmJobResourceNode {
|
|
58
|
+
memory_allocated?: number;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
export interface SlurmJobResources {
|
|
62
|
+
allocated_nodes?: SlurmJobResourceNode[];
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Detailed job info as returned by `getSlurmJobInfo` — a passthrough of the
|
|
67
|
+
* Slurm REST API's `scontrol show job` response, richer than `SlurmJob`.
|
|
68
|
+
*/
|
|
69
|
+
export interface SlurmJobDetail {
|
|
70
|
+
job_id?: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
job_state?: string[];
|
|
73
|
+
partition?: string;
|
|
74
|
+
user_name?: string;
|
|
75
|
+
account?: string;
|
|
76
|
+
qos?: string;
|
|
77
|
+
priority?: SlurmNumericField;
|
|
78
|
+
node_count?: SlurmNumericField;
|
|
79
|
+
nodes?: string;
|
|
80
|
+
tasks?: SlurmNumericField;
|
|
81
|
+
cpus?: SlurmNumericField;
|
|
82
|
+
cpus_per_task?: SlurmNumericField;
|
|
83
|
+
tasks_per_node?: SlurmNumericField;
|
|
84
|
+
memory_per_node?: SlurmNumericField;
|
|
85
|
+
tres_alloc_str?: string;
|
|
86
|
+
submit_time?: SlurmNumericField;
|
|
87
|
+
start_time?: SlurmNumericField;
|
|
88
|
+
end_time?: SlurmNumericField;
|
|
89
|
+
eligible_time?: SlurmNumericField;
|
|
90
|
+
accrue_time?: SlurmNumericField;
|
|
91
|
+
time_limit?: SlurmNumericField;
|
|
92
|
+
command?: string;
|
|
93
|
+
current_working_directory?: string;
|
|
94
|
+
standard_output?: string;
|
|
95
|
+
standard_error?: string;
|
|
96
|
+
comment?: string;
|
|
97
|
+
exit_code?: {
|
|
98
|
+
return_code?: SlurmNumericField;
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
};
|
|
101
|
+
restart_cnt?: number;
|
|
102
|
+
state_reason?: string;
|
|
103
|
+
elapsed?: string;
|
|
104
|
+
time?: string;
|
|
105
|
+
gres_detail?: string[] | string;
|
|
106
|
+
job_resources?: SlurmJobResources;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
export interface SlurmJobsResponse {
|
|
110
|
+
active_jobs: SlurmJob[];
|
|
111
|
+
completed_jobs: SlurmJob[];
|
|
112
|
+
}
|
|
113
|
+
export interface SlurmJobSubmitRequest {
|
|
114
|
+
script: string;
|
|
115
|
+
job_name?: string;
|
|
116
|
+
sbatch_args?: string[];
|
|
117
|
+
script_args?: Record<string, string>;
|
|
118
|
+
partition?: string;
|
|
119
|
+
nodes?: number;
|
|
120
|
+
ntasks?: number;
|
|
121
|
+
cpus_per_task?: number;
|
|
122
|
+
mem?: string;
|
|
123
|
+
time_limit?: string;
|
|
124
|
+
gpus_per_task?: string;
|
|
125
|
+
ntasks_per_node?: number;
|
|
126
|
+
exclusive?: boolean;
|
|
127
|
+
export?: string;
|
|
128
|
+
nodelist?: string;
|
|
129
|
+
dependency?: [string, string][];
|
|
130
|
+
}
|
|
131
|
+
export interface SlurmJobSubmitResponse {
|
|
132
|
+
success: boolean;
|
|
133
|
+
job_id?: string;
|
|
134
|
+
jr_job_id?: string;
|
|
135
|
+
message?: string;
|
|
136
|
+
error?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface SlurmJobLogs {
|
|
139
|
+
job_info: Record<string, string>;
|
|
140
|
+
stdout: string;
|
|
141
|
+
stderr: string;
|
|
142
|
+
}
|
|
143
|
+
export interface SlurmJobLogResponse {
|
|
144
|
+
data: string;
|
|
145
|
+
size: number;
|
|
146
|
+
}
|
|
147
|
+
export interface SlurmJobData {
|
|
148
|
+
job_id: string;
|
|
149
|
+
work_dir: string;
|
|
150
|
+
data_files: string[];
|
|
151
|
+
}
|
|
152
|
+
export interface SlurmClusterStatus {
|
|
153
|
+
status: 'online' | 'offline';
|
|
154
|
+
reason?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SlurmJobStatusResponse {
|
|
157
|
+
status: string;
|
|
158
|
+
}
|
|
159
|
+
export interface SlurmJobAccounting {
|
|
160
|
+
job_id: number;
|
|
161
|
+
account: string;
|
|
162
|
+
state: {
|
|
163
|
+
current: string[];
|
|
164
|
+
reason: string;
|
|
165
|
+
};
|
|
166
|
+
derived_exit_code: {
|
|
167
|
+
status: string[];
|
|
168
|
+
return_code: {
|
|
169
|
+
set: boolean;
|
|
170
|
+
infinite: boolean;
|
|
171
|
+
number: number;
|
|
172
|
+
};
|
|
173
|
+
signal: {
|
|
174
|
+
id: {
|
|
175
|
+
set: boolean;
|
|
176
|
+
infinite: boolean;
|
|
177
|
+
number: number;
|
|
178
|
+
};
|
|
179
|
+
name: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
exit_code: {
|
|
183
|
+
status: string[];
|
|
184
|
+
return_code: {
|
|
185
|
+
set: boolean;
|
|
186
|
+
infinite: boolean;
|
|
187
|
+
number: number;
|
|
188
|
+
};
|
|
189
|
+
signal: {
|
|
190
|
+
id: {
|
|
191
|
+
set: boolean;
|
|
192
|
+
infinite: boolean;
|
|
193
|
+
number: number;
|
|
194
|
+
};
|
|
195
|
+
name: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
time: {
|
|
199
|
+
elapsed: number;
|
|
200
|
+
eligible: number;
|
|
201
|
+
end: number;
|
|
202
|
+
start: number;
|
|
203
|
+
submission: number;
|
|
204
|
+
suspended: number;
|
|
205
|
+
limit: {
|
|
206
|
+
set: boolean;
|
|
207
|
+
infinite: boolean;
|
|
208
|
+
number: number;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
name: string;
|
|
212
|
+
partition: string;
|
|
213
|
+
nodes: string;
|
|
214
|
+
user: string;
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
export interface PersitedJobInfo {
|
|
218
|
+
name: string;
|
|
219
|
+
cluster?: string;
|
|
220
|
+
creation_time: string;
|
|
221
|
+
last_modified: string;
|
|
222
|
+
last_accessed: string;
|
|
223
|
+
freshness: number;
|
|
224
|
+
info: SlurmJob;
|
|
225
|
+
acc: SlurmJobAccounting;
|
|
226
|
+
/** Submitted by an agent through the MCP server */
|
|
227
|
+
agent?: AgentTag | null;
|
|
228
|
+
}
|
|
229
|
+
export interface SlurmPartition {
|
|
230
|
+
partition: string;
|
|
231
|
+
allocated: string;
|
|
232
|
+
nodes: string;
|
|
233
|
+
state: string;
|
|
234
|
+
nodelist: string;
|
|
235
|
+
}
|
|
236
|
+
export interface SlurmNode {
|
|
237
|
+
hostname: string;
|
|
238
|
+
partition: string;
|
|
239
|
+
state: string;
|
|
240
|
+
cpus: string;
|
|
241
|
+
memory: string;
|
|
242
|
+
gres: string;
|
|
243
|
+
}
|
|
244
|
+
export interface SlurmClusterInfo {
|
|
245
|
+
partitions: SlurmPartition[];
|
|
246
|
+
nodes: SlurmNode[];
|
|
247
|
+
}
|
|
248
|
+
export interface SlurmTemplate {
|
|
249
|
+
template: string;
|
|
250
|
+
description: string;
|
|
251
|
+
}
|
|
252
|
+
export interface SlurmProfile {
|
|
253
|
+
name: string;
|
|
254
|
+
cluster?: string;
|
|
255
|
+
node?: string;
|
|
256
|
+
description: string;
|
|
257
|
+
sbatch_args: string[];
|
|
258
|
+
parsed_args: {
|
|
259
|
+
job_name?: string;
|
|
260
|
+
partition?: string;
|
|
261
|
+
nodes?: number;
|
|
262
|
+
ntasks?: number;
|
|
263
|
+
cpus_per_task?: number;
|
|
264
|
+
mem?: string;
|
|
265
|
+
time_limit?: string;
|
|
266
|
+
gpus_per_task?: string;
|
|
267
|
+
ntasks_per_node?: number;
|
|
268
|
+
exclusive?: boolean;
|
|
269
|
+
export?: string;
|
|
270
|
+
nodelist?: string;
|
|
271
|
+
extra?: string[];
|
|
272
|
+
};
|
|
273
|
+
executor?: 'slurm' | 'ssh';
|
|
274
|
+
hosts?: string[];
|
|
275
|
+
}
|
|
276
|
+
export interface SlurmProfileSaveRequest {
|
|
277
|
+
name: string;
|
|
278
|
+
description?: string;
|
|
279
|
+
sbatch_args: string[];
|
|
280
|
+
}
|
|
281
|
+
export interface PipelineJob {
|
|
282
|
+
type: 'job';
|
|
283
|
+
script: string;
|
|
284
|
+
profile: string;
|
|
285
|
+
env?: Record<string, string>;
|
|
286
|
+
proxy?: boolean;
|
|
287
|
+
job_id?: string;
|
|
288
|
+
slurm_jobid?: string;
|
|
289
|
+
cluster?: string;
|
|
290
|
+
executor?: 'slurm' | 'ssh';
|
|
291
|
+
host?: string;
|
|
292
|
+
}
|
|
293
|
+
/** Response of a pipeline run: submitted in the background, follow it with its run id */
|
|
294
|
+
export interface PipelineRunResponse {
|
|
295
|
+
success: boolean;
|
|
296
|
+
run_id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
}
|
|
299
|
+
/** submitting: the jobs are being submitted; failed: the submission failed (nothing runs) */
|
|
300
|
+
export type PipelineSubmissionStatus = 'submitting' | 'submitted' | 'failed';
|
|
301
|
+
/** A pipeline run in the list of runs */
|
|
302
|
+
export interface PipelineRunSummary {
|
|
303
|
+
run_id: string;
|
|
304
|
+
name: string;
|
|
305
|
+
started: number;
|
|
306
|
+
status: PipelineSubmissionStatus;
|
|
307
|
+
error?: string | null;
|
|
308
|
+
}
|
|
309
|
+
/** A step of a run with its current state (sacct/squeue state, HELD, or the ssh step state) */
|
|
310
|
+
export interface PipelineRunStep extends PipelineJob {
|
|
311
|
+
step?: string;
|
|
312
|
+
after?: string[];
|
|
313
|
+
held?: boolean;
|
|
314
|
+
state?: string;
|
|
315
|
+
}
|
|
316
|
+
/** Progress of a run */
|
|
317
|
+
export interface PipelineRunStatus {
|
|
318
|
+
run_id: string;
|
|
319
|
+
name?: string | null;
|
|
320
|
+
status: PipelineSubmissionStatus;
|
|
321
|
+
error?: string | null;
|
|
322
|
+
state?: 'running' | 'failing' | 'failed' | 'completed' | 'unknown';
|
|
323
|
+
steps?: PipelineRunStep[];
|
|
324
|
+
log?: string;
|
|
325
|
+
}
|
|
326
|
+
export interface PipelineSequential {
|
|
327
|
+
type: 'sequential';
|
|
328
|
+
name: string;
|
|
329
|
+
jobs: PipelineNode[];
|
|
330
|
+
}
|
|
331
|
+
export interface PipelineParallel {
|
|
332
|
+
type: 'parallel';
|
|
333
|
+
name: string;
|
|
334
|
+
jobs: PipelineNode[];
|
|
335
|
+
}
|
|
336
|
+
export interface Pipeline {
|
|
337
|
+
type: 'pipeline';
|
|
338
|
+
name: string;
|
|
339
|
+
description?: string;
|
|
340
|
+
definition: PipelineNode;
|
|
341
|
+
job_id?: string;
|
|
342
|
+
}
|
|
343
|
+
export type PipelineNode = PipelineJob | PipelineSequential | PipelineParallel;
|
|
344
|
+
export interface PipelineRun {
|
|
345
|
+
id: string;
|
|
346
|
+
name: string;
|
|
347
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
348
|
+
created_at: string;
|
|
349
|
+
started_at?: string;
|
|
350
|
+
completed_at?: string;
|
|
351
|
+
pipeline: Pipeline;
|
|
352
|
+
jobs: PipelineJobStatus[];
|
|
353
|
+
}
|
|
354
|
+
export interface PipelineJobStatus {
|
|
355
|
+
job_id: string;
|
|
356
|
+
slurm_jobid?: string;
|
|
357
|
+
name: string;
|
|
358
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
359
|
+
started_at?: string;
|
|
360
|
+
completed_at?: string;
|
|
361
|
+
dependencies?: string[];
|
|
362
|
+
}
|
|
363
|
+
export interface PipelineTemplate {
|
|
364
|
+
name: string;
|
|
365
|
+
description: string;
|
|
366
|
+
pipeline: Pipeline;
|
|
367
|
+
}
|
|
368
|
+
/** Payload sent to persist a pipeline as a reusable template file. */
|
|
369
|
+
export interface PipelineTemplatePayload {
|
|
370
|
+
name: string;
|
|
371
|
+
type: 'pipeline';
|
|
372
|
+
definition: PipelineNode;
|
|
373
|
+
job_id: string | null;
|
|
374
|
+
}
|
|
375
|
+
export interface PipelineCreateRequest {
|
|
376
|
+
name: string;
|
|
377
|
+
pipeline: Pipeline;
|
|
378
|
+
}
|
|
379
|
+
export interface PipelineRunRequest {
|
|
380
|
+
pipeline_id: string;
|
|
381
|
+
name?: string;
|
|
382
|
+
}
|
|
383
|
+
export interface PipelineListResponse {
|
|
384
|
+
pipelines: Pipeline[];
|
|
385
|
+
}
|
|
386
|
+
export interface PipelineRunsResponse {
|
|
387
|
+
runs: PipelineRun[];
|
|
388
|
+
}
|
|
389
|
+
export interface PushFolderResponse {
|
|
390
|
+
status: "OK";
|
|
391
|
+
success: string[];
|
|
392
|
+
failures: Array<[string, string]>;
|
|
393
|
+
}
|
|
394
|
+
export interface EarlySyncResponse {
|
|
395
|
+
status: "ok" | "notok";
|
|
396
|
+
}
|
|
397
|
+
export interface ScheduledJob {
|
|
398
|
+
_id: number;
|
|
399
|
+
name: string;
|
|
400
|
+
enabled: boolean;
|
|
401
|
+
cron_expression: string;
|
|
402
|
+
cluster: string;
|
|
403
|
+
script: string;
|
|
404
|
+
sbatch_args: string[];
|
|
405
|
+
job_name_prefix: string | null;
|
|
406
|
+
created_time: string | null;
|
|
407
|
+
modified_time: string | null;
|
|
408
|
+
last_run_time: string | null;
|
|
409
|
+
last_job_id: string | null;
|
|
410
|
+
next_run_time: string | null;
|
|
411
|
+
source_template: string | null;
|
|
412
|
+
source_template_hash: string | null;
|
|
413
|
+
outdated?: boolean;
|
|
414
|
+
template_missing?: boolean;
|
|
415
|
+
}
|
|
416
|
+
export interface ScheduledJobTemplateDiff {
|
|
417
|
+
source_template: string;
|
|
418
|
+
current_script: string;
|
|
419
|
+
latest_script: string;
|
|
420
|
+
outdated: boolean;
|
|
421
|
+
}
|
|
422
|
+
export interface ScheduledJobRun {
|
|
423
|
+
_id: number;
|
|
424
|
+
scheduled_job_id: number;
|
|
425
|
+
jr_job_id: string | null;
|
|
426
|
+
slurm_job_id: string | null;
|
|
427
|
+
submitted_at: string | null;
|
|
428
|
+
status: string;
|
|
429
|
+
error: string | null;
|
|
430
|
+
}
|
|
431
|
+
export interface AgentTag {
|
|
432
|
+
session: string;
|
|
433
|
+
agent: string;
|
|
434
|
+
tool?: string | null;
|
|
435
|
+
reason?: string | null;
|
|
436
|
+
job_id?: string | null;
|
|
437
|
+
ts?: number;
|
|
438
|
+
}
|
|
439
|
+
export interface AgentEvent {
|
|
440
|
+
id: string;
|
|
441
|
+
ts: number;
|
|
442
|
+
session: string;
|
|
443
|
+
agent: string;
|
|
444
|
+
kind: 'call' | 'note';
|
|
445
|
+
tool?: string | null;
|
|
446
|
+
reason?: string | null;
|
|
447
|
+
method?: string;
|
|
448
|
+
path?: string;
|
|
449
|
+
request?: Record<string, unknown> | null;
|
|
450
|
+
status?: number;
|
|
451
|
+
ok?: boolean;
|
|
452
|
+
write?: boolean;
|
|
453
|
+
result?: Record<string, unknown> | null;
|
|
454
|
+
duration_ms?: number;
|
|
455
|
+
level?: 'plan' | 'progress' | 'finding' | 'question' | 'warning' | 'info';
|
|
456
|
+
message?: string;
|
|
457
|
+
jobs?: string[];
|
|
458
|
+
}
|
|
459
|
+
export interface AgentSession {
|
|
460
|
+
session: string;
|
|
461
|
+
agent: string;
|
|
462
|
+
started: number;
|
|
463
|
+
last: number;
|
|
464
|
+
calls: number;
|
|
465
|
+
writes: number;
|
|
466
|
+
errors: number;
|
|
467
|
+
notes: number;
|
|
468
|
+
jobs: {
|
|
469
|
+
jr_job_id: string;
|
|
470
|
+
job_id: string | null;
|
|
471
|
+
}[];
|
|
472
|
+
pipelines: string[];
|
|
473
|
+
last_note: string | null;
|
|
474
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AgentTag } from '../types';
|
|
3
|
+
/** Badge for the jobs submitted by an agent, its reason on hover */
|
|
4
|
+
export declare const AgentBadge: React.FC<{
|
|
5
|
+
tag?: AgentTag | null;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const AgentActivityView: React.FC;
|
|
8
|
+
export default AgentActivityView;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SlurmProfile, SlurmJob } from '../types';
|
|
3
|
+
export interface JobSubmissionInitialData {
|
|
4
|
+
script?: string;
|
|
5
|
+
job_name?: string;
|
|
6
|
+
sbatch_args?: string[];
|
|
7
|
+
}
|
|
8
|
+
interface ClusterOption {
|
|
9
|
+
name: string;
|
|
10
|
+
ssh: string;
|
|
11
|
+
}
|
|
12
|
+
interface JobSubmissionFormProps {
|
|
13
|
+
templates?: string[];
|
|
14
|
+
profiles: SlurmProfile[];
|
|
15
|
+
clusters?: ClusterOption[];
|
|
16
|
+
activeJobs?: SlurmJob[];
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
initialData?: JobSubmissionInitialData;
|
|
19
|
+
syncUrl?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const JobSubmissionForm: React.FC<JobSubmissionFormProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface LogDisplayProps {
|
|
3
|
+
logType: 'stdout' | 'stderr';
|
|
4
|
+
jrJobId: string;
|
|
5
|
+
isJobFinished: boolean;
|
|
6
|
+
formatFileSize: (bytes: number) => string;
|
|
7
|
+
fetchLogData: (jrJobId: string, start?: number, end?: number) => Promise<string>;
|
|
8
|
+
getSlurmJobLogSize: (jrJobId: string) => Promise<number>;
|
|
9
|
+
}
|
|
10
|
+
export declare const LogDisplay: React.FC<LogDisplayProps>;
|
|
11
|
+
export {};
|