@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 +12 -1
- package/dist/components/SshConnectDialog.d.ts +31 -0
- package/dist/index.js +4331 -4113
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +35 -1
- package/package.json +1 -1
- package/src/api.ts +40 -0
- package/src/components/SshConnectDialog.tsx +377 -0
- package/src/types.ts +39 -1
- package/src/views/JanitorView.tsx +9 -6
- package/src/views/JobSubmit.tsx +7 -2
- package/src/views/JobsView.tsx +5 -62
package/src/views/JobsView.tsx
CHANGED
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
getSlurmPersistedJobs,
|
|
38
38
|
cancelSlurmJob,
|
|
39
39
|
rerunSlurmJob,
|
|
40
|
-
getSlurmClusterStatus,
|
|
41
40
|
getOrganizers,
|
|
42
41
|
getSyncStatus,
|
|
43
42
|
syncNow,
|
|
@@ -46,6 +45,7 @@ import { JobImportantStar } from './JobMarks';
|
|
|
46
45
|
import type { SlurmJob, PersitedJobInfo, ApiError, OrganizerGroups, SyncStatus } from '../types';
|
|
47
46
|
import { usePageTitle } from '../hooks/usePageTitle';
|
|
48
47
|
import { AgentBadge } from './AgentActivityView';
|
|
48
|
+
import { SshConnectButton } from '../components/SshConnectDialog';
|
|
49
49
|
import { NO_JOB_ID, NO_JOB_STATE, NO_JR_JOB_ID } from '../constants';
|
|
50
50
|
|
|
51
51
|
type JobsViewProps = Record<string, never>;
|
|
@@ -238,15 +238,6 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
238
238
|
retry: false,
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
-
const { data: clusterStatus, isLoading: clusterStatusLoading } = useQuery({
|
|
242
|
-
queryKey: ['slurm-cluster-status'],
|
|
243
|
-
queryFn: getSlurmClusterStatus,
|
|
244
|
-
refetchOnWindowFocus: false,
|
|
245
|
-
staleTime: 30000, // Consider data fresh for 30 seconds
|
|
246
|
-
refetchInterval: 60000, // Refetch every minute
|
|
247
|
-
retry: false, // Don't retry on error to avoid excessive requests when cluster is down
|
|
248
|
-
});
|
|
249
|
-
|
|
250
241
|
// ?clusters=mila&experiments=lr-sweep: the jobs under every chosen value
|
|
251
242
|
const [params, setParams] = useSearchParams();
|
|
252
243
|
const organizerNames = React.useMemo(() => organizers.map((o) => o.name), [organizers]);
|
|
@@ -364,56 +355,7 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
364
355
|
<Heading size="xl" fontWeight="bold" color="var(--color-text)">
|
|
365
356
|
Jobs
|
|
366
357
|
</Heading>
|
|
367
|
-
|
|
368
|
-
<Tooltip
|
|
369
|
-
positioning={{ placement: 'bottom', offset: { mainAxis: 8 } }}
|
|
370
|
-
content="Checking cluster status..."
|
|
371
|
-
>
|
|
372
|
-
<Spinner size="sm" />
|
|
373
|
-
</Tooltip>
|
|
374
|
-
) : clusterStatus ? (
|
|
375
|
-
<Tooltip
|
|
376
|
-
positioning={{ placement: 'bottom', offset: { mainAxis: 8 } }}
|
|
377
|
-
content={
|
|
378
|
-
clusterStatus.status === 'offline' && clusterStatus.reason
|
|
379
|
-
? `${clusterStatus.reason}`
|
|
380
|
-
: clusterStatus.status === 'online'
|
|
381
|
-
? 'Cluster is online and ready to accept jobs'
|
|
382
|
-
: 'Cluster status'
|
|
383
|
-
}
|
|
384
|
-
>
|
|
385
|
-
<Badge
|
|
386
|
-
colorScheme={clusterStatus.status === 'online' ? 'green' : 'red'}
|
|
387
|
-
variant="solid"
|
|
388
|
-
fontSize="sm"
|
|
389
|
-
px={4}
|
|
390
|
-
py={1.5}
|
|
391
|
-
borderRadius="full"
|
|
392
|
-
cursor="help"
|
|
393
|
-
fontWeight="medium"
|
|
394
|
-
>
|
|
395
|
-
{clusterStatus.status === 'online' ? '✓ Online' : '✗ Offline'}
|
|
396
|
-
</Badge>
|
|
397
|
-
</Tooltip>
|
|
398
|
-
) : (
|
|
399
|
-
<Tooltip
|
|
400
|
-
positioning={{ placement: 'bottom', offset: { mainAxis: 8 } }}
|
|
401
|
-
content="Unable to determine cluster status"
|
|
402
|
-
>
|
|
403
|
-
<Badge
|
|
404
|
-
colorScheme="gray"
|
|
405
|
-
variant="solid"
|
|
406
|
-
fontSize="sm"
|
|
407
|
-
px={4}
|
|
408
|
-
py={1.5}
|
|
409
|
-
borderRadius="full"
|
|
410
|
-
cursor="help"
|
|
411
|
-
fontWeight="medium"
|
|
412
|
-
>
|
|
413
|
-
Status Unknown
|
|
414
|
-
</Badge>
|
|
415
|
-
</Tooltip>
|
|
416
|
-
)}
|
|
358
|
+
<SshConnectButton />
|
|
417
359
|
</HStack>
|
|
418
360
|
|
|
419
361
|
<HStack gap={3}>
|
|
@@ -437,7 +379,7 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
437
379
|
variant="outline"
|
|
438
380
|
onClick={() => refresh.mutate()}
|
|
439
381
|
title="rsync the clusters with active jobs now"
|
|
440
|
-
loading={refresh.isPending || activeJobsLoading || persistedJobsLoading
|
|
382
|
+
loading={refresh.isPending || activeJobsLoading || persistedJobsLoading}
|
|
441
383
|
size="sm"
|
|
442
384
|
fontWeight="medium"
|
|
443
385
|
>
|
|
@@ -811,6 +753,8 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
811
753
|
>
|
|
812
754
|
<Table.Cell pl={6} pr={4}>
|
|
813
755
|
<HStack gap={2}>
|
|
756
|
+
{/* first thing of the row: the important jobs stand out */}
|
|
757
|
+
<JobImportantStar jrJobId={jrJobId} important={!!persistedJobInfo.important} />
|
|
814
758
|
<Tooltip
|
|
815
759
|
positioning={{ placement: 'top', offset: { mainAxis: 8 } }}
|
|
816
760
|
content={formatDuration(persistedJobInfo.freshness)}
|
|
@@ -835,7 +779,6 @@ export const JobsView: React.FC<JobsViewProps> = () => {
|
|
|
835
779
|
</Table.Cell>
|
|
836
780
|
<Table.Cell>
|
|
837
781
|
<HStack gap={2} flexWrap="wrap">
|
|
838
|
-
<JobImportantStar jrJobId={jrJobId} important={!!persistedJobInfo.important} />
|
|
839
782
|
<Text color="var(--color-text)">{jobName}<AgentBadge tag={persistedJobInfo.agent} /></Text>
|
|
840
783
|
{(persistedJobInfo.groups || []).map((g) => (
|
|
841
784
|
<Badge
|