X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f63f3a5360ae6381d4b332bf86ef52b4e22107fb..4b956bd2e3bcccdeb808df7391d135659cf85b94:/src/models/process.ts diff --git a/src/models/process.ts b/src/models/process.ts index bcfbd3a5..cb1bfe86 100644 --- a/src/models/process.ts +++ b/src/models/process.ts @@ -2,37 +2,33 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { Resource, ResourceKind } from "./resource"; +import { ContainerRequestResource } from "./container-request"; +import { MountType, MountKind } from 'models/mount-types'; +import { WorkflowResource, parseWorkflowDefinition } from 'models/workflow'; +import { WorkflowInputsData } from './workflow'; -export enum ProcessState { - UNCOMMITTED = "Uncommitted", - COMMITTED = "Committed", - FINAL = "Final" -} +export type ProcessResource = ContainerRequestResource; -export interface ProcessResource extends Resource { - kind: ResourceKind.PROCESS; - name: string; - description: string; - properties: any; - state: ProcessState; - requestingContainerUuid: string; - containerUuid: string; - containerCountMax: number; - mounts: any; - runtimeConstraints: any; - schedulingParameters: any; - containerImage: string; - environment: any; - cwd: string; - command: string[]; - outputPath: string; - outputName: string; - outputTtl: number; - priority: number; - expiresAt: string; - useExisting: boolean; - logUuid: string; - outputUuid: string; - filters: string; -} +export const MOUNT_PATH_CWL_WORKFLOW = '/var/lib/cwl/workflow.json'; +export const MOUNT_PATH_CWL_INPUT = '/var/lib/cwl/cwl.input.json'; + +export const createWorkflowMounts = (workflow: WorkflowResource, inputs: WorkflowInputsData): { [path: string]: MountType } => { + return { + '/var/spool/cwl': { + kind: MountKind.COLLECTION, + writable: true, + }, + 'stdout': { + kind: MountKind.MOUNTED_FILE, + path: '/var/spool/cwl/cwl.output.json', + }, + '/var/lib/cwl/workflow.json': { + kind: MountKind.JSON, + content: parseWorkflowDefinition(workflow) + }, + '/var/lib/cwl/cwl.input.json': { + kind: MountKind.JSON, + content: inputs, + } + }; +};