@milabench/bujang 0.1.2 → 0.1.4
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 +65 -1
- package/dist/context.d.ts +5 -10
- package/dist/index.d.ts +8 -3
- package/dist/index.js +4750 -2910
- 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 +332 -0
- package/dist/views/AgentActivityView.d.ts +2 -0
- package/dist/views/JobArtifacts.d.ts +9 -0
- package/dist/views/JobDataOverview.d.ts +9 -0
- package/dist/views/JobMarks.d.ts +17 -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 +7 -1
- package/src/api.ts +206 -0
- package/src/context.tsx +7 -13
- package/src/index.ts +8 -3
- package/src/paths.ts +22 -6
- package/src/routes.tsx +5 -2
- package/src/types.ts +307 -0
- package/src/views/AgentActivityView.tsx +115 -5
- package/src/views/JobArtifacts.tsx +89 -0
- package/src/views/JobDataOverview.tsx +594 -0
- package/src/views/JobDetails.tsx +3 -0
- package/src/views/JobLogs.tsx +47 -162
- package/src/views/JobMarks.tsx +233 -0
- package/src/views/JobSubmit.tsx +4 -4
- package/src/views/JobsView.tsx +245 -54
- 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/dist/paths.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { IconType } from 'react-icons';
|
|
1
2
|
/** Names of the bujang views. */
|
|
2
|
-
export type BujangView = 'jobs' | 'submitJob' | 'jobDetails' | 'jobLogs' | 'pipelines' | 'scheduled' | 'agent';
|
|
3
|
+
export type BujangView = 'jobs' | 'submitJob' | 'jobDetails' | 'jobLogs' | 'pipelines' | 'pipelineDetails' | 'scheduled' | 'agent' | 'settings';
|
|
3
4
|
/** URL builders the views use to link to each other. */
|
|
4
5
|
export interface BujangPaths {
|
|
5
6
|
jobs: () => string;
|
|
@@ -7,9 +8,13 @@ export interface BujangPaths {
|
|
|
7
8
|
jobDetails: (slurmJobId: string | number, jrJobId: string) => string;
|
|
8
9
|
jobLogs: (slurmJobId: string | number, jrJobId: string) => string;
|
|
9
10
|
pipelines: () => string;
|
|
11
|
+
/** One saved pipeline: its graph and its runs, `runId` shows that run. */
|
|
12
|
+
pipelineDetails: (name: string, runId?: string) => string;
|
|
10
13
|
scheduled: () => string;
|
|
11
14
|
/** Agent activity, optionally filtered on one session. */
|
|
12
15
|
agent: (session?: string) => string;
|
|
16
|
+
/** Settings: folders, database, SSH, secrets (read-only unless the server allows edits). */
|
|
17
|
+
settings: () => string;
|
|
13
18
|
}
|
|
14
19
|
/** Default URL layout (react-router patterns), relative to the host's basePath. */
|
|
15
20
|
export declare const defaultRoutePatterns: Record<BujangView, string>;
|
|
@@ -21,6 +26,8 @@ export interface BujangNavItem {
|
|
|
21
26
|
view: BujangView;
|
|
22
27
|
label: string;
|
|
23
28
|
path: string;
|
|
29
|
+
/** Icon of the entry (a react-icons component); optional, hosts can ignore it. */
|
|
30
|
+
icon?: IconType;
|
|
24
31
|
}
|
|
25
32
|
/** Sidebar entries for the top-level bujang views. */
|
|
26
33
|
export declare function bujangNavItems(paths?: BujangPaths): BujangNavItem[];
|
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, /scheduled, /agent.
|
|
18
|
+
* /pipelines, /pipelines/:pipelineName, /scheduled, /agent, /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
|
@@ -225,6 +225,20 @@ export interface PersitedJobInfo {
|
|
|
225
225
|
acc: SlurmJobAccounting;
|
|
226
226
|
/** Submitted by an agent through the MCP server */
|
|
227
227
|
agent?: AgentTag | null;
|
|
228
|
+
/** Marked important by the user */
|
|
229
|
+
important?: boolean;
|
|
230
|
+
/** The manual groups of the job (groups/<group>/<job id>) */
|
|
231
|
+
groups?: string[];
|
|
232
|
+
}
|
|
233
|
+
/** GET/POST /jobs/<jr>/marks: whether a job is important, its groups, every group, git */
|
|
234
|
+
export interface JobMarks {
|
|
235
|
+
jr_job_id: string;
|
|
236
|
+
important: boolean;
|
|
237
|
+
groups: string[];
|
|
238
|
+
/** every group known, with its number of jobs */
|
|
239
|
+
all_groups: Record<string, number>;
|
|
240
|
+
/** the local cache is in a git repository: the job folder can be committed */
|
|
241
|
+
git: boolean;
|
|
228
242
|
}
|
|
229
243
|
export interface SlurmPartition {
|
|
230
244
|
partition: string;
|
|
@@ -295,6 +309,8 @@ export interface PipelineRunResponse {
|
|
|
295
309
|
success: boolean;
|
|
296
310
|
run_id: string;
|
|
297
311
|
name: string;
|
|
312
|
+
/** the saved pipeline it was started from (null for a definition sent as is) */
|
|
313
|
+
template?: string | null;
|
|
298
314
|
}
|
|
299
315
|
/** submitting: the jobs are being submitted; failed: the submission failed (nothing runs) */
|
|
300
316
|
export type PipelineSubmissionStatus = 'submitting' | 'submitted' | 'failed';
|
|
@@ -302,6 +318,8 @@ export type PipelineSubmissionStatus = 'submitting' | 'submitted' | 'failed';
|
|
|
302
318
|
export interface PipelineRunSummary {
|
|
303
319
|
run_id: string;
|
|
304
320
|
name: string;
|
|
321
|
+
/** the saved pipeline it was started from; runs older than this field have none */
|
|
322
|
+
template?: string | null;
|
|
305
323
|
started: number;
|
|
306
324
|
status: PipelineSubmissionStatus;
|
|
307
325
|
error?: string | null;
|
|
@@ -309,6 +327,10 @@ export interface PipelineRunSummary {
|
|
|
309
327
|
/** A step of a run with its current state (sacct/squeue state, HELD, or the ssh step state) */
|
|
310
328
|
export interface PipelineRunStep extends PipelineJob {
|
|
311
329
|
step?: string;
|
|
330
|
+
/** the value of the sweep variable of its parallel group (what tells it apart from its siblings) */
|
|
331
|
+
sweep?: string;
|
|
332
|
+
/** the env variable `sweep` is the value of */
|
|
333
|
+
sweep_key?: string;
|
|
312
334
|
after?: string[];
|
|
313
335
|
held?: boolean;
|
|
314
336
|
state?: string;
|
|
@@ -322,6 +344,8 @@ export interface PipelineRunStatus {
|
|
|
322
344
|
state?: 'running' | 'failing' | 'failed' | 'completed' | 'unknown';
|
|
323
345
|
steps?: PipelineRunStep[];
|
|
324
346
|
log?: string;
|
|
347
|
+
/** the definition the run was started with (the saved pipeline may have changed since) */
|
|
348
|
+
definition?: PipelineNode | null;
|
|
325
349
|
}
|
|
326
350
|
export interface PipelineSequential {
|
|
327
351
|
type: 'sequential';
|
|
@@ -332,6 +356,8 @@ export interface PipelineParallel {
|
|
|
332
356
|
type: 'parallel';
|
|
333
357
|
name: string;
|
|
334
358
|
jobs: PipelineNode[];
|
|
359
|
+
/** display only: the env variable that tells the children apart (e.g. ARGS), shown instead of their script */
|
|
360
|
+
sweep?: string;
|
|
335
361
|
}
|
|
336
362
|
export interface Pipeline {
|
|
337
363
|
type: 'pipeline';
|
|
@@ -369,6 +395,7 @@ export interface PipelineTemplate {
|
|
|
369
395
|
export interface PipelineTemplatePayload {
|
|
370
396
|
name: string;
|
|
371
397
|
type: 'pipeline';
|
|
398
|
+
description?: string;
|
|
372
399
|
definition: PipelineNode;
|
|
373
400
|
job_id: string | null;
|
|
374
401
|
}
|
|
@@ -472,3 +499,308 @@ export interface AgentSession {
|
|
|
472
499
|
pipelines: string[];
|
|
473
500
|
last_note: string | null;
|
|
474
501
|
}
|
|
502
|
+
/** Where a value comes from: env var, a config source (plugin / user file), the default or the host's code. */
|
|
503
|
+
export interface SettingsOrigin {
|
|
504
|
+
kind: 'env' | 'default' | 'code' | 'workdir' | 'plugin' | 'user' | 'explicit' | 'defaults' | string;
|
|
505
|
+
name: string;
|
|
506
|
+
path: string | null;
|
|
507
|
+
}
|
|
508
|
+
/** One editable field of the user file (local_cache, workdir, database_url). */
|
|
509
|
+
export interface SettingsField {
|
|
510
|
+
/** Value the running server uses (database_url: password masked). */
|
|
511
|
+
value: string | null;
|
|
512
|
+
/** Value in the user file, null when absent. */
|
|
513
|
+
file: string | null;
|
|
514
|
+
origin: SettingsOrigin;
|
|
515
|
+
/** Name of the BUJANG_* variable when it is set (it wins over the file). */
|
|
516
|
+
env: string | null;
|
|
517
|
+
/** Something above the user file sets it (env, code, another source): the file has no effect. */
|
|
518
|
+
overridden: boolean;
|
|
519
|
+
/** Only read at startup. */
|
|
520
|
+
restart: boolean;
|
|
521
|
+
/** The file differs from the running value and will apply after a restart. */
|
|
522
|
+
pending: boolean;
|
|
523
|
+
editable: boolean;
|
|
524
|
+
reason: string | null;
|
|
525
|
+
}
|
|
526
|
+
export type SettingsFieldName = 'local_cache' | 'workdir' | 'database_url';
|
|
527
|
+
export interface SettingsCluster {
|
|
528
|
+
name: string;
|
|
529
|
+
ssh: string;
|
|
530
|
+
remote_folder: string;
|
|
531
|
+
origin: SettingsOrigin;
|
|
532
|
+
}
|
|
533
|
+
export interface SettingsDatabaseTable {
|
|
534
|
+
name: string;
|
|
535
|
+
exists: boolean;
|
|
536
|
+
rows: number | null;
|
|
537
|
+
}
|
|
538
|
+
export interface SettingsDatabase {
|
|
539
|
+
host_provided: boolean;
|
|
540
|
+
kind: 'engine' | 'sessionmaker' | 'callable' | 'url' | null;
|
|
541
|
+
/** Password masked. */
|
|
542
|
+
url: string | null;
|
|
543
|
+
backend: string | null;
|
|
544
|
+
sqlite_path: string | null;
|
|
545
|
+
host: string | null;
|
|
546
|
+
name: string | null;
|
|
547
|
+
editable: boolean;
|
|
548
|
+
enabled: boolean;
|
|
549
|
+
tables: SettingsDatabaseTable[];
|
|
550
|
+
error: string | null;
|
|
551
|
+
}
|
|
552
|
+
export interface SettingsMcp {
|
|
553
|
+
/** Served by this app itself (bujang serve), at `path`. */
|
|
554
|
+
mounted: boolean;
|
|
555
|
+
path: string | null;
|
|
556
|
+
/** Absolute URL the server knows (BUJANG_URL, BujangConfig.mcp_url, serve_in_background). */
|
|
557
|
+
url: string | null;
|
|
558
|
+
/** Turned off (--no-mcp). */
|
|
559
|
+
disabled: boolean;
|
|
560
|
+
}
|
|
561
|
+
export interface SettingsGeneral {
|
|
562
|
+
version: string;
|
|
563
|
+
plugins: {
|
|
564
|
+
name: string;
|
|
565
|
+
version: string | null;
|
|
566
|
+
ssh_config: boolean;
|
|
567
|
+
}[];
|
|
568
|
+
default_cluster: string | null;
|
|
569
|
+
clusters: string[];
|
|
570
|
+
server: {
|
|
571
|
+
standalone: boolean;
|
|
572
|
+
host: string | null;
|
|
573
|
+
url: string | null;
|
|
574
|
+
};
|
|
575
|
+
mcp: SettingsMcp;
|
|
576
|
+
}
|
|
577
|
+
export interface ConfigSourceInfo {
|
|
578
|
+
kind: string;
|
|
579
|
+
name: string;
|
|
580
|
+
path: string | null;
|
|
581
|
+
}
|
|
582
|
+
export interface SettingsInfo {
|
|
583
|
+
writable: boolean;
|
|
584
|
+
read_only_reason: string | null;
|
|
585
|
+
user_file: {
|
|
586
|
+
path: string | null;
|
|
587
|
+
exists: boolean;
|
|
588
|
+
user_config_dir: string | null;
|
|
589
|
+
error: string | null;
|
|
590
|
+
};
|
|
591
|
+
fields: Record<SettingsFieldName, SettingsField>;
|
|
592
|
+
secrets_file: string;
|
|
593
|
+
clusters: SettingsCluster[];
|
|
594
|
+
sources: {
|
|
595
|
+
sources: ConfigSourceInfo[];
|
|
596
|
+
plugins: {
|
|
597
|
+
name: string;
|
|
598
|
+
config_dir: string;
|
|
599
|
+
version: string | null;
|
|
600
|
+
ssh_config: string | null;
|
|
601
|
+
}[];
|
|
602
|
+
clusters: Record<string, {
|
|
603
|
+
source: ConfigSourceInfo;
|
|
604
|
+
sources: ConfigSourceInfo[];
|
|
605
|
+
}>;
|
|
606
|
+
profiles: Record<string, {
|
|
607
|
+
source: ConfigSourceInfo;
|
|
608
|
+
}>;
|
|
609
|
+
scripts: string[];
|
|
610
|
+
};
|
|
611
|
+
database: SettingsDatabase;
|
|
612
|
+
general: SettingsGeneral;
|
|
613
|
+
}
|
|
614
|
+
export interface SettingsUpdateResponse {
|
|
615
|
+
written: {
|
|
616
|
+
path: string;
|
|
617
|
+
keys: string[];
|
|
618
|
+
} | null;
|
|
619
|
+
applied: string[];
|
|
620
|
+
restart: string[];
|
|
621
|
+
settings: SettingsInfo;
|
|
622
|
+
}
|
|
623
|
+
export interface SettingsSecret {
|
|
624
|
+
name: string;
|
|
625
|
+
source: 'file' | 'toml';
|
|
626
|
+
/** An environment variable of the same name wins over the file. */
|
|
627
|
+
env_shadowed: boolean;
|
|
628
|
+
}
|
|
629
|
+
export interface SettingsSecrets {
|
|
630
|
+
secrets: SettingsSecret[];
|
|
631
|
+
/** The .secrets file the set / delete routes write (null: secrets.toml is used). */
|
|
632
|
+
file: string | null;
|
|
633
|
+
editable: boolean;
|
|
634
|
+
providers: {
|
|
635
|
+
kind: string;
|
|
636
|
+
name: string;
|
|
637
|
+
available: boolean;
|
|
638
|
+
}[];
|
|
639
|
+
}
|
|
640
|
+
export interface SshPluginStatus {
|
|
641
|
+
name: string;
|
|
642
|
+
version: string | null;
|
|
643
|
+
ssh_config: string;
|
|
644
|
+
placeholders: string[];
|
|
645
|
+
aliases: string[];
|
|
646
|
+
installed: boolean;
|
|
647
|
+
installed_version: string | null;
|
|
648
|
+
up_to_date: boolean | null;
|
|
649
|
+
/** Placeholder values remembered in the block. */
|
|
650
|
+
values: Record<string, string>;
|
|
651
|
+
line: number | null;
|
|
652
|
+
duplicates: number;
|
|
653
|
+
/** Host entries outside the block with the same alias (ssh uses the first one). */
|
|
654
|
+
conflicts: {
|
|
655
|
+
alias: string;
|
|
656
|
+
line: number;
|
|
657
|
+
text: string;
|
|
658
|
+
}[];
|
|
659
|
+
}
|
|
660
|
+
export interface SshSettings {
|
|
661
|
+
file: string;
|
|
662
|
+
default_file: string;
|
|
663
|
+
exists: boolean;
|
|
664
|
+
plugins: SshPluginStatus[];
|
|
665
|
+
other_blocks: {
|
|
666
|
+
name: string;
|
|
667
|
+
version: string | null;
|
|
668
|
+
}[];
|
|
669
|
+
error: string | null;
|
|
670
|
+
writable: boolean;
|
|
671
|
+
}
|
|
672
|
+
export interface SshPlanRequest {
|
|
673
|
+
file?: string;
|
|
674
|
+
plugins?: string[];
|
|
675
|
+
values?: Record<string, string>;
|
|
676
|
+
dedupe?: boolean;
|
|
677
|
+
/** Install / remove: the `base` of the preview; the server refuses when the file changed since. */
|
|
678
|
+
base?: string;
|
|
679
|
+
}
|
|
680
|
+
export interface SshPlan {
|
|
681
|
+
file: string;
|
|
682
|
+
action: 'install' | 'remove';
|
|
683
|
+
changed: boolean;
|
|
684
|
+
diff: string;
|
|
685
|
+
messages: string[];
|
|
686
|
+
warnings: string[];
|
|
687
|
+
aliases: string[];
|
|
688
|
+
base: string;
|
|
689
|
+
backup?: string | null;
|
|
690
|
+
written?: boolean;
|
|
691
|
+
alias_failures?: string[];
|
|
692
|
+
}
|
|
693
|
+
export interface SshCheckResult {
|
|
694
|
+
host: string;
|
|
695
|
+
cluster: string;
|
|
696
|
+
ok: boolean;
|
|
697
|
+
ssh: 'ok' | 'auth' | 'hostkey' | 'dns' | 'timeout' | 'refused' | 'unreachable' | 'jump' | 'error' | '?';
|
|
698
|
+
master: string;
|
|
699
|
+
slurm: string;
|
|
700
|
+
workdir: string;
|
|
701
|
+
latency: number | null;
|
|
702
|
+
remote_hostname: string | null;
|
|
703
|
+
message: string;
|
|
704
|
+
hints: string[];
|
|
705
|
+
}
|
|
706
|
+
export interface SshTestResponse {
|
|
707
|
+
ok: boolean;
|
|
708
|
+
timeout: number;
|
|
709
|
+
file: string | null;
|
|
710
|
+
results: SshCheckResult[];
|
|
711
|
+
}
|
|
712
|
+
/** GET /update: the running version against the latest release on PyPI (checked once a day). */
|
|
713
|
+
export interface UpdateCheck {
|
|
714
|
+
/** BUJANG_UPDATE_CHECK=0 turns the check off */
|
|
715
|
+
enabled: boolean;
|
|
716
|
+
current: string;
|
|
717
|
+
latest: string | null;
|
|
718
|
+
update_available: boolean;
|
|
719
|
+
/** unix time of the last PyPI request */
|
|
720
|
+
checked_at: number | null;
|
|
721
|
+
error: string | null;
|
|
722
|
+
install: {
|
|
723
|
+
kind: 'editable' | 'uv-tool' | 'pip' | 'uv-pip' | 'unknown';
|
|
724
|
+
command: string[] | null;
|
|
725
|
+
hint: string | null;
|
|
726
|
+
};
|
|
727
|
+
/** POST /update works here (writable standalone server with a known installer) */
|
|
728
|
+
can_update: boolean;
|
|
729
|
+
reason: string | null;
|
|
730
|
+
running: boolean;
|
|
731
|
+
}
|
|
732
|
+
/** POST /update */
|
|
733
|
+
export interface UpdateResult {
|
|
734
|
+
success: boolean;
|
|
735
|
+
command: string[];
|
|
736
|
+
output: string;
|
|
737
|
+
previous: string;
|
|
738
|
+
installed?: string | null;
|
|
739
|
+
/** the server stops and starts the new version */
|
|
740
|
+
restarting?: boolean;
|
|
741
|
+
}
|
|
742
|
+
/** GET /organizers: per organizer folder (clusters, experiments, ...), its values and the jobs under each */
|
|
743
|
+
export interface OrganizerGroups {
|
|
744
|
+
name: string;
|
|
745
|
+
groups: {
|
|
746
|
+
value: string;
|
|
747
|
+
jobs: string[];
|
|
748
|
+
}[];
|
|
749
|
+
}
|
|
750
|
+
/** GET /jobs/<jr>/artifacts: the files of the artifact folders of a job (output/, runs/, results/) */
|
|
751
|
+
export interface JobArtifacts {
|
|
752
|
+
jr_job_id: string;
|
|
753
|
+
folders: string[];
|
|
754
|
+
files: {
|
|
755
|
+
path: string;
|
|
756
|
+
size: number;
|
|
757
|
+
mtime: number;
|
|
758
|
+
media_type: string;
|
|
759
|
+
report: boolean;
|
|
760
|
+
}[];
|
|
761
|
+
truncated: boolean;
|
|
762
|
+
/** HTML reports run sandboxed: their scripts cannot reach the bujang API */
|
|
763
|
+
sandboxed: boolean;
|
|
764
|
+
}
|
|
765
|
+
/** A field of the rows of an event of a JSONL file (dotted name for nested values: gpudata.0.power) */
|
|
766
|
+
export interface JobDataField {
|
|
767
|
+
name: string;
|
|
768
|
+
type: 'number' | 'string' | 'boolean' | 'mixed';
|
|
769
|
+
count: number;
|
|
770
|
+
min?: number;
|
|
771
|
+
max?: number;
|
|
772
|
+
/** distinct values of a string field, null when there are too many */
|
|
773
|
+
values?: string[] | null;
|
|
774
|
+
}
|
|
775
|
+
/** GET /jobs/<jr>/data: the JSONL files of the artifact folders of a job and their schema */
|
|
776
|
+
export interface JobData {
|
|
777
|
+
jr_job_id: string;
|
|
778
|
+
folders: string[];
|
|
779
|
+
files: {
|
|
780
|
+
path: string;
|
|
781
|
+
size?: number;
|
|
782
|
+
mtime?: number;
|
|
783
|
+
rows?: number;
|
|
784
|
+
/** per event ("" for the records without an event envelope), its row count and fields */
|
|
785
|
+
events?: {
|
|
786
|
+
event: string;
|
|
787
|
+
count: number;
|
|
788
|
+
truncated: boolean;
|
|
789
|
+
fields: JobDataField[];
|
|
790
|
+
}[];
|
|
791
|
+
error?: string;
|
|
792
|
+
}[];
|
|
793
|
+
truncated: boolean;
|
|
794
|
+
}
|
|
795
|
+
/** GET /sync: when the job index was last synced with the clusters (POST /sync adds `synced`) */
|
|
796
|
+
export interface SyncStatus {
|
|
797
|
+
/** unix time of the last background sync, null before the first one */
|
|
798
|
+
last: number | null;
|
|
799
|
+
scanned: number | null;
|
|
800
|
+
clusters: Record<string, number | null>;
|
|
801
|
+
/** seconds between two background syncs, null when the server does not run them */
|
|
802
|
+
interval: number | null;
|
|
803
|
+
jobs: number;
|
|
804
|
+
synced?: Record<string, boolean>;
|
|
805
|
+
skipped?: string;
|
|
806
|
+
}
|
|
@@ -4,5 +4,7 @@ import type { AgentTag } from '../types';
|
|
|
4
4
|
export declare const AgentBadge: React.FC<{
|
|
5
5
|
tag?: AgentTag | null;
|
|
6
6
|
}>;
|
|
7
|
+
/** How to connect an agent to the MCP endpoint (hidden when the server does not say where it is). */
|
|
8
|
+
export declare const McpHelp: React.FC;
|
|
7
9
|
export declare const AgentActivityView: React.FC;
|
|
8
10
|
export default AgentActivityView;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The reports and other files of a job's results/ and output/ folders, delivered by the server:
|
|
4
|
+
* an HTML report opens in a new tab (its images and scripts load next to it), the rest downloads.
|
|
5
|
+
* Nothing is shown when the job has none.
|
|
6
|
+
*/
|
|
7
|
+
export declare const JobArtifactsCard: React.FC<{
|
|
8
|
+
jrJobId: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The Overview tab of a job: the JSONL files of its artifact folders (output/, runs/, results/)
|
|
4
|
+
* plotted with Vega-Lite. A builder writes the spec; the spec can be edited by hand, and is shown
|
|
5
|
+
* with the rows URL as an Altair snippet.
|
|
6
|
+
*/
|
|
7
|
+
export declare const JobDataOverview: React.FC<{
|
|
8
|
+
jrJobId: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Star toggle: mark the job important (kept in its meta folder, shown on the jobs page) */
|
|
3
|
+
export declare const JobImportantButton: React.FC<{
|
|
4
|
+
jrJobId: string;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* "Groups" button and its dialog: add the job to existing groups or a new one
|
|
8
|
+
* (groups/<group>/<job id>), and commit the job folder when the local cache is a git repository.
|
|
9
|
+
*/
|
|
10
|
+
export declare const JobGroupsButton: React.FC<{
|
|
11
|
+
jrJobId: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** Star of a job in a list: click to toggle */
|
|
14
|
+
export declare const JobImportantStar: React.FC<{
|
|
15
|
+
jrJobId: string;
|
|
16
|
+
important: boolean;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PipelineNode, PipelineTemplatePayload, SlurmProfile } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* A pipeline file (`{ type: 'pipeline', name, description, definition, job_id }`); the older
|
|
5
|
+
* `pipelineName` / `rootNode` fields are read for template files written before the server format.
|
|
6
|
+
*/
|
|
7
|
+
export interface PipelineTemplateFileData {
|
|
8
|
+
type?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
definition?: PipelineNode;
|
|
12
|
+
job_id?: string | null;
|
|
13
|
+
pipelineName?: string;
|
|
14
|
+
rootNode?: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** The pipeline editor: a compact tree on the left, the selected step on the right */
|
|
17
|
+
export declare const PipelineBuilder: React.FC<{
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
profiles: SlurmProfile[];
|
|
21
|
+
templates: string[];
|
|
22
|
+
loadedTemplateData?: PipelineTemplateFileData | null;
|
|
23
|
+
onSaveTemplate: (data: PipelineTemplatePayload) => void;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PipelineNode } from '../types';
|
|
3
|
+
/** A job of the graph: its step label (the same as the server's, `0.prepare`, `1.runs/0.a`) and what it waits on */
|
|
4
|
+
export interface GraphStep {
|
|
5
|
+
id: string;
|
|
6
|
+
step: string;
|
|
7
|
+
script: string;
|
|
8
|
+
profile: string;
|
|
9
|
+
/** what the step sets (its "env"): tells apart the steps of one script */
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
after: string[];
|
|
12
|
+
/** the sweep variable of its parallel group (nearest one) and its value: what tells it apart from its siblings */
|
|
13
|
+
sweepKey?: string;
|
|
14
|
+
sweep?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The sweep variable of a parallel group: its `sweep`, else the env variable every job of the group sets,
|
|
18
|
+
* each to another value (the first one in the order of the first job; the server guesses the same way)
|
|
19
|
+
*/
|
|
20
|
+
export declare const groupSweepKey: (group: PipelineNode) => string | undefined;
|
|
21
|
+
/** The value of the sweep variable `key` for a job, undefined when the job does not set it */
|
|
22
|
+
export declare const sweepValue: (env: Record<string, string> | undefined, key: string | undefined) => string | undefined;
|
|
23
|
+
interface Group {
|
|
24
|
+
id: string;
|
|
25
|
+
kind: 'sequential' | 'parallel';
|
|
26
|
+
name: string;
|
|
27
|
+
steps: string[];
|
|
28
|
+
groups: Group[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The steps of a definition with their dependencies (sequential: each child waits on the one before;
|
|
32
|
+
* parallel: the children share the dependencies, the next node waits on all of them).
|
|
33
|
+
*/
|
|
34
|
+
export declare function pipelineSteps(root: PipelineNode): {
|
|
35
|
+
steps: GraphStep[];
|
|
36
|
+
root: Group | null;
|
|
37
|
+
};
|
|
38
|
+
/** Above this many steps the mermaid graph is unreadable: it is not drawn */
|
|
39
|
+
export declare const MAX_GRAPH_STEPS = 10;
|
|
40
|
+
/** Whether the graph of `root` is small enough to draw (at most MAX_GRAPH_STEPS steps) */
|
|
41
|
+
export declare const graphIsDrawable: (root: PipelineNode) => boolean;
|
|
42
|
+
/** Mermaid flowchart of a pipeline; `states`: step label -> state, colours the steps of a run */
|
|
43
|
+
export declare function pipelineMermaid(root: PipelineNode, states?: Record<string, string>, dark?: boolean): string;
|
|
44
|
+
/** The pipeline graph, rendered by mermaid (loaded on first use) */
|
|
45
|
+
export declare const PipelineGraph: React.FC<{
|
|
46
|
+
definition: PipelineNode;
|
|
47
|
+
states?: Record<string, string>;
|
|
48
|
+
}>;
|
|
49
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/** /pipelines: the saved pipelines */
|
|
2
3
|
export declare const PipelinesView: React.FC;
|
|
4
|
+
/** /pipelines/:pipelineName: the graph of a pipeline, Run, the run shown (?run=, else the latest) and its runs */
|
|
5
|
+
export declare const PipelineDetailsView: React.FC;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milabench/bujang",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -68,5 +68,11 @@
|
|
|
68
68
|
"type": "git",
|
|
69
69
|
"url": "git+https://github.com/milabench/bujang.git",
|
|
70
70
|
"directory": "ui"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"mermaid": "^11.17.2",
|
|
74
|
+
"vega": "^5.33.1",
|
|
75
|
+
"vega-embed": "^6.29.0",
|
|
76
|
+
"vega-lite": "^5.23.0"
|
|
71
77
|
}
|
|
72
78
|
}
|