@milabench/bujang 0.1.8 → 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/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, JobAttachment, JanitorOverview, JanitorRun, JanitorCleanupInfo, JanitorArchiveResult, JanitorStaleResult } 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
@@ -185,6 +185,17 @@ export declare const testSshConnections: (request?: {
185
185
  timeout?: number;
186
186
  file?: string;
187
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>;
188
199
  export declare const getPipelineTemplatesList: () => Promise<string[]>;
189
200
  export declare const savePipelineToFile: (pipelineData: PipelineTemplatePayload) => Promise<{
190
201
  success?: boolean;
@@ -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
+ };