Merge branch '21121-cluster-activity' refs #21121
[arvados.git] / services / workbench2 / src / store / process-panel / process-panel.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { WorkflowInputsData } from 'models/workflow';
6 import { RouterState } from "react-router-redux";
7 import { matchProcessRoute } from "routes/routes";
8 import { ProcessIOParameter } from "views/process-panel/process-io-card";
9 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
10 import { CollectionFile } from 'models/collection-file';
11 import { ContainerStatus } from 'models/container-request';
12
13 export type OutputDetails = {
14     raw?: any;
15     pdh?: string;
16 }
17
18 export interface CUDAFeatures {
19     DriverVersion: string;
20     HardwareCapability: string;
21     DeviceCount: number;
22 }
23
24 export interface NodeInstanceType {
25     Name: string;
26     ProviderType: string;
27     VCPUs: number;
28     RAM: number;
29     Scratch: number;
30     IncludedScratch: number;
31     AddedScratch: number;
32     Price: number;
33     Preemptible: boolean;
34     CUDA: CUDAFeatures;
35 };
36
37 export interface NodeInfo {
38     nodeInfo: NodeInstanceType | null;
39 };
40
41 export interface UsageReport {
42     usageReport: CollectionFile | null;
43 };
44
45 export interface ProcessPanel {
46     containerRequestUuid: string;
47     filters: { [status: string]: boolean };
48     inputRaw: WorkflowInputsData | null;
49     inputParams: ProcessIOParameter[] | null;
50     outputData: OutputDetails | null;
51     outputDefinitions: CommandOutputParameter[];
52     outputParams: ProcessIOParameter[] | null;
53     nodeInfo: NodeInstanceType | null;
54     usageReport: CollectionFile | null;
55     containerStatus: ContainerStatus | null;
56 }
57
58 export const getProcessPanelCurrentUuid = (router: RouterState) => {
59     const pathname = router.location ? router.location.pathname : '';
60     const match = matchProcessRoute(pathname);
61     return match ? match.params.id : undefined;
62 };