@milabench/bujang 0.0.0-stage → 0.1.2
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 +108 -2
- package/dist/api.d.ts +151 -0
- package/dist/components/AutocompleteInput.d.ts +15 -0
- package/dist/components/MonacoEditor.d.ts +11 -0
- package/dist/components/toaster.d.ts +2 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/constants.d.ts +3 -0
- package/dist/context.d.ts +44 -0
- package/dist/hooks/useColorMode.d.ts +4 -0
- package/dist/hooks/usePageTitle.d.ts +2 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +5036 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +26 -0
- package/dist/routes.d.ts +22 -0
- package/dist/theme.css +72 -0
- package/dist/toast.d.ts +18 -0
- package/dist/types.d.ts +474 -0
- package/dist/views/AgentActivityView.d.ts +8 -0
- package/dist/views/JobDetails.d.ts +2 -0
- package/dist/views/JobLogs.d.ts +4 -0
- package/dist/views/JobSubmit.d.ts +22 -0
- package/dist/views/JobSubmitView.d.ts +2 -0
- package/dist/views/JobsView.d.ts +4 -0
- package/dist/views/LogDisplay.d.ts +11 -0
- package/dist/views/PipelinesView.d.ts +2 -0
- package/dist/views/ScheduledJobsView.d.ts +2 -0
- package/package.json +70 -4
- package/src/api.ts +602 -0
- package/src/components/AutocompleteInput.tsx +253 -0
- package/src/components/MonacoEditor.tsx +163 -0
- package/src/components/toaster.tsx +38 -0
- package/src/components/tooltip.tsx +52 -0
- package/src/constants.ts +3 -0
- package/src/context.tsx +106 -0
- package/src/hooks/useColorMode.ts +31 -0
- package/src/hooks/usePageTitle.ts +21 -0
- package/src/index.ts +33 -0
- package/src/paths.ts +71 -0
- package/src/routes.tsx +55 -0
- package/src/theme.css +72 -0
- package/src/toast.ts +35 -0
- package/src/types.ts +542 -0
- package/src/views/AgentActivityView.tsx +262 -0
- package/src/views/JobDetails.tsx +675 -0
- package/src/views/JobLogs.tsx +987 -0
- package/src/views/JobSubmit.tsx +1272 -0
- package/src/views/JobSubmitView.tsx +69 -0
- package/src/views/JobsView.tsx +736 -0
- package/src/views/LogDisplay.tsx +171 -0
- package/src/views/PipelinesView.tsx +1318 -0
- package/src/views/ScheduledJobsView.tsx +735 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { useBujangPaths } from '../context';
|
|
4
|
+
import { useQuery } from '@tanstack/react-query';
|
|
5
|
+
import { Box, Spinner, VStack, Text } from '@chakra-ui/react';
|
|
6
|
+
import { JobSubmissionForm } from './JobSubmit';
|
|
7
|
+
import {
|
|
8
|
+
getSlurmTemplates,
|
|
9
|
+
getSlurmProfiles,
|
|
10
|
+
getSlurmJobs,
|
|
11
|
+
getSlurmClusters,
|
|
12
|
+
} from '../api';
|
|
13
|
+
|
|
14
|
+
export const JobSubmitView: React.FC = () => {
|
|
15
|
+
const navigate = useNavigate();
|
|
16
|
+
const paths = useBujangPaths();
|
|
17
|
+
|
|
18
|
+
const { data: templateNames } = useQuery<string[]>({
|
|
19
|
+
queryKey: ['slurm-templates'],
|
|
20
|
+
queryFn: getSlurmTemplates,
|
|
21
|
+
refetchOnWindowFocus: false,
|
|
22
|
+
staleTime: 600000,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const { data: profiles } = useQuery({
|
|
26
|
+
queryKey: ['slurm-profiles'],
|
|
27
|
+
queryFn: getSlurmProfiles,
|
|
28
|
+
refetchOnWindowFocus: false,
|
|
29
|
+
// ssh profiles (data movers) only run as pipeline steps
|
|
30
|
+
select: (ps) => ps.filter((p) => p.executor !== 'ssh'),
|
|
31
|
+
staleTime: 300000,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const { data: activeJobs } = useQuery({
|
|
35
|
+
queryKey: ['slurm-jobs'],
|
|
36
|
+
queryFn: getSlurmJobs,
|
|
37
|
+
refetchOnWindowFocus: false,
|
|
38
|
+
staleTime: 30000,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const { data: clusters } = useQuery({
|
|
42
|
+
queryKey: ['slurm-clusters'],
|
|
43
|
+
queryFn: getSlurmClusters,
|
|
44
|
+
refetchOnWindowFocus: false,
|
|
45
|
+
staleTime: 600000,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!profiles) {
|
|
49
|
+
return (
|
|
50
|
+
<Box display="flex" justifyContent="center" alignItems="center" height="80vh">
|
|
51
|
+
<VStack gap={4}>
|
|
52
|
+
<Spinner size="xl" />
|
|
53
|
+
<Text color="var(--color-text-muted)">Loading...</Text>
|
|
54
|
+
</VStack>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<JobSubmissionForm
|
|
61
|
+
templates={templateNames || []}
|
|
62
|
+
profiles={profiles || []}
|
|
63
|
+
clusters={clusters || []}
|
|
64
|
+
activeJobs={activeJobs || []}
|
|
65
|
+
onClose={() => navigate(paths.jobs())}
|
|
66
|
+
syncUrl
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
};
|