@milabench/bujang 0.1.10 → 0.1.12
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/dist/api.d.ts +2 -0
- package/dist/components/SshConnectDialog.d.ts +8 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4031 -3575
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +3 -1
- package/dist/routes.d.ts +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/views/SettingsView.d.ts +11 -0
- package/dist/views/SetupView.d.ts +8 -0
- package/package.json +1 -1
- package/src/api.ts +2 -0
- package/src/components/SshConnectDialog.tsx +76 -23
- package/src/index.ts +1 -0
- package/src/paths.ts +7 -1
- package/src/routes.tsx +3 -1
- package/src/types.ts +13 -0
- package/src/views/JobsView.tsx +1 -1
- package/src/views/SettingsView.tsx +4 -4
- package/src/views/SetupView.tsx +584 -0
package/dist/paths.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconType } from 'react-icons';
|
|
2
2
|
/** Names of the bujang views. */
|
|
3
|
-
export type BujangView = 'jobs' | 'submitJob' | 'jobDetails' | 'jobLogs' | 'pipelines' | 'pipelineDetails' | 'scheduled' | 'agent' | 'janitor' | 'settings';
|
|
3
|
+
export type BujangView = 'jobs' | 'submitJob' | 'jobDetails' | 'jobLogs' | 'pipelines' | 'pipelineDetails' | 'scheduled' | 'agent' | 'janitor' | 'setup' | 'settings';
|
|
4
4
|
/** URL builders the views use to link to each other. */
|
|
5
5
|
export interface BujangPaths {
|
|
6
6
|
jobs: () => string;
|
|
@@ -20,6 +20,8 @@ export interface BujangPaths {
|
|
|
20
20
|
* `section` links to one card: general, folders, database, ssh, secrets.
|
|
21
21
|
*/
|
|
22
22
|
settings: (section?: string) => string;
|
|
23
|
+
/** First-time setup wizard. `step`: welcome, folders, ssh, connect, first-job, secrets, mcp, next. */
|
|
24
|
+
setup: (step?: string) => string;
|
|
23
25
|
}
|
|
24
26
|
/** Default URL layout (react-router patterns), relative to the host's basePath. */
|
|
25
27
|
export declare const defaultRoutePatterns: Record<BujangView, string>;
|
package/dist/routes.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface BujangRouteObject {
|
|
|
15
15
|
/**
|
|
16
16
|
* Route objects for the default bujang URL layout under `basePath`:
|
|
17
17
|
* /jobs, /jobs/submit, /jobrunner/:slurmJobId/:jrJobId, /joblogs/:slurmJobId/:jrJobId,
|
|
18
|
-
* /pipelines, /pipelines/:pipelineName, /scheduled, /agent, /janitor, /settings.
|
|
18
|
+
* /pipelines, /pipelines/:pipelineName, /scheduled, /agent, /janitor, /setup, /settings.
|
|
19
19
|
*/
|
|
20
20
|
export declare function bujangRoutes(options?: BujangRoutesOptions): BujangRouteObject[];
|
|
21
21
|
/** The same routes as <Route> elements, to drop inside a host's <Routes>. */
|
package/dist/types.d.ts
CHANGED
|
@@ -223,6 +223,8 @@ export interface SlurmJobAccounting {
|
|
|
223
223
|
}
|
|
224
224
|
export interface PersitedJobInfo {
|
|
225
225
|
name: string;
|
|
226
|
+
/** JR_JOB_LABEL of the script (or the label given at submission), resolved: meta/label.txt */
|
|
227
|
+
label?: string | null;
|
|
226
228
|
cluster?: string;
|
|
227
229
|
creation_time: string;
|
|
228
230
|
last_modified: string;
|
|
@@ -305,6 +307,8 @@ export interface PipelineJob {
|
|
|
305
307
|
profile: string;
|
|
306
308
|
env?: Record<string, string>;
|
|
307
309
|
proxy?: boolean;
|
|
310
|
+
/** label template ("train lr={LR}"): names the job, wins over its group's and the script's JR_JOB_LABEL */
|
|
311
|
+
label?: string;
|
|
308
312
|
job_id?: string;
|
|
309
313
|
slurm_jobid?: string;
|
|
310
314
|
cluster?: string;
|
|
@@ -358,6 +362,8 @@ export interface PipelineSequential {
|
|
|
358
362
|
type: 'sequential';
|
|
359
363
|
name: string;
|
|
360
364
|
jobs: PipelineNode[];
|
|
365
|
+
/** label template of the jobs under it, resolved with each job's arguments */
|
|
366
|
+
label?: string;
|
|
361
367
|
}
|
|
362
368
|
export interface PipelineParallel {
|
|
363
369
|
type: 'parallel';
|
|
@@ -365,6 +371,8 @@ export interface PipelineParallel {
|
|
|
365
371
|
jobs: PipelineNode[];
|
|
366
372
|
/** display only: the env variable that tells the children apart (e.g. ARGS), shown instead of their script */
|
|
367
373
|
sweep?: string;
|
|
374
|
+
/** label template of the jobs under it, resolved with each job's arguments */
|
|
375
|
+
label?: string;
|
|
368
376
|
}
|
|
369
377
|
export interface Pipeline {
|
|
370
378
|
type: 'pipeline';
|
|
@@ -760,6 +768,11 @@ export interface SshConnection {
|
|
|
760
768
|
/** open: connected; no: not connected; none: the ssh config keeps no shared connection for the host */
|
|
761
769
|
master: 'open' | 'no' | 'none';
|
|
762
770
|
login: SshLogin | null;
|
|
771
|
+
/** the cluster has unfinished jobs: the syncs need a connection to it */
|
|
772
|
+
active_jobs: boolean;
|
|
773
|
+
/** without an open connection: what the last sync probe found (null: not probed) */
|
|
774
|
+
reachable: boolean | null;
|
|
775
|
+
reason: string | null;
|
|
763
776
|
}
|
|
764
777
|
export interface SshConnections {
|
|
765
778
|
writable: boolean;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SettingsInfo } from '../types';
|
|
3
|
+
export declare const SETTINGS_KEY: string[];
|
|
4
|
+
export declare const FoldersCard: React.FC<{
|
|
5
|
+
info: SettingsInfo;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const SshCard: React.FC<{
|
|
8
|
+
info: SettingsInfo;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const SecretsCard: React.FC<{
|
|
11
|
+
writable: boolean;
|
|
12
|
+
}>;
|
|
2
13
|
export declare const SettingsView: React.FC;
|
|
3
14
|
export default SettingsView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* First-time setup, one step at a time: folders, the ssh config of the clusters, a login, a first job,
|
|
4
|
+
* secrets, an agent over MCP. Each step reuses the Settings card of the same id; the step list checks
|
|
5
|
+
* what bujang can see by itself (ssh entries installed, a connection open, a job, an agent session).
|
|
6
|
+
*/
|
|
7
|
+
export declare const SetupView: React.FC;
|
|
8
|
+
export default SetupView;
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -361,6 +361,8 @@ export const saveSlurmProfile = async (request: {
|
|
|
361
361
|
export const submitSlurmJob = async (request: {
|
|
362
362
|
script: string;
|
|
363
363
|
job_name?: string;
|
|
364
|
+
/** label template ("train lr={LR}"), else the script's JR_JOB_LABEL */
|
|
365
|
+
label?: string;
|
|
364
366
|
cluster?: string;
|
|
365
367
|
sbatch_args?: string[];
|
|
366
368
|
script_args?: Record<string, string>;
|
|
@@ -18,17 +18,36 @@ const inputStyle = {
|
|
|
18
18
|
color: 'var(--color-text)',
|
|
19
19
|
} as const;
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
export const
|
|
21
|
+
/** Connected: an open shared connection, or a host without one that the last sync could reach */
|
|
22
|
+
export const isConnected = (c: SshConnection) => c.master === 'open' || (c.master === 'none' && c.reachable === true);
|
|
23
|
+
|
|
24
|
+
/** A cluster with unfinished jobs bujang cannot reach: its sync is paused until a login */
|
|
25
|
+
export const needsLogin = (c: SshConnection) =>
|
|
26
|
+
c.login_node && c.active_jobs && c.master !== 'open' && (c.master === 'no' || c.reachable === false);
|
|
27
|
+
|
|
28
|
+
/** The state of a host's connection as a badge */
|
|
29
|
+
export const MasterBadge: React.FC<{ connection: SshConnection }> = ({ connection }) => {
|
|
30
|
+
const { master, reachable, reason } = connection;
|
|
23
31
|
if (master === 'open') return <Badge colorPalette="green" variant="subtle">connected</Badge>;
|
|
24
|
-
|
|
32
|
+
// the host itself fails (DNS, refused, timeout); "not connected" (a login is needed) is below
|
|
33
|
+
if (reachable === false && reason?.startsWith('unreachable')) {
|
|
34
|
+
return <Badge colorPalette="red" variant="subtle" title={reason}>unreachable</Badge>;
|
|
35
|
+
}
|
|
36
|
+
if (master === 'none' && reachable === true) {
|
|
37
|
+
return (
|
|
38
|
+
<Badge colorPalette="green" variant="subtle" title="Reachable without a prompt; the ssh config keeps no shared connection (ControlMaster) for this host">
|
|
39
|
+
reachable
|
|
40
|
+
</Badge>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (master === 'none' && reachable !== false) {
|
|
25
44
|
return (
|
|
26
45
|
<Badge colorPalette="gray" variant="subtle" title="The ssh config keeps no shared connection (ControlMaster) for this host: each ssh connects on its own">
|
|
27
46
|
no shared connection
|
|
28
47
|
</Badge>
|
|
29
48
|
);
|
|
30
49
|
}
|
|
31
|
-
return <Badge colorPalette="orange" variant="subtle">not connected</Badge>;
|
|
50
|
+
return <Badge colorPalette="orange" variant="subtle" title={reason || undefined}>not connected</Badge>;
|
|
32
51
|
};
|
|
33
52
|
|
|
34
53
|
/** One login in progress: the prompt of ssh (MFA passcode, password, host key) and its answer */
|
|
@@ -147,6 +166,8 @@ export interface SshConnectDialogProps {
|
|
|
147
166
|
cluster?: string | null;
|
|
148
167
|
/** The login to `cluster` succeeded: the dialog closes itself */
|
|
149
168
|
onConnected?: () => void;
|
|
169
|
+
/** Why the dialog opened on `cluster`: a submit waits for it, or its jobs run without a sync */
|
|
170
|
+
purpose?: 'submit' | 'reconnect';
|
|
150
171
|
}
|
|
151
172
|
|
|
152
173
|
/**
|
|
@@ -154,7 +175,7 @@ export interface SshConnectDialogProps {
|
|
|
154
175
|
* Connect button each; the prompts of ssh (MFA passcode / Duo option, password, host key) are
|
|
155
176
|
* answered here. Every other ssh of bujang reuses the connection and never prompts.
|
|
156
177
|
*/
|
|
157
|
-
export const SshConnectDialog: React.FC<SshConnectDialogProps> = ({ open, onClose, cluster, onConnected }) => {
|
|
178
|
+
export const SshConnectDialog: React.FC<SshConnectDialogProps> = ({ open, onClose, cluster, onConnected, purpose = 'submit' }) => {
|
|
158
179
|
const queryClient = useQueryClient();
|
|
159
180
|
const [loginId, setLoginId] = useState<string | null>(null);
|
|
160
181
|
const autoStarted = useRef(false);
|
|
@@ -213,7 +234,14 @@ export const SshConnectDialog: React.FC<SshConnectDialogProps> = ({ open, onClos
|
|
|
213
234
|
|
|
214
235
|
const connect = (c: SshConnection) => start.mutate({ host: c.host, cluster: c.cluster });
|
|
215
236
|
const busy = !!login && ACTIVE.includes(login.state);
|
|
216
|
-
|
|
237
|
+
// the clusters whose jobs run without a sync first
|
|
238
|
+
const hosts = [...(connections?.hosts || [])].sort((a, b) => Number(needsLogin(b)) - Number(needsLogin(a)));
|
|
239
|
+
const paused = hosts.filter(needsLogin);
|
|
240
|
+
const intro = !cluster
|
|
241
|
+
? 'Log in once per cluster (two-factor authentication included): bujang reuses the connection for every ssh, rsync and scp until it expires.'
|
|
242
|
+
: purpose === 'reconnect'
|
|
243
|
+
? `Jobs are running on ${cluster} but bujang has no connection to it: their sync is paused until you log in.`
|
|
244
|
+
: `${cluster} has no open connection: log in once (two-factor authentication included), then the job is submitted.`;
|
|
217
245
|
|
|
218
246
|
return (
|
|
219
247
|
<Dialog.Root open={open} onOpenChange={(d) => { if (!d.open) close(); }} size="lg">
|
|
@@ -226,11 +254,13 @@ export const SshConnectDialog: React.FC<SshConnectDialogProps> = ({ open, onClos
|
|
|
226
254
|
</Dialog.Header>
|
|
227
255
|
<Dialog.Body>
|
|
228
256
|
<VStack align="stretch" gap={4}>
|
|
229
|
-
<Text fontSize="sm" color="var(--color-text-muted)">
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
257
|
+
<Text fontSize="sm" color="var(--color-text-muted)">{intro}</Text>
|
|
258
|
+
{!cluster && paused.length > 0 && (
|
|
259
|
+
<Text fontSize="sm" color="var(--color-status-failed)">
|
|
260
|
+
Jobs are running on {paused.map(p => p.cluster).join(', ')} without a connection: their sync is
|
|
261
|
+
paused until you log in.
|
|
262
|
+
</Text>
|
|
263
|
+
)}
|
|
234
264
|
|
|
235
265
|
{login && (
|
|
236
266
|
<LoginPanel
|
|
@@ -264,12 +294,17 @@ export const SshConnectDialog: React.FC<SshConnectDialogProps> = ({ open, onClos
|
|
|
264
294
|
<Table.Body>
|
|
265
295
|
{hosts.map(c => (
|
|
266
296
|
<Table.Row key={`${c.cluster}/${c.host}`}>
|
|
267
|
-
<Table.Cell>
|
|
297
|
+
<Table.Cell>
|
|
298
|
+
{c.cluster}
|
|
299
|
+
{c.login_node && c.active_jobs && (
|
|
300
|
+
<Badge ml={2} size="xs" variant="outline" title="This cluster has unfinished jobs">jobs running</Badge>
|
|
301
|
+
)}
|
|
302
|
+
</Table.Cell>
|
|
268
303
|
<Table.Cell fontFamily="mono" fontSize="xs">
|
|
269
304
|
{c.host}
|
|
270
305
|
{!c.login_node && <Badge ml={2} size="xs" variant="outline">data mover</Badge>}
|
|
271
306
|
</Table.Cell>
|
|
272
|
-
<Table.Cell><MasterBadge
|
|
307
|
+
<Table.Cell><MasterBadge connection={c} /></Table.Cell>
|
|
273
308
|
<Table.Cell textAlign="end">
|
|
274
309
|
<Button
|
|
275
310
|
size="xs"
|
|
@@ -308,9 +343,17 @@ export const SshConnectButton: React.FC = () => {
|
|
|
308
343
|
retry: false,
|
|
309
344
|
});
|
|
310
345
|
const logins = (data?.hosts || []).filter(h => h.login_node);
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
const
|
|
346
|
+
const connected = logins.filter(isConnected).length;
|
|
347
|
+
// jobs running without a connection: the button asks for a login (one cluster: straight to it)
|
|
348
|
+
const paused = logins.filter(needsLogin);
|
|
349
|
+
const reconnect = paused.length === 1 ? paused[0].cluster : null;
|
|
350
|
+
|
|
351
|
+
const dot = (color: string) => <Box as="span" w="8px" h="8px" borderRadius="full" flexShrink={0} bg={color} />;
|
|
352
|
+
const title = !data
|
|
353
|
+
? 'Open the ssh connections of the clusters'
|
|
354
|
+
: paused.length > 0
|
|
355
|
+
? `Jobs are running on ${paused.map(p => p.cluster).join(', ')} without a connection: their sync is paused. Log in to resume it.`
|
|
356
|
+
: `${connected} of ${logins.length} clusters connected`;
|
|
314
357
|
|
|
315
358
|
return (
|
|
316
359
|
<>
|
|
@@ -319,14 +362,17 @@ export const SshConnectButton: React.FC = () => {
|
|
|
319
362
|
variant="outline"
|
|
320
363
|
borderRadius="full"
|
|
321
364
|
onClick={() => setOpen(true)}
|
|
322
|
-
title={
|
|
323
|
-
|
|
324
|
-
: 'Open the ssh connections of the clusters'}
|
|
365
|
+
title={title}
|
|
366
|
+
borderColor={paused.length > 0 ? 'var(--color-status-pending)' : undefined}
|
|
325
367
|
>
|
|
326
|
-
{
|
|
368
|
+
{paused.length > 0 ? (
|
|
369
|
+
<>
|
|
370
|
+
{dot('var(--color-status-pending)')}
|
|
371
|
+
{reconnect ? `Reconnect ${reconnect}` : `Reconnect ${paused.length} clusters`}
|
|
372
|
+
</>
|
|
373
|
+
) : connected > 0 ? (
|
|
327
374
|
<>
|
|
328
|
-
|
|
329
|
-
bg="var(--color-status-running, #22c55e)" />
|
|
375
|
+
{dot('var(--color-status-running)')}
|
|
330
376
|
{connected} connected
|
|
331
377
|
</>
|
|
332
378
|
) : (
|
|
@@ -336,7 +382,14 @@ export const SshConnectButton: React.FC = () => {
|
|
|
336
382
|
</>
|
|
337
383
|
)}
|
|
338
384
|
</Button>
|
|
339
|
-
<SshConnectDialog
|
|
385
|
+
<SshConnectDialog
|
|
386
|
+
open={open}
|
|
387
|
+
onClose={() => setOpen(false)}
|
|
388
|
+
// one cluster to reconnect: its login starts at once (MFA prompt in the dialog)
|
|
389
|
+
cluster={reconnect}
|
|
390
|
+
purpose="reconnect"
|
|
391
|
+
onConnected={() => setOpen(false)}
|
|
392
|
+
/>
|
|
340
393
|
</>
|
|
341
394
|
);
|
|
342
395
|
};
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { ScheduledJobsView } from './views/ScheduledJobsView';
|
|
|
10
10
|
export { AgentActivityView, AgentBadge, McpHelp } from './views/AgentActivityView';
|
|
11
11
|
export { SettingsView } from './views/SettingsView';
|
|
12
12
|
export { JanitorView } from './views/JanitorView';
|
|
13
|
+
export { SetupView } from './views/SetupView';
|
|
13
14
|
export { LinkableCard, useHashScroll } from './components/LinkableCard';
|
|
14
15
|
export { JobSubmissionForm } from './views/JobSubmit';
|
|
15
16
|
export type { JobSubmissionInitialData } from './views/JobSubmit';
|
package/src/paths.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IconType } from 'react-icons';
|
|
2
|
-
import { LuBot, LuBrush, LuCalendarClock, LuList, LuSend, LuSettings, LuWorkflow } from 'react-icons/lu';
|
|
2
|
+
import { LuBot, LuBrush, LuCalendarClock, LuList, LuRocket, LuSend, LuSettings, LuWorkflow } from 'react-icons/lu';
|
|
3
3
|
|
|
4
4
|
/** Names of the bujang views. */
|
|
5
5
|
export type BujangView =
|
|
@@ -12,6 +12,7 @@ export type BujangView =
|
|
|
12
12
|
| 'scheduled'
|
|
13
13
|
| 'agent'
|
|
14
14
|
| 'janitor'
|
|
15
|
+
| 'setup'
|
|
15
16
|
| 'settings';
|
|
16
17
|
|
|
17
18
|
/** URL builders the views use to link to each other. */
|
|
@@ -33,6 +34,8 @@ export interface BujangPaths {
|
|
|
33
34
|
* `section` links to one card: general, folders, database, ssh, secrets.
|
|
34
35
|
*/
|
|
35
36
|
settings: (section?: string) => string;
|
|
37
|
+
/** First-time setup wizard. `step`: welcome, folders, ssh, connect, first-job, secrets, mcp, next. */
|
|
38
|
+
setup: (step?: string) => string;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
/** Default URL layout (react-router patterns), relative to the host's basePath. */
|
|
@@ -46,6 +49,7 @@ export const defaultRoutePatterns: Record<BujangView, string> = {
|
|
|
46
49
|
scheduled: '/scheduled',
|
|
47
50
|
agent: '/agent',
|
|
48
51
|
janitor: '/janitor',
|
|
52
|
+
setup: '/setup',
|
|
49
53
|
settings: '/settings',
|
|
50
54
|
};
|
|
51
55
|
|
|
@@ -71,6 +75,7 @@ export function createBujangPaths(basePath: string = ''): BujangPaths {
|
|
|
71
75
|
agent: (session) => (session ? `${b}/agent?session=${encodeURIComponent(session)}` : `${b}/agent`),
|
|
72
76
|
janitor: (section) => `${b}/janitor${section ? `#${encodeURIComponent(section)}` : ''}`,
|
|
73
77
|
settings: (section) => `${b}/settings${section ? `#${encodeURIComponent(section)}` : ''}`,
|
|
78
|
+
setup: (step) => `${b}/setup${step ? `#${encodeURIComponent(step)}` : ''}`,
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
81
|
|
|
@@ -85,6 +90,7 @@ export interface BujangNavItem {
|
|
|
85
90
|
/** Sidebar entries for the top-level bujang views. */
|
|
86
91
|
export function bujangNavItems(paths: BujangPaths = createBujangPaths()): BujangNavItem[] {
|
|
87
92
|
return [
|
|
93
|
+
{ view: 'setup', label: 'Setup Guide', path: paths.setup(), icon: LuRocket },
|
|
88
94
|
{ view: 'jobs', label: 'Jobs', path: paths.jobs(), icon: LuList },
|
|
89
95
|
{ view: 'submitJob', label: 'Submit Job', path: paths.submitJob(), icon: LuSend },
|
|
90
96
|
{ view: 'scheduled', label: 'Scheduled Jobs', path: paths.scheduled(), icon: LuCalendarClock },
|
package/src/routes.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import { ScheduledJobsView } from './views/ScheduledJobsView';
|
|
|
11
11
|
import { AgentActivityView } from './views/AgentActivityView';
|
|
12
12
|
import { SettingsView } from './views/SettingsView';
|
|
13
13
|
import { JanitorView } from './views/JanitorView';
|
|
14
|
+
import { SetupView } from './views/SetupView';
|
|
14
15
|
|
|
15
16
|
export interface BujangRoutesOptions {
|
|
16
17
|
/** Prefix the routes are mounted under, e.g. "/slurm". Must match BujangProvider's basePath. Default "". */
|
|
@@ -36,13 +37,14 @@ const elements: Record<BujangView, () => React.ReactElement> = {
|
|
|
36
37
|
scheduled: () => <ScheduledJobsView />,
|
|
37
38
|
agent: () => <AgentActivityView />,
|
|
38
39
|
janitor: () => <JanitorView />,
|
|
40
|
+
setup: () => <SetupView />,
|
|
39
41
|
settings: () => <SettingsView />,
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* Route objects for the default bujang URL layout under `basePath`:
|
|
44
46
|
* /jobs, /jobs/submit, /jobrunner/:slurmJobId/:jrJobId, /joblogs/:slurmJobId/:jrJobId,
|
|
45
|
-
* /pipelines, /pipelines/:pipelineName, /scheduled, /agent, /janitor, /settings.
|
|
47
|
+
* /pipelines, /pipelines/:pipelineName, /scheduled, /agent, /janitor, /setup, /settings.
|
|
46
48
|
*/
|
|
47
49
|
export function bujangRoutes(options: BujangRoutesOptions = {}): BujangRouteObject[] {
|
|
48
50
|
const base = normalizeBasePath(options.basePath);
|
package/src/types.ts
CHANGED
|
@@ -243,6 +243,8 @@ export interface SlurmJobAccounting {
|
|
|
243
243
|
|
|
244
244
|
export interface PersitedJobInfo {
|
|
245
245
|
name: string;
|
|
246
|
+
/** JR_JOB_LABEL of the script (or the label given at submission), resolved: meta/label.txt */
|
|
247
|
+
label?: string | null;
|
|
246
248
|
cluster?: string;
|
|
247
249
|
creation_time: string;
|
|
248
250
|
last_modified: string;
|
|
@@ -340,6 +342,8 @@ export interface PipelineJob {
|
|
|
340
342
|
env?: Record<string, string>;
|
|
341
343
|
// slurm steps: SOCKS proxy to the login node, unset: the cluster's `proxy` setting
|
|
342
344
|
proxy?: boolean;
|
|
345
|
+
/** label template ("train lr={LR}"): names the job, wins over its group's and the script's JR_JOB_LABEL */
|
|
346
|
+
label?: string;
|
|
343
347
|
job_id?: string;
|
|
344
348
|
slurm_jobid?: string;
|
|
345
349
|
// set once the pipeline is submitted
|
|
@@ -401,6 +405,8 @@ export interface PipelineSequential {
|
|
|
401
405
|
type: 'sequential';
|
|
402
406
|
name: string;
|
|
403
407
|
jobs: PipelineNode[];
|
|
408
|
+
/** label template of the jobs under it, resolved with each job's arguments */
|
|
409
|
+
label?: string;
|
|
404
410
|
}
|
|
405
411
|
|
|
406
412
|
export interface PipelineParallel {
|
|
@@ -409,6 +415,8 @@ export interface PipelineParallel {
|
|
|
409
415
|
jobs: PipelineNode[];
|
|
410
416
|
/** display only: the env variable that tells the children apart (e.g. ARGS), shown instead of their script */
|
|
411
417
|
sweep?: string;
|
|
418
|
+
/** label template of the jobs under it, resolved with each job's arguments */
|
|
419
|
+
label?: string;
|
|
412
420
|
}
|
|
413
421
|
|
|
414
422
|
export interface Pipeline {
|
|
@@ -819,6 +827,11 @@ export interface SshConnection {
|
|
|
819
827
|
/** open: connected; no: not connected; none: the ssh config keeps no shared connection for the host */
|
|
820
828
|
master: 'open' | 'no' | 'none';
|
|
821
829
|
login: SshLogin | null;
|
|
830
|
+
/** the cluster has unfinished jobs: the syncs need a connection to it */
|
|
831
|
+
active_jobs: boolean;
|
|
832
|
+
/** without an open connection: what the last sync probe found (null: not probed) */
|
|
833
|
+
reachable: boolean | null;
|
|
834
|
+
reason: string | null;
|
|
822
835
|
}
|
|
823
836
|
|
|
824
837
|
export interface SshConnections {
|
package/src/views/JobsView.tsx
CHANGED
|
@@ -695,7 +695,7 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
695
695
|
|
|
696
696
|
// Use accounting data when available, fallback to info object
|
|
697
697
|
const jobId = acc?.job_id?.toString() || job.job_id || '-';
|
|
698
|
-
const jobName = acc?.name || job.name || job.job_name || 'Persisted Job';
|
|
698
|
+
const jobName = persistedJobInfo.label || acc?.name || job.name || job.job_name || 'Persisted Job';
|
|
699
699
|
const jobStatus = acc?.state?.current?.[0] || job.job_state?.[0] || 'PENDING';
|
|
700
700
|
const partition = acc?.partition || job.partition || 'N/A';
|
|
701
701
|
const user = acc?.user || job.user_name || job.user || 'N/A';
|
|
@@ -61,7 +61,7 @@ import { LinkableCard, Steps, useHashScroll } from '../components/LinkableCard';
|
|
|
61
61
|
import { useBujangPaths } from '../context';
|
|
62
62
|
import { usePageTitle } from '../hooks/usePageTitle';
|
|
63
63
|
|
|
64
|
-
const SETTINGS_KEY = ['bujang-settings'];
|
|
64
|
+
export const SETTINGS_KEY = ['bujang-settings'];
|
|
65
65
|
|
|
66
66
|
const inputStyle = {
|
|
67
67
|
bg: 'var(--color-input-bg)',
|
|
@@ -231,7 +231,7 @@ const GeneralCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
|
231
231
|
|
|
232
232
|
// ─── Folders ────────────────────────────────────────────────────────
|
|
233
233
|
|
|
234
|
-
const FoldersCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
234
|
+
export const FoldersCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
235
235
|
const queryClient = useQueryClient();
|
|
236
236
|
const { local_cache, workdir } = info.fields;
|
|
237
237
|
const initial = useMemo(
|
|
@@ -681,7 +681,7 @@ const SshResults: React.FC<{ results: SshCheckResult[] }> = ({ results }) => (
|
|
|
681
681
|
</Box>
|
|
682
682
|
);
|
|
683
683
|
|
|
684
|
-
const SshCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
684
|
+
export const SshCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
685
685
|
const [fileInput, setFileInput] = useState('');
|
|
686
686
|
const [file, setFile] = useState('');
|
|
687
687
|
const [cluster, setCluster] = useState('');
|
|
@@ -803,7 +803,7 @@ const SshCard: React.FC<{ info: SettingsInfo }> = ({ info }) => {
|
|
|
803
803
|
|
|
804
804
|
const SECRET_NAME = /^\w+$/;
|
|
805
805
|
|
|
806
|
-
const SecretsCard: React.FC<{ writable: boolean }> = ({ writable }) => {
|
|
806
|
+
export const SecretsCard: React.FC<{ writable: boolean }> = ({ writable }) => {
|
|
807
807
|
const queryClient = useQueryClient();
|
|
808
808
|
const { data, isLoading, error } = useQuery<SettingsSecrets>({
|
|
809
809
|
queryKey: ['bujang-settings-secrets'],
|