@milabench/bujang 0.1.7 → 0.1.9
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 +1 -1
- package/dist/api.d.ts +40 -1
- package/dist/components/LinkableCard.d.ts +27 -0
- package/dist/components/SshConnectDialog.d.ts +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4618 -3593
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +8 -3
- package/dist/routes.d.ts +1 -1
- package/dist/types.d.ts +185 -1
- package/dist/views/JanitorView.d.ts +5 -0
- package/package.json +1 -1
- package/src/api.ts +110 -0
- package/src/components/LinkableCard.tsx +120 -0
- package/src/components/SshConnectDialog.tsx +377 -0
- package/src/index.ts +2 -0
- package/src/paths.ts +13 -4
- package/src/routes.tsx +3 -1
- package/src/types.ts +197 -1
- package/src/views/JanitorView.tsx +693 -0
- package/src/views/JobLogs.tsx +2 -1
- package/src/views/JobSubmit.tsx +139 -13
- package/src/views/JobsView.tsx +5 -62
- package/src/views/PipelineGraph.tsx +33 -3
- package/src/views/SettingsView.tsx +112 -48
package/README.md
CHANGED
|
@@ -106,5 +106,5 @@ use the provider's configuration, or `configureBujangApi({ apiBase, axios })` ou
|
|
|
106
106
|
|
|
107
107
|
`app/` is a minimal app built on the package.
|
|
108
108
|
|
|
109
|
-
- `npm run dev`: runs the app and proxies `/api` to `http://localhost:
|
|
109
|
+
- `npm run dev`: runs the app and proxies `/api` to `http://localhost:8765` (override it with `BUJANG_API`).
|
|
110
110
|
- `npm run build:app`: builds the app into `../bujang/cli/serve/static`, where the default Python server serves it.
|
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SlurmJob, SlurmJobSubmitResponse, SlurmJobAccounting, SlurmJobDetail, SlurmClusterInfo, SlurmProfile, SlurmClusterStatus, PersitedJobInfo, SlurmJobStatusResponse, EarlySyncResponse, PipelineTemplatePayload, PipelineRunResponse, PipelineRunSummary, PipelineRunStatus, ScheduledJob, ScheduledJobRun, ScheduledJobTemplateDiff, AgentEvent, AgentSession, SettingsInfo, SettingsUpdateResponse, UpdateCheck, OrganizerGroups, SyncStatus, JobArtifacts, JobData, JobMarks, UpdateResult, SettingsSecrets, SshSettings, SshPlan, SshPlanRequest, SshTestResponse } from './types';
|
|
1
|
+
import type { SlurmJob, SlurmJobSubmitResponse, SlurmJobAccounting, SlurmJobDetail, SlurmClusterInfo, SlurmProfile, SlurmClusterStatus, PersitedJobInfo, SlurmJobStatusResponse, EarlySyncResponse, PipelineTemplatePayload, PipelineRunResponse, PipelineRunSummary, PipelineRunStatus, ScheduledJob, ScheduledJobRun, ScheduledJobTemplateDiff, AgentEvent, AgentSession, SettingsInfo, SettingsUpdateResponse, UpdateCheck, OrganizerGroups, SyncStatus, JobArtifacts, JobData, JobMarks, UpdateResult, SettingsSecrets, SshSettings, SshPlan, SshPlanRequest, SshTestResponse, SshConnections, SshLogin, JobAttachment, JanitorOverview, JanitorRun, JanitorCleanupInfo, JanitorArchiveResult, JanitorStaleResult } from './types';
|
|
2
2
|
export declare const DEFAULT_API_BASE = "/api/slurm";
|
|
3
3
|
/**
|
|
4
4
|
* What bujang needs from an axios instance. Typed structurally so the host's instance fits even
|
|
@@ -95,6 +95,8 @@ export declare const submitSlurmJob: (request: {
|
|
|
95
95
|
export?: string;
|
|
96
96
|
nodelist?: string;
|
|
97
97
|
dependency?: [string, string][];
|
|
98
|
+
/** Files for the job: <job folder>/input/<name> on the cluster before it starts ($JR_INPUT_DIR). */
|
|
99
|
+
files?: JobAttachment[];
|
|
98
100
|
}) => Promise<SlurmJobSubmitResponse>;
|
|
99
101
|
export declare const getSlurmJobCluster: (jrJobId: string) => Promise<{
|
|
100
102
|
cluster: string;
|
|
@@ -183,6 +185,17 @@ export declare const testSshConnections: (request?: {
|
|
|
183
185
|
timeout?: number;
|
|
184
186
|
file?: string;
|
|
185
187
|
}) => Promise<SshTestResponse>;
|
|
188
|
+
/** The ssh hosts of the clusters and whether their shared connection is open (local check, fast). */
|
|
189
|
+
export declare const getSshConnections: (cluster?: string) => Promise<SshConnections>;
|
|
190
|
+
/** Open the shared connection of a host (or of the login node of `cluster`); poll getSshLogin for the prompts. */
|
|
191
|
+
export declare const startSshLogin: (request: {
|
|
192
|
+
host?: string;
|
|
193
|
+
cluster?: string;
|
|
194
|
+
}) => Promise<SshLogin>;
|
|
195
|
+
export declare const getSshLogin: (id: string) => Promise<SshLogin>;
|
|
196
|
+
/** The answer of the waiting prompt (MFA passcode, ...): handed to ssh, never stored. */
|
|
197
|
+
export declare const answerSshLogin: (id: string, answer: string) => Promise<SshLogin>;
|
|
198
|
+
export declare const cancelSshLogin: (id: string) => Promise<SshLogin>;
|
|
186
199
|
export declare const getPipelineTemplatesList: () => Promise<string[]>;
|
|
187
200
|
export declare const savePipelineToFile: (pipelineData: PipelineTemplatePayload) => Promise<{
|
|
188
201
|
success?: boolean;
|
|
@@ -213,3 +226,29 @@ export declare const getAgentActivity: (params?: {
|
|
|
213
226
|
writes?: boolean;
|
|
214
227
|
limit?: number;
|
|
215
228
|
}) => Promise<AgentEvent[]>;
|
|
229
|
+
/** A browser File as a submission attachment (base64). */
|
|
230
|
+
export declare const fileToAttachment: (file: File, name?: string) => Promise<JobAttachment>;
|
|
231
|
+
export declare const getJanitor: () => Promise<JanitorOverview>;
|
|
232
|
+
export declare const getJanitorHistory: (params?: {
|
|
233
|
+
name?: string;
|
|
234
|
+
kind?: string;
|
|
235
|
+
cluster?: string;
|
|
236
|
+
status?: string;
|
|
237
|
+
since?: number;
|
|
238
|
+
limit?: number;
|
|
239
|
+
}) => Promise<{
|
|
240
|
+
runs: JanitorRun[];
|
|
241
|
+
}>;
|
|
242
|
+
export declare const getJanitorCleanup: () => Promise<JanitorCleanupInfo>;
|
|
243
|
+
export declare const janitorArchive: (body: {
|
|
244
|
+
organizer: string;
|
|
245
|
+
value?: string | null;
|
|
246
|
+
dry_run: boolean;
|
|
247
|
+
}) => Promise<JanitorArchiveResult>;
|
|
248
|
+
export declare const janitorRemoveStale: (body: {
|
|
249
|
+
older_than_days: number;
|
|
250
|
+
dry_run: boolean;
|
|
251
|
+
}) => Promise<JanitorStaleResult>;
|
|
252
|
+
export declare const janitorPrune: () => Promise<{
|
|
253
|
+
removed: number;
|
|
254
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Scroll to the card named by the URL hash (/settings#ssh) once the page has its content
|
|
4
|
+
* (`ready`), and again when the hash changes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useHashScroll(ready?: boolean): void;
|
|
7
|
+
/**
|
|
8
|
+
* A card with an anchor: `id` is its URL hash (/settings#ssh). The link button next to the title
|
|
9
|
+
* goes there and copies the full link, to give someone the card itself. The card the URL names is
|
|
10
|
+
* outlined.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LinkableCard: React.FC<{
|
|
13
|
+
id: string;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
title: string;
|
|
16
|
+
subtitle?: React.ReactNode;
|
|
17
|
+
actions?: React.ReactNode;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
/** Numbered steps of a how-to (a card that walks someone through a setup). */
|
|
21
|
+
export declare const Steps: React.FC<{
|
|
22
|
+
steps: {
|
|
23
|
+
title: React.ReactNode;
|
|
24
|
+
body?: React.ReactNode;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
27
|
+
export default LinkableCard;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SshConnection } from '../types';
|
|
3
|
+
export declare const SSH_CONNECTIONS_KEY: string[];
|
|
4
|
+
/** The state of a host's shared connection as a badge */
|
|
5
|
+
export declare const MasterBadge: React.FC<{
|
|
6
|
+
master: SshConnection['master'];
|
|
7
|
+
}>;
|
|
8
|
+
export interface SshConnectDialogProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** Start the login to this cluster's login node right away (submit to a cluster not connected yet) */
|
|
12
|
+
cluster?: string | null;
|
|
13
|
+
/** The login to `cluster` succeeded: the dialog closes itself */
|
|
14
|
+
onConnected?: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Open the shared ssh connection (ControlMaster) of the clusters: the hosts and their state, a
|
|
18
|
+
* Connect button each; the prompts of ssh (MFA passcode / Duo option, password, host key) are
|
|
19
|
+
* answered here. Every other ssh of bujang reuses the connection and never prompts.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SshConnectDialog: React.FC<SshConnectDialogProps>;
|
|
22
|
+
/** The "Connect" button of the jobs page: how many clusters are connected, opens SshConnectDialog */
|
|
23
|
+
export declare const SshConnectButton: React.FC;
|
|
24
|
+
/**
|
|
25
|
+
* Before a submit: when the cluster's login node has no open connection, ask for a login first.
|
|
26
|
+
* `ensure(cluster, go)` runs `go` now, or once the login dialog succeeded; render `dialog`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const useSshConnectGate: () => {
|
|
29
|
+
ensure: (name: string, go: () => void) => Promise<void>;
|
|
30
|
+
dialog: React.JSX.Element;
|
|
31
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type { GraphStep } from './views/PipelineGraph';
|
|
|
8
8
|
export { ScheduledJobsView } from './views/ScheduledJobsView';
|
|
9
9
|
export { AgentActivityView, AgentBadge, McpHelp } from './views/AgentActivityView';
|
|
10
10
|
export { SettingsView } from './views/SettingsView';
|
|
11
|
+
export { JanitorView } from './views/JanitorView';
|
|
12
|
+
export { LinkableCard, useHashScroll } from './components/LinkableCard';
|
|
11
13
|
export { JobSubmissionForm } from './views/JobSubmit';
|
|
12
14
|
export type { JobSubmissionInitialData } from './views/JobSubmit';
|
|
13
15
|
export { LogDisplay } from './views/LogDisplay';
|