X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9168f531907d8d2aa3a9320a20e34d2533f38572..a6c092fe45fe0ff310800e82e224bc822890491a:/src/store/run-process-panel/run-process-panel-actions.ts diff --git a/src/store/run-process-panel/run-process-panel-actions.ts b/src/store/run-process-panel/run-process-panel-actions.ts index 3cc6e71319..d9686feb4b 100644 --- a/src/store/run-process-panel/run-process-panel-actions.ts +++ b/src/store/run-process-panel/run-process-panel-actions.ts @@ -21,7 +21,6 @@ import { } from '~/views/run-process-panel/run-process-advanced-form'; import { dialogActions } from '~/store/dialog/dialog-actions'; import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions'; -import { matchProjectRoute } from '~/routes/routes'; export const runProcessPanelActions = unionize({ SET_PROCESS_PATHNAME: ofType(), @@ -85,9 +84,9 @@ export const getWorkflowRunnerSettings = (workflow: WorkflowResource) => { if (hints) { const resc = hints.find(item => item.class === 'http://arvados.org/cwl#WorkflowRunnerResources') as WorkflowRunnerResources | undefined; if (resc) { - if (resc.ramMin) { advancedFormValues[RAM_FIELD] = resc.ramMin; } + if (resc.ramMin) { advancedFormValues[RAM_FIELD] = resc.ramMin * (1024 * 1024); } if (resc.coresMin) { advancedFormValues[VCPUS_FIELD] = resc.coresMin; } - if (resc.keep_cache) { advancedFormValues[KEEP_CACHE_RAM_FIELD] = resc.keep_cache; } + if (resc.keep_cache) { advancedFormValues[KEEP_CACHE_RAM_FIELD] = resc.keep_cache * (1024 * 1024); } if (resc.acrContainerImage) { advancedFormValues[RUNNER_IMAGE_FIELD] = resc.acrContainerImage; } } } @@ -144,9 +143,8 @@ export const runProcess = async (dispatch: Dispatch, getState: () => RootSt const inputsForm = getFormValues(RUN_PROCESS_INPUTS_FORM)(state) as WorkflowInputsData; const userUuid = getUserUuid(getState()); if (!userUuid) { return; } - const pathname = getState().runProcessPanel.processPathname; const { processOwnerUuid, selectedWorkflow } = state.runProcessPanel; - const ownerUUid = !matchProjectRoute(pathname) ? userUuid : processOwnerUuid; + const ownerUUid = processOwnerUuid ? processOwnerUuid : userUuid; if (selectedWorkflow) { const advancedForm = getFormValues(RUN_PROCESS_ADVANCED_FORM)(state) as RunProcessAdvancedFormData || getWorkflowRunnerSettings(selectedWorkflow); const newProcessData = { @@ -158,7 +156,7 @@ export const runProcess = async (dispatch: Dispatch, getState: () => RootSt runtimeConstraints: { API: true, vcpus: advancedForm[VCPUS_FIELD], - ram: advancedForm[RAM_FIELD], + ram: (advancedForm[KEEP_CACHE_RAM_FIELD] + advancedForm[RAM_FIELD]), }, schedulingParameters: { max_run_time: advancedForm[RUNTIME_FIELD] @@ -186,9 +184,10 @@ export const runProcess = async (dispatch: Dispatch, getState: () => RootSt } }; -export const DEFAULT_ADVANCED_FORM_VALUES: Partial = { +const DEFAULT_ADVANCED_FORM_VALUES: Partial = { [VCPUS_FIELD]: 1, [RAM_FIELD]: 1073741824, + [KEEP_CACHE_RAM_FIELD]: 268435456, [RUNNER_IMAGE_FIELD]: "arvados/jobs" };