@milabench/bujang 0.1.1 → 0.1.3
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 +3 -2
- package/dist/api.d.ts +42 -1
- package/dist/context.d.ts +7 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +4258 -2947
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +8 -1
- package/dist/routes.d.ts +1 -1
- package/dist/types.d.ts +288 -0
- package/dist/views/AgentActivityView.d.ts +2 -0
- package/dist/views/JobArtifacts.d.ts +9 -0
- package/dist/views/PipelineEditor.d.ts +24 -0
- package/dist/views/PipelineGraph.d.ts +49 -0
- package/dist/views/PipelinesView.d.ts +3 -0
- package/dist/views/SettingsView.d.ts +3 -0
- package/package.json +4 -1
- package/src/api.ts +147 -0
- package/src/context.tsx +9 -1
- package/src/index.ts +6 -2
- package/src/paths.ts +22 -6
- package/src/routes.tsx +5 -2
- package/src/types.ts +265 -0
- package/src/views/AgentActivityView.tsx +115 -5
- package/src/views/JobArtifacts.tsx +89 -0
- package/src/views/JobDetails.tsx +3 -0
- package/src/views/JobSubmit.tsx +4 -4
- package/src/views/JobsView.tsx +211 -21
- package/src/views/PipelineEditor.tsx +779 -0
- package/src/views/PipelineGraph.tsx +197 -0
- package/src/views/PipelinesView.tsx +363 -1087
- package/src/views/SettingsView.tsx +910 -0
package/README.md
CHANGED
|
@@ -77,11 +77,12 @@ some views). Default layout under `basePath`:
|
|
|
77
77
|
| `jobDetails` | `/jobrunner/:slurmJobId/:jrJobId` |
|
|
78
78
|
| `jobLogs` | `/joblogs/:slurmJobId/:jrJobId` |
|
|
79
79
|
| `pipelines` | `/pipelines` |
|
|
80
|
+
| `pipelineDetails` | `/pipelines/:pipelineName` (`?run=<run id>` shows that run) |
|
|
80
81
|
| `scheduled` | `/scheduled` |
|
|
81
82
|
| `agent` | `/agent` |
|
|
82
83
|
|
|
83
84
|
The views are also exported (`JobsView`, `JobSubmitView`, `JobDetailsView`, `JobLogsView`,
|
|
84
|
-
`PipelinesView`, `ScheduledJobsView`, `AgentActivityView`) if you prefer to declare the routes
|
|
85
|
+
`PipelinesView`, `PipelineDetailsView`, `ScheduledJobsView`, `AgentActivityView`) if you prefer to declare the routes
|
|
85
86
|
yourself. If you change the URLs, pass matching `paths`.
|
|
86
87
|
|
|
87
88
|
## `BujangProvider` props
|
|
@@ -91,7 +92,7 @@ yourself. If you change the URLs, pass matching `paths`.
|
|
|
91
92
|
| `apiBase` | `"/api/slurm"` | Prefix of the bujang HTTP routes. Joined to the axios instance's `baseURL`, e.g. `axios={api}` with `baseURL: '/api'` takes `apiBase="/slurm"`. |
|
|
92
93
|
| `axios` | internal instance (10 s timeout) | Axios instance for every request (auth headers, interceptors). Typed structurally (`BujangHttpClient`: `get` / `post` / `put` / `delete`), so the host's instance fits whatever its axios version. |
|
|
93
94
|
| `basePath` | `""` | Where the views are mounted. Same value as `bujangRoutes({ basePath })`. |
|
|
94
|
-
| `paths` | built from `basePath` | Partial override of the URL builders the views use to link to each other: `jobs()`, `submitJob()`, `jobDetails(slurmJobId, jrJobId)`, `jobLogs(slurmJobId, jrJobId)`, `pipelines()`, `scheduled()`, `agent(session?)`. |
|
|
95
|
+
| `paths` | built from `basePath` | Partial override of the URL builders the views use to link to each other: `jobs()`, `submitJob()`, `jobDetails(slurmJobId, jrJobId)`, `jobLogs(slurmJobId, jrJobId)`, `pipelines()`, `pipelineDetails(name, runId?)`, `scheduled()`, `agent(session?)`. |
|
|
95
96
|
| `toast` | built-in Chakra toaster | `(options: { title, description, type, duration }) => void`. Without it, bujang renders its own `<BujangToaster/>`. |
|
|
96
97
|
| `usePageTitle` | sets `document.title` | Hook called by each view with its title. |
|
|
97
98
|
| `titleSuffix` | `"bujang"` | Suffix of the default title: `"<title> - <suffix>"`. |
|
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 } 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, UpdateResult, SettingsSecrets, SshSettings, SshPlan, SshPlanRequest, SshTestResponse } 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
|
|
@@ -119,6 +119,47 @@ export declare const testSlurmSecret: (name: string) => Promise<{
|
|
|
119
119
|
masked: string;
|
|
120
120
|
} | null>;
|
|
121
121
|
export declare const listSlurmSecrets: () => Promise<string[]>;
|
|
122
|
+
/** Add or replace a secret of the .secrets file. The value is sent once and never returned. */
|
|
123
|
+
export declare const setSlurmSecret: (key: string, value: string) => Promise<{
|
|
124
|
+
success: boolean;
|
|
125
|
+
message?: string;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const deleteSlurmSecret: (name: string) => Promise<{
|
|
128
|
+
success: boolean;
|
|
129
|
+
message?: string;
|
|
130
|
+
}>;
|
|
131
|
+
export declare const getSettings: () => Promise<SettingsInfo>;
|
|
132
|
+
/** Write local_cache / workdir / database_url (null: remove it) to the user file. */
|
|
133
|
+
export declare const updateSettings: (values: Partial<Record<"local_cache" | "workdir" | "database_url", string | null>>) => Promise<SettingsUpdateResponse>;
|
|
134
|
+
/** The files of results/ and output/ of a job folder (reports first). */
|
|
135
|
+
export declare const getJobArtifacts: (jrJobId: string) => Promise<JobArtifacts>;
|
|
136
|
+
/** URL of an artifact, to open in a tab: its relative links (images, scripts) resolve next to it. */
|
|
137
|
+
export declare const jobArtifactUrl: (jrJobId: string, path: string) => string;
|
|
138
|
+
/** When the job index was last synced with the clusters. */
|
|
139
|
+
export declare const getSyncStatus: () => Promise<SyncStatus>;
|
|
140
|
+
/** rsync the clusters with active jobs now and index what changed (can take a few seconds). */
|
|
141
|
+
export declare const syncNow: () => Promise<SyncStatus>;
|
|
142
|
+
/** The organizer folders (clusters/, experiments/, ...): their values and the job ids under each. */
|
|
143
|
+
export declare const getOrganizers: () => Promise<OrganizerGroups[]>;
|
|
144
|
+
/** The running version against PyPI; the server asks PyPI once a day, `force` asks now. */
|
|
145
|
+
export declare const getUpdateCheck: (force?: boolean) => Promise<UpdateCheck>;
|
|
146
|
+
/** Upgrade bujang on the server, which then restarts (403 when read-only, 409 for a source checkout). */
|
|
147
|
+
export declare const installUpdate: () => Promise<UpdateResult>;
|
|
148
|
+
/** Secret names, their source and env shadowing (never the values). */
|
|
149
|
+
export declare const getSettingsSecrets: () => Promise<SettingsSecrets>;
|
|
150
|
+
export declare const getSshSettings: (file?: string) => Promise<SshSettings>;
|
|
151
|
+
/** The diff of an install (default) or remove, nothing written. */
|
|
152
|
+
export declare const planSshConfig: (request: SshPlanRequest & {
|
|
153
|
+
action?: "install" | "remove";
|
|
154
|
+
}) => Promise<SshPlan>;
|
|
155
|
+
export declare const installSshConfig: (request: SshPlanRequest) => Promise<SshPlan>;
|
|
156
|
+
export declare const removeSshConfig: (request: SshPlanRequest) => Promise<SshPlan>;
|
|
157
|
+
/** `bujang ssh test`: read only, never prompts; can take up to ~3 x (timeout + 5) s. */
|
|
158
|
+
export declare const testSshConnections: (request?: {
|
|
159
|
+
clusters?: string[];
|
|
160
|
+
timeout?: number;
|
|
161
|
+
file?: string;
|
|
162
|
+
}) => Promise<SshTestResponse>;
|
|
122
163
|
export declare const getPipelineTemplatesList: () => Promise<string[]>;
|
|
123
164
|
export declare const savePipelineToFile: (pipelineData: PipelineTemplatePayload) => Promise<{
|
|
124
165
|
success?: boolean;
|
package/dist/context.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ export interface BujangProviderProps {
|
|
|
29
29
|
* (e.g. to push job results to a database).
|
|
30
30
|
*/
|
|
31
31
|
pushJobData?: (jrJobId: string) => Promise<PushJobDataResult>;
|
|
32
|
+
/**
|
|
33
|
+
* URL of the MCP endpoint shown on the Agent Activity page (e.g. when the host serves it on
|
|
34
|
+
* its own port). Default: what the server reports, else `<origin>/mcp` when it mounts it.
|
|
35
|
+
*/
|
|
36
|
+
mcpUrl?: string;
|
|
32
37
|
children?: React.ReactNode;
|
|
33
38
|
}
|
|
34
39
|
export interface BujangContextValue {
|
|
@@ -38,7 +43,8 @@ export interface BujangContextValue {
|
|
|
38
43
|
titleSuffix: string;
|
|
39
44
|
colorMode?: 'light' | 'dark';
|
|
40
45
|
pushJobData?: (jrJobId: string) => Promise<PushJobDataResult>;
|
|
46
|
+
mcpUrl?: string;
|
|
41
47
|
}
|
|
42
|
-
export declare function BujangProvider({ apiBase, axios, basePath, paths, toast, usePageTitle, titleSuffix, colorMode, pushJobData, children, }: BujangProviderProps): React.ReactElement;
|
|
48
|
+
export declare function BujangProvider({ apiBase, axios, basePath, paths, toast, usePageTitle, titleSuffix, colorMode, pushJobData, mcpUrl, children, }: BujangProviderProps): React.ReactElement;
|
|
43
49
|
export declare function useBujang(): BujangContextValue;
|
|
44
50
|
export declare function useBujangPaths(): BujangPaths;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,16 @@ export { JobsView } from './views/JobsView';
|
|
|
2
2
|
export { JobSubmitView } from './views/JobSubmitView';
|
|
3
3
|
export { JobDetailsView } from './views/JobDetails';
|
|
4
4
|
export { JobLogsView } from './views/JobLogs';
|
|
5
|
-
export { PipelinesView } from './views/PipelinesView';
|
|
5
|
+
export { PipelinesView, PipelineDetailsView } from './views/PipelinesView';
|
|
6
|
+
export { PipelineGraph, pipelineMermaid, pipelineSteps } from './views/PipelineGraph';
|
|
7
|
+
export type { GraphStep } from './views/PipelineGraph';
|
|
6
8
|
export { ScheduledJobsView } from './views/ScheduledJobsView';
|
|
7
|
-
export { AgentActivityView, AgentBadge } from './views/AgentActivityView';
|
|
9
|
+
export { AgentActivityView, AgentBadge, McpHelp } from './views/AgentActivityView';
|
|
10
|
+
export { SettingsView } from './views/SettingsView';
|
|
8
11
|
export { JobSubmissionForm } from './views/JobSubmit';
|
|
9
12
|
export type { JobSubmissionInitialData } from './views/JobSubmit';
|
|
10
13
|
export { LogDisplay } from './views/LogDisplay';
|
|
14
|
+
export { JobArtifactsCard } from './views/JobArtifacts';
|
|
11
15
|
export { BujangProvider, useBujang, useBujangPaths } from './context';
|
|
12
16
|
export type { BujangProviderProps, BujangContextValue, PushJobDataResult } from './context';
|
|
13
17
|
export { createBujangPaths, defaultRoutePatterns, normalizeBasePath, bujangNavItems } from './paths';
|