Merge branch '16680-expired-token-handling'
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 2 Sep 2020 14:22:26 +0000 (11:22 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 2 Sep 2020 14:22:26 +0000 (11:22 -0300)
Closes #16680

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/models/workflow.ts
src/store/processes/processes-actions.ts
src/store/run-process-panel/run-process-panel-actions.test.ts
src/store/run-process-panel/run-process-panel-actions.ts
src/views/run-process-panel/run-process-advanced-form.tsx

index abc92c624d97ea72e84daef51d854af9f12d1009..ad84bd9e891a95fcfff02a1cb001a72e226e0f45 100644 (file)
@@ -22,6 +22,7 @@ export interface Workflow {
     inputs: CommandInputParameter[];
     outputs: any[];
     steps: any[];
+    hints?: ProcessRequirement[];
 }
 
 export interface CommandLineTool {
@@ -29,6 +30,21 @@ export interface CommandLineTool {
     id: string;
     inputs: CommandInputParameter[];
     outputs: any[];
+    hints?: ProcessRequirement[];
+}
+
+export type ProcessRequirement = GenericProcessRequirement | WorkflowRunnerResources;
+
+export interface GenericProcessRequirement {
+    class: string;
+}
+
+export interface WorkflowRunnerResources {
+    class: 'http://arvados.org/cwl#WorkflowRunnerResources';
+    ramMin?: number;
+    coresMin?: number;
+    keep_cache?: number;
+    acrContainerImage?: string;
 }
 
 export type CommandInputParameter =
index ab51f9caa07babf0b3b4c70bb34e39d99637b4c0..ba70f9147dc895941e42a39ffecd077b46d38962 100644 (file)
@@ -69,7 +69,7 @@ export const reRunProcess = (processUuid: string, workflowUuid: string) =>
                 ram: process.runtimeConstraints.ram,
                 vcpus: process.runtimeConstraints.vcpus,
                 keep_cache_ram: process.runtimeConstraints.keep_cache_ram,
-                api: process.runtimeConstraints.API
+                acr_container_image: process.containerImage
             };
             dispatch<any>(initialize(RUN_PROCESS_ADVANCED_FORM, advancedInitialData));
 
index e863368dafcfaadc424419a344ce28527e6fa28f..cfdb75ea7aa997a24b12ba1da251aaf8345eef71 100644 (file)
 import { runProcess } from "./run-process-panel-actions";
 
 jest.mock("../navigation/navigation-action", () => ({
-  navigateTo: (link: any) => link,
+    navigateTo: (link: any) => link,
 }));
 
 jest.mock("~/models/process", () => ({
-  createWorkflowMounts: jest.fn(),
+    createWorkflowMounts: jest.fn(),
 }));
 
 jest.mock("redux-form", () => ({
-  reduxForm: () => (c: any) => c,
-  getFormValues: (name: string) => () => {
-    switch (name) {
-      case "runProcessBasicForm":
-        return {
-          name: "basicFormTestName",
-          description: "basicFormTestDescription",
-        };
-      case "runProcessInputsForm":
-        return {};
-      default:
-        return null;
-    }
-  },
+    reduxForm: () => (c: any) => c,
+    getFormValues: (name: string) => () => {
+        switch (name) {
+            case "runProcessBasicForm":
+                return {
+                    name: "basicFormTestName",
+                    description: "basicFormTestDescription",
+                };
+            case "runProcessInputsForm":
+                return {};
+            default:
+                return null;
+        }
+    },
 }));
 
 describe("run-process-panel-actions", () => {
-  describe("runProcess", () => {
-    const newProcessUUID = 'newProcessUUID';
-    let dispatch: any, getState: any, services: any;
+    describe("runProcess", () => {
+        const newProcessUUID = 'newProcessUUID';
+        let dispatch: any, getState: any, services: any;
 
-    beforeEach(() => {
-      dispatch = jest.fn();
-      services = {
-        containerRequestService: {
-          create: jest.fn().mockImplementation(async () => ({
-            uuid: newProcessUUID,
-          })),
-        },
-      };
-    });
+        beforeEach(() => {
+            dispatch = jest.fn();
+            services = {
+                containerRequestService: {
+                    create: jest.fn().mockImplementation(async () => ({
+                        uuid: newProcessUUID,
+                    })),
+                },
+            };
+        });
 
-    it("should return when userUuid is null", async () => {
-      // given
-      getState = () => ({
-        auth: {},
-      });
+        it("should return when userUuid is null", async () => {
+            // given
+            getState = () => ({
+                auth: {},
+            });
 
-      // when
-      await runProcess(dispatch, getState, services);
+            // when
+            await runProcess(dispatch, getState, services);
 
-      // then
-      expect(dispatch).not.toHaveBeenCalled();
-    });
+            // then
+            expect(dispatch).not.toHaveBeenCalled();
+        });
 
-    it("should run workflow with project-uuid", async () => {
-      // given
-      getState = () => ({
-        auth: {
-          user: {
-            email: "test@gmail.com",
-            firstName: "TestFirstName",
-            lastName: "TestLastName",
-            uuid: "ce8i5-tpzed-yid70bw31f51234",
-            ownerUuid: "ce8i5-tpzed-000000000000000",
-            isAdmin: false,
-            isActive: true,
-            username: "testfirstname",
-            prefs: {
-              profile: {},
-            },
-          },
-        },
-        runProcessPanel: {
-          processPathname: "/projects/ce8i5-tpzed-yid70bw31f51234",
-          processOwnerUuid: "ce8i5-tpzed-yid70bw31f51234",
-          selectedWorkflow: {
-            href: "/workflows/ce8i5-7fd4e-2tlnerdkxnl4fjt",
-            kind: "arvados#workflow",
-            etag: "8gh5xlhlgo61yqscyl1spw8tc",
-            uuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt",
-            ownerUuid: "ce8i5-tpzed-o4njwilpp4ov321",
-            createdAt: "2020-07-15T19:40:50.296041000Z",
-            modifiedByClientUuid: "ce8i5-ozdt8-libnr89sc5nq111",
-            modifiedByUserUuid: "ce8i5-tpzed-o4njwilpp4ov321",
-            modifiedAt: "2020-07-15T19:40:50.296376000Z",
-            name: "revsort.cwl",
-            description:
-              "Reverse the lines in a document, then sort those lines.",
-            definition:
-              '{\n    "$graph": [\n        {\n            "class": "Workflow",\n            "doc": "Reverse the lines in a document, then sort those lines.",\n            "id": "#main",\n            "inputs": [\n                {\n                    "default": null,\n                    "doc": "The input file to be processed.",\n                    "id": "#main/input",\n                    "type": "File"\n                },\n                {\n                    "default": true,\n                    "doc": "If true, reverse (decending) sort",\n                    "id": "#main/reverse_sort",\n                    "type": "boolean"\n                }\n            ],\n            "outputs": [\n                {\n                    "doc": "The output with the lines reversed and sorted.",\n                    "id": "#main/output",\n                    "outputSource": "#main/sorted/output",\n                    "type": "File"\n                }\n            ],\n            "steps": [\n                {\n                    "id": "#main/rev",\n                    "in": [\n                        {\n                            "id": "#main/rev/input",\n                            "source": "#main/input"\n                        }\n                    ],\n                    "out": [\n                        "#main/rev/output"\n                    ],\n                    "run": "#revtool.cwl"\n                },\n                {\n                    "id": "#main/sorted",\n                    "in": [\n                        {\n                            "id": "#main/sorted/input",\n                            "source": "#main/rev/output"\n                        },\n                        {\n                            "id": "#main/sorted/reverse",\n                            "source": "#main/reverse_sort"\n                        }\n                    ],\n                    "out": [\n                        "#main/sorted/output"\n                    ],\n                    "run": "#sorttool.cwl"\n                }\n            ]\n        },\n        {\n            "baseCommand": "rev",\n            "class": "CommandLineTool",\n            "doc": "Reverse each line using the `rev` command",\n            "hints": [\n                {\n                    "class": "ResourceRequirement",\n                    "ramMin": 8\n                }\n            ],\n            "id": "#revtool.cwl",\n            "inputs": [\n                {\n                    "id": "#revtool.cwl/input",\n                    "inputBinding": {},\n                    "type": "File"\n                }\n            ],\n            "outputs": [\n                {\n                    "id": "#revtool.cwl/output",\n                    "outputBinding": {\n                        "glob": "output.txt"\n                    },\n                    "type": "File"\n                }\n            ],\n            "stdout": "output.txt"\n        },\n        {\n            "baseCommand": "sort",\n            "class": "CommandLineTool",\n            "doc": "Sort lines using the `sort` command",\n            "hints": [\n                {\n                    "class": "ResourceRequirement",\n                    "ramMin": 8\n                }\n            ],\n            "id": "#sorttool.cwl",\n            "inputs": [\n                {\n                    "id": "#sorttool.cwl/reverse",\n                    "inputBinding": {\n                        "position": 1,\n                        "prefix": "-r"\n                    },\n                    "type": "boolean"\n                },\n                {\n                    "id": "#sorttool.cwl/input",\n                    "inputBinding": {\n                        "position": 2\n                    },\n                    "type": "File"\n                }\n            ],\n            "outputs": [\n                {\n                    "id": "#sorttool.cwl/output",\n                    "outputBinding": {\n                        "glob": "output.txt"\n                    },\n                    "type": "File"\n                }\n            ],\n            "stdout": "output.txt"\n        }\n    ],\n    "cwlVersion": "v1.0"\n}',
-          },
-        },
-      });
+        it("should run workflow with project-uuid", async () => {
+            // given
+            getState = () => ({
+                auth: {
+                    user: {
+                        email: "test@gmail.com",
+                        firstName: "TestFirstName",
+                        lastName: "TestLastName",
+                        uuid: "ce8i5-tpzed-yid70bw31f51234",
+                        ownerUuid: "ce8i5-tpzed-000000000000000",
+                        isAdmin: false,
+                        isActive: true,
+                        username: "testfirstname",
+                        prefs: {
+                            profile: {},
+                        },
+                    },
+                },
+                runProcessPanel: {
+                    processPathname: "/projects/ce8i5-tpzed-yid70bw31f51234",
+                    processOwnerUuid: "ce8i5-tpzed-yid70bw31f51234",
+                    selectedWorkflow: {
+                        href: "/workflows/ce8i5-7fd4e-2tlnerdkxnl4fjt",
+                        kind: "arvados#workflow",
+                        etag: "8gh5xlhlgo61yqscyl1spw8tc",
+                        uuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt",
+                        ownerUuid: "ce8i5-tpzed-o4njwilpp4ov321",
+                        createdAt: "2020-07-15T19:40:50.296041000Z",
+                        modifiedByClientUuid: "ce8i5-ozdt8-libnr89sc5nq111",
+                        modifiedByUserUuid: "ce8i5-tpzed-o4njwilpp4ov321",
+                        modifiedAt: "2020-07-15T19:40:50.296376000Z",
+                        name: "revsort.cwl",
+                        description:
+                            "Reverse the lines in a document, then sort those lines.",
+                        definition:
+                            '{\n    "$graph": [\n        {\n            "class": "Workflow",\n            "doc": "Reverse the lines in a document, then sort those lines.",\n            "id": "#main",\n            "hints":[{"class":"http://arvados.org/cwl#WorkflowRunnerResources","acrContainerImage":"arvados/jobs:2.0.4"}], "inputs": [\n                {\n                    "default": null,\n                    "doc": "The input file to be processed.",\n                    "id": "#main/input",\n                    "type": "File"\n                },\n                {\n                    "default": true,\n                    "doc": "If true, reverse (decending) sort",\n                    "id": "#main/reverse_sort",\n                    "type": "boolean"\n                }\n            ],\n            "outputs": [\n                {\n                    "doc": "The output with the lines reversed and sorted.",\n                    "id": "#main/output",\n                    "outputSource": "#main/sorted/output",\n                    "type": "File"\n                }\n            ],\n            "steps": [\n                {\n                    "id": "#main/rev",\n                    "in": [\n                        {\n                            "id": "#main/rev/input",\n                            "source": "#main/input"\n                        }\n                    ],\n                    "out": [\n                        "#main/rev/output"\n                    ],\n                    "run": "#revtool.cwl"\n                },\n                {\n                    "id": "#main/sorted",\n                    "in": [\n                        {\n                            "id": "#main/sorted/input",\n                            "source": "#main/rev/output"\n                        },\n                        {\n                            "id": "#main/sorted/reverse",\n                            "source": "#main/reverse_sort"\n                        }\n                    ],\n                    "out": [\n                        "#main/sorted/output"\n                    ],\n                    "run": "#sorttool.cwl"\n                }\n            ]\n        },\n        {\n            "baseCommand": "rev",\n            "class": "CommandLineTool",\n            "doc": "Reverse each line using the `rev` command",\n            "hints": [\n                {\n                    "class": "ResourceRequirement",\n                    "ramMin": 8\n                }\n            ],\n            "id": "#revtool.cwl",\n            "inputs": [\n                {\n                    "id": "#revtool.cwl/input",\n                    "inputBinding": {},\n                    "type": "File"\n                }\n            ],\n            "outputs": [\n                {\n                    "id": "#revtool.cwl/output",\n                    "outputBinding": {\n                        "glob": "output.txt"\n                    },\n                    "type": "File"\n                }\n            ],\n            "stdout": "output.txt"\n        },\n        {\n            "baseCommand": "sort",\n            "class": "CommandLineTool",\n            "doc": "Sort lines using the `sort` command",\n            "hints": [\n                {\n                    "class": "ResourceRequirement",\n                    "ramMin": 8\n                }\n            ],\n            "id": "#sorttool.cwl",\n            "inputs": [\n                {\n                    "id": "#sorttool.cwl/reverse",\n                    "inputBinding": {\n                        "position": 1,\n                        "prefix": "-r"\n                    },\n                    "type": "boolean"\n                },\n                {\n                    "id": "#sorttool.cwl/input",\n                    "inputBinding": {\n                        "position": 2\n                    },\n                    "type": "File"\n                }\n            ],\n            "outputs": [\n                {\n                    "id": "#sorttool.cwl/output",\n                    "outputBinding": {\n                        "glob": "output.txt"\n                    },\n                    "type": "File"\n                }\n            ],\n            "stdout": "output.txt"\n        }\n    ],\n    "cwlVersion": "v1.0"\n}',
+                    },
+                },
+            });
 
-      // when
-      await runProcess(dispatch, getState, services);
+            // when
+            await runProcess(dispatch, getState, services);
 
-      // then
-      expect(services.containerRequestService.create).toHaveBeenCalledWith({
-        command: [
-          "arvados-cwl-runner",
-          "--api=containers",
-          "--local",
-          "--project-uuid=ce8i5-tpzed-yid70bw31f51234",
-          "/var/lib/cwl/workflow.json#main",
-          "/var/lib/cwl/cwl.input.json",
-        ],
-        containerImage: "arvados/jobs",
-        cwd: "/var/spool/cwl",
-        description: "basicFormTestDescription",
-        mounts: undefined,
-        name: "basicFormTestName",
-        outputName: undefined,
-        outputPath: "/var/spool/cwl",
-        ownerUuid: "ce8i5-tpzed-yid70bw31f51234",
-        priority: 1,
-        properties: {
-          workflowName: "revsort.cwl",
-          workflowUuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt",
-        },
-        runtimeConstraints: {
-          API: true,
-          api: true,
-          ram: 1073741824,
-          vcpus: 1,
-        },
-        schedulingParameters: { max_run_time: undefined },
-        state: "Committed",
-      });
+            // then
+            expect(services.containerRequestService.create).toHaveBeenCalledWith({
+                command: [
+                    "arvados-cwl-runner",
+                    "--api=containers",
+                    "--local",
+                    "--project-uuid=ce8i5-tpzed-yid70bw31f51234",
+                    "/var/lib/cwl/workflow.json#main",
+                    "/var/lib/cwl/cwl.input.json",
+                ],
+                containerImage: "arvados/jobs:2.0.4",
+                cwd: "/var/spool/cwl",
+                description: "basicFormTestDescription",
+                mounts: undefined,
+                name: "basicFormTestName",
+                outputName: undefined,
+                outputPath: "/var/spool/cwl",
+                ownerUuid: "ce8i5-tpzed-yid70bw31f51234",
+                priority: 1,
+                properties: {
+                    workflowName: "revsort.cwl",
+                    workflowUuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt",
+                },
+                runtimeConstraints: {
+                    API: true,
+                    ram: 1073741824,
+                    vcpus: 1,
+                },
+                schedulingParameters: { max_run_time: undefined },
+                state: "Committed",
+            });
 
-      // and
-      expect(dispatch).toHaveBeenCalledWith(newProcessUUID);
+            // and
+            expect(dispatch).toHaveBeenCalledWith(newProcessUUID);
+        });
     });
-  });
 });
index 2397601d8f1b5e8b0bba911ad1e54f897da8cfa3..3cc6e7131939b884d925153b456eb39ce2a06284 100644 (file)
@@ -7,7 +7,7 @@ import { unionize, ofType, UnionOf } from "~/common/unionize";
 import { ServiceRepository } from "~/services/services";
 import { RootState } from '~/store/store';
 import { getUserUuid } from "~/common/getuser";
-import { WorkflowResource, getWorkflowInputs, parseWorkflowDefinition } from '~/models/workflow';
+import { WorkflowResource, WorkflowRunnerResources, getWorkflow, getWorkflowInputs, parseWorkflowDefinition } from '~/models/workflow';
 import { getFormValues, initialize } from 'redux-form';
 import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from '~/views/run-process-panel/run-process-basic-form';
 import { RUN_PROCESS_INPUTS_FORM } from '~/views/run-process-panel/run-process-inputs-form';
@@ -15,7 +15,10 @@ import { WorkflowInputsData } from '~/models/workflow';
 import { createWorkflowMounts } from '~/models/process';
 import { ContainerRequestState } from '~/models/container-request';
 import { navigateTo } from '../navigation/navigation-action';
-import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM, VCPUS_FIELD, RAM_FIELD, RUNTIME_FIELD, OUTPUT_FIELD, API_FIELD } from '~/views/run-process-panel/run-process-advanced-form';
+import {
+    RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM, VCPUS_FIELD,
+    KEEP_CACHE_RAM_FIELD, RAM_FIELD, RUNTIME_FIELD, OUTPUT_FIELD, RUNNER_IMAGE_FIELD
+} 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';
@@ -73,19 +76,40 @@ export const openSetWorkflowDialog = (workflow: WorkflowResource) =>
         }
     };
 
+export const getWorkflowRunnerSettings = (workflow: WorkflowResource) => {
+    const advancedFormValues = {};
+    Object.assign(advancedFormValues, DEFAULT_ADVANCED_FORM_VALUES);
+
+    const wf = getWorkflow(parseWorkflowDefinition(workflow));
+    const hints = wf ? wf.hints : undefined;
+    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.coresMin) { advancedFormValues[VCPUS_FIELD] = resc.coresMin; }
+            if (resc.keep_cache) { advancedFormValues[KEEP_CACHE_RAM_FIELD] = resc.keep_cache; }
+            if (resc.acrContainerImage) { advancedFormValues[RUNNER_IMAGE_FIELD] = resc.acrContainerImage; }
+        }
+    }
+    return advancedFormValues;
+};
+
 export const setWorkflow = (workflow: WorkflowResource, isWorkflowChanged = true) =>
     (dispatch: Dispatch<any>, getState: () => RootState) => {
         const isStepChanged = getState().runProcessPanel.isStepChanged;
+
+        const advancedFormValues = getWorkflowRunnerSettings(workflow);
+
         if (isStepChanged && isWorkflowChanged) {
             dispatch(runProcessPanelActions.SET_STEP_CHANGED(false));
             dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
             dispatch<any>(loadPresets(workflow.uuid));
-            dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, DEFAULT_ADVANCED_FORM_VALUES));
+            dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, advancedFormValues));
         }
         if (!isWorkflowChanged) {
             dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
             dispatch<any>(loadPresets(workflow.uuid));
-            dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, DEFAULT_ADVANCED_FORM_VALUES));
+            dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, advancedFormValues));
         }
     };
 
@@ -118,13 +142,13 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
     const state = getState();
     const basicForm = getFormValues(RUN_PROCESS_BASIC_FORM)(state) as RunProcessBasicFormData;
     const inputsForm = getFormValues(RUN_PROCESS_INPUTS_FORM)(state) as WorkflowInputsData;
-    const advancedForm = getFormValues(RUN_PROCESS_ADVANCED_FORM)(state) as RunProcessAdvancedFormData || DEFAULT_ADVANCED_FORM_VALUES;
     const userUuid = getUserUuid(getState());
     if (!userUuid) { return; }
     const pathname = getState().runProcessPanel.processPathname;
     const { processOwnerUuid, selectedWorkflow } = state.runProcessPanel;
     const ownerUUid = !matchProjectRoute(pathname) ? userUuid : processOwnerUuid;
     if (selectedWorkflow) {
+        const advancedForm = getFormValues(RUN_PROCESS_ADVANCED_FORM)(state) as RunProcessAdvancedFormData || getWorkflowRunnerSettings(selectedWorkflow);
         const newProcessData = {
             ownerUuid: ownerUUid,
             name: basicForm.name,
@@ -135,12 +159,11 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
                 API: true,
                 vcpus: advancedForm[VCPUS_FIELD],
                 ram: advancedForm[RAM_FIELD],
-                api: advancedForm[API_FIELD],
             },
             schedulingParameters: {
                 max_run_time: advancedForm[RUNTIME_FIELD]
             },
-            containerImage: 'arvados/jobs',
+            containerImage: advancedForm[RUNNER_IMAGE_FIELD],
             cwd: '/var/spool/cwl',
             command: [
                 'arvados-cwl-runner',
@@ -166,7 +189,7 @@ export const runProcess = async (dispatch: Dispatch<any>, getState: () => RootSt
 export const DEFAULT_ADVANCED_FORM_VALUES: Partial<RunProcessAdvancedFormData> = {
     [VCPUS_FIELD]: 1,
     [RAM_FIELD]: 1073741824,
-    [API_FIELD]: true,
+    [RUNNER_IMAGE_FIELD]: "arvados/jobs"
 };
 
 const normalizeInputKeys = (inputs: WorkflowInputsData): WorkflowInputsData =>
index 0400b850a2b460ca2fe2d7d80ae98da6647c9fda..d9848291c98431abf8b67dec98a461146971abd3 100644 (file)
@@ -11,7 +11,6 @@ import { ExpandIcon } from '~/components/icon/icon';
 import * as IntInput from './inputs/int-input';
 import { min } from '~/validators/min';
 import { optional } from '~/validators/optional';
-import { SwitchField } from '~/components/switch-field/switch-field';
 
 export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm';
 
@@ -20,7 +19,7 @@ export const RUNTIME_FIELD = 'runtime';
 export const RAM_FIELD = 'ram';
 export const VCPUS_FIELD = 'vcpus';
 export const KEEP_CACHE_RAM_FIELD = 'keep_cache_ram';
-export const API_FIELD = 'api';
+export const RUNNER_IMAGE_FIELD = 'acr_container_image';
 
 export interface RunProcessAdvancedFormData {
     [OUTPUT_FIELD]?: string;
@@ -28,7 +27,7 @@ export interface RunProcessAdvancedFormData {
     [RAM_FIELD]: number;
     [VCPUS_FIELD]: number;
     [KEEP_CACHE_RAM_FIELD]?: number;
-    [API_FIELD]?: boolean;
+    [RUNNER_IMAGE_FIELD]: string;
 }
 
 export const RunProcessAdvancedForm =
@@ -96,13 +95,11 @@ export const RunProcessAdvancedForm =
                         </Grid>
                         <Grid item xs={12} md={6}>
                             <Field
-                                name={API_FIELD}
-                                component={SwitchField}
-                                switchProps={{
-                                    color: 'primary'
-                                }}
-                                label='API'
-                                helperText='When set, ARVADOS_API_HOST and ARVADOS_API_TOKEN will be set, and process will have networking enabled to access the Arvados API server.' />
+                                name={RUNNER_IMAGE_FIELD}
+                                component={TextField}
+                                label='Runner'
+                                required
+                                helperText='The container image with arvados-cwl-runner that will execute this workflow.' />
                         </Grid>
                     </Grid>
                 </ExpansionPanelDetails>