refs #14348 Merge branch 'origin/14348-cluster-search'
[arvados.git] / src / models / process.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContainerRequestResource } from "./container-request";
6 import { MountType, MountKind } from '~/models/mount-types';
7 import { WorkflowResource, parseWorkflowDefinition } from '~/models/workflow';
8 import { WorkflowInputsData } from './workflow';
9
10 export type ProcessResource = ContainerRequestResource;
11
12 export const createWorkflowMounts = (workflow: WorkflowResource, inputs: WorkflowInputsData): { [path: string]: MountType } => {
13     return {
14         '/var/spool/cwl': {
15             kind: MountKind.COLLECTION,
16             writable: true,
17         },
18         'stdout': {
19             kind: MountKind.MOUNTED_FILE,
20             path: '/var/spool/cwl/cwl.output.json',
21         },
22         '/var/lib/cwl/workflow.json': {
23             kind: MountKind.JSON,
24             content: parseWorkflowDefinition(workflow)
25         },
26         '/var/lib/cwl/cwl.input.json': {
27             kind: MountKind.JSON,
28             content: inputs,
29         }
30     };
31 };