1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material';
7 import { reduxForm, Field } from 'redux-form';
8 import { Grid } from '@mui/material';
9 import { TextField } from 'components/text-field/text-field';
10 import { ExpandIcon } from 'components/icon/icon';
11 import * as IntInput from './inputs/int-input';
12 import { min } from 'validators/min';
13 import { optional } from 'validators/optional';
14 import { RUN_PROCESS_ADVANCED_FORM,
21 RunProcessAdvancedFormData
22 } from 'store/run-process-panel/run-process-panel-actions';
24 export const RunProcessAdvancedForm =
25 reduxForm<RunProcessAdvancedFormData>({
26 form: RUN_PROCESS_ADVANCED_FORM,
29 <Accordion elevation={0}>
30 <AccordionSummary style={{ padding: 0 }} expandIcon={<ExpandIcon />}>
33 <AccordionDetails style={{ padding: 0 }}>
34 <Grid container spacing={4}>
35 <Grid item xs={12} md={6}>
38 component={TextField as any}
39 label="Output name" />
41 <Grid item xs={12} md={6}>
44 component={TextField as any}
45 helperText="Maximum running time (in seconds) that this container will be allowed to run before being cancelled."
47 parse={IntInput.parse}
48 format={IntInput.format}
50 validate={runtimeValidation} />
52 <Grid item xs={12} md={6}>
55 component={TextField as any}
57 helperText="Number of ram bytes to be used to run this process."
58 parse={IntInput.parse}
59 format={IntInput.format}
62 validate={ramValidation} />
64 <Grid item xs={12} md={6}>
67 component={TextField as any}
69 helperText="Number of cores to be used to run this process."
70 parse={IntInput.parse}
71 format={IntInput.format}
74 validate={vcpusValidation} />
76 <Grid item xs={12} md={6}>
78 name={KEEP_CACHE_RAM_FIELD}
79 component={TextField as any}
80 label="Keep cache RAM"
81 helperText="Number of keep cache bytes to be used to run this process."
82 parse={IntInput.parse}
83 format={IntInput.format}
85 validate={keepCacheRamValidation} />
87 <Grid item xs={12} md={6}>
89 name={RUNNER_IMAGE_FIELD}
90 component={TextField as any}
93 helperText='The container image with arvados-cwl-runner that will execute this workflow.' />
100 const ramValidation = [min(0)];
101 const vcpusValidation = [min(1)];
102 const keepCacheRamValidation = [optional(min(0))];
103 const runtimeValidation = [optional(min(1))];