@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/src/types.ts CHANGED
@@ -139,6 +139,14 @@ export interface SlurmJobSubmitRequest {
139
139
  dependency?: [string, string][]
140
140
  }
141
141
 
142
+ /** A file attached to a submission: lands in <job folder>/input/<name> ($JR_INPUT_DIR). */
143
+ export interface JobAttachment {
144
+ /** Relative path, sub folders allowed (data/train.csv). */
145
+ name: string;
146
+ /** base64 */
147
+ content: string;
148
+ }
149
+
142
150
  export interface SlurmJobSubmitResponse {
143
151
  success: boolean;
144
152
  job_id?: string;
@@ -477,6 +485,8 @@ export interface PushFolderResponse {
477
485
 
478
486
  export interface EarlySyncResponse {
479
487
  status: "ok" | "notok";
488
+ /** Why the rsync from the compute node failed (its stderr), when it ran */
489
+ error?: string | null;
480
490
  }
481
491
 
482
492
 
@@ -610,6 +620,20 @@ export interface SettingsDatabaseTable {
610
620
  name: string;
611
621
  exists: boolean;
612
622
  rows: number | null;
623
+ /** What the table holds (known tables only). */
624
+ description?: string | null;
625
+ }
626
+
627
+ /** A SQLite file of the local cache (state.db, fakeslurm.db). */
628
+ export interface SettingsLocalDatabase {
629
+ name: string;
630
+ path: string;
631
+ description: string;
632
+ exists: boolean;
633
+ /** Bytes, with the -wal / -shm files. */
634
+ size: number | null;
635
+ tables: SettingsDatabaseTable[];
636
+ error: string | null;
613
637
  }
614
638
 
615
639
  export interface SettingsDatabase {
@@ -625,6 +649,8 @@ export interface SettingsDatabase {
625
649
  enabled: boolean;
626
650
  tables: SettingsDatabaseTable[];
627
651
  error: string | null;
652
+ /** The SQLite files of the local cache, whatever the database above is. */
653
+ local?: SettingsLocalDatabase[];
628
654
  }
629
655
 
630
656
  export interface SettingsMcp {
@@ -764,6 +790,43 @@ export interface SshTestResponse {
764
790
  results: SshCheckResult[];
765
791
  }
766
792
 
793
+ /** An ssh login started from the UI (POST /ssh/login): ssh's prompts (MFA, password, host key) come back here */
794
+ export type SshLoginState = 'starting' | 'prompt' | 'waiting' | 'ok' | 'failed' | 'cancelled';
795
+
796
+ export interface SshLogin {
797
+ id: string;
798
+ host: string;
799
+ cluster: string | null;
800
+ state: SshLoginState;
801
+ /** the prompt waiting for an answer (state "prompt") */
802
+ prompt: string | null;
803
+ /** secret: masked input; confirm: a yes / no question (host key) */
804
+ kind: 'secret' | 'confirm' | null;
805
+ /** what ssh printed so far: the instructions of the server (Duo menu, ...) */
806
+ info: string[];
807
+ message: string;
808
+ prompts: number;
809
+ started: number;
810
+ finished: number | null;
811
+ }
812
+
813
+ /** GET /ssh/connections: the ssh hosts of the clusters and their shared connection (ControlMaster) */
814
+ export interface SshConnection {
815
+ host: string;
816
+ cluster: string;
817
+ /** the login node of the cluster (else an ssh executor host: data mover) */
818
+ login_node: boolean;
819
+ /** open: connected; no: not connected; none: the ssh config keeps no shared connection for the host */
820
+ master: 'open' | 'no' | 'none';
821
+ login: SshLogin | null;
822
+ }
823
+
824
+ export interface SshConnections {
825
+ writable: boolean;
826
+ read_only_reason: string | null;
827
+ hosts: SshConnection[];
828
+ }
829
+
767
830
  /** GET /update: the running version against the latest release on PyPI (checked once a day). */
768
831
  export interface UpdateCheck {
769
832
  /** BUJANG_UPDATE_CHECK=0 turns the check off */
@@ -844,6 +907,139 @@ export interface SyncStatus {
844
907
  /** seconds between two background syncs, null when the server does not run them */
845
908
  interval: number | null;
846
909
  jobs: number;
847
- synced?: Record<string, boolean>;
910
+ /** per cluster: true synced, false failed, 'recent': not asked, a full rsync ran less than min_refresh_interval ago */
911
+ synced?: Record<string, boolean | 'recent'>;
848
912
  skipped?: string;
849
913
  }
914
+
915
+ // ─── Janitor (/janitor routes) ─────────────────────────────────────
916
+
917
+ export type JanitorStatus = 'ok' | 'failed' | 'timeout' | 'skipped';
918
+
919
+ /** A background task running now. */
920
+ export interface JanitorTask {
921
+ id: string;
922
+ name: string;
923
+ /** rsync | scp | ssh | periodic | cleanup | request | task */
924
+ kind: string;
925
+ cluster: string | null;
926
+ started: number;
927
+ pid: number | null;
928
+ detail: Record<string, unknown>;
929
+ }
930
+
931
+ /** One finished task. */
932
+ export interface JanitorRun {
933
+ id: string;
934
+ name: string;
935
+ kind: string;
936
+ cluster: string | null;
937
+ /** rsync / scp: pull (cluster -> here) or push */
938
+ direction: 'pull' | 'push' | null;
939
+ started: number;
940
+ ended: number;
941
+ duration: number;
942
+ /** Seconds spent waiting for the cluster's sync queue. */
943
+ waited: number | null;
944
+ status: JanitorStatus;
945
+ error: string | null;
946
+ detail: Record<string, unknown>;
947
+ /** Bytes received / sent (rsync --stats, scp, ssh output); a sync or book keeping adds up its rsyncs. */
948
+ bytes_in: number | null;
949
+ bytes_out: number | null;
950
+ }
951
+
952
+ export interface JanitorStat {
953
+ name: string;
954
+ kind: string;
955
+ cluster: string | null;
956
+ runs: number;
957
+ failures: number;
958
+ total: number;
959
+ mean: number;
960
+ p95: number | null;
961
+ max: number;
962
+ waited: number;
963
+ last: number;
964
+ last_status: JanitorStatus | null;
965
+ bytes_in: number | null;
966
+ bytes_out: number | null;
967
+ }
968
+
969
+ export interface JanitorQueueTicket {
970
+ id: string;
971
+ cluster: string;
972
+ what: string | null;
973
+ queued: number;
974
+ pid: number | null;
975
+ /** null: waiting its turn */
976
+ started: number | null;
977
+ expires: number;
978
+ }
979
+
980
+ export interface JanitorPeriodic {
981
+ /** APScheduler job id, null when only its history is known */
982
+ id: string | null;
983
+ name: string;
984
+ interval: number | null;
985
+ next_run: number | null;
986
+ last: JanitorRun | null;
987
+ }
988
+
989
+ export interface JanitorOverview {
990
+ now: number;
991
+ history_days: number;
992
+ active: JanitorTask[];
993
+ queue: JanitorQueueTicket[];
994
+ periodic: JanitorPeriodic[];
995
+ stats: { day: JanitorStat[]; week: JanitorStat[] };
996
+ /** Calls to each cluster over the last day (rsync, scp, ssh). */
997
+ clusters: Record<string, {
998
+ calls: number;
999
+ rsyncs: number;
1000
+ seconds: number;
1001
+ failures: number;
1002
+ waited: number;
1003
+ bytes_in: number;
1004
+ bytes_out: number;
1005
+ }>;
1006
+ archive_roots: string[];
1007
+ }
1008
+
1009
+ export interface JanitorCleanupInfo {
1010
+ organizers: { name: string; values: { value: string; jobs: number }[] }[];
1011
+ }
1012
+
1013
+ export interface JanitorSkipped {
1014
+ jr_job_id: string;
1015
+ value?: string;
1016
+ reason: string;
1017
+ }
1018
+
1019
+ export interface JanitorArchiveItem {
1020
+ jr_job_id: string;
1021
+ value: string;
1022
+ cluster: string | null;
1023
+ from: string;
1024
+ to: string;
1025
+ }
1026
+
1027
+ export interface JanitorArchiveResult {
1028
+ would_move?: JanitorArchiveItem[];
1029
+ moved?: JanitorArchiveItem[];
1030
+ skipped: JanitorSkipped[];
1031
+ }
1032
+
1033
+ export interface JanitorStaleItem {
1034
+ jr_job_id: string;
1035
+ cluster: string | null;
1036
+ folder: string;
1037
+ modified: number | null;
1038
+ state: string | string[] | null;
1039
+ }
1040
+
1041
+ export interface JanitorStaleResult {
1042
+ would_remove?: JanitorStaleItem[];
1043
+ removed?: JanitorStaleItem[];
1044
+ skipped: JanitorSkipped[];
1045
+ }