Project

General

Profile

Actions

Feature #17054

open

Custom naming for scatter steps

Added by Peter Amstutz over 3 years ago. Updated about 2 months ago.

Status:
In Progress
Priority:
Normal
Assigned To:
-
Category:
CWL
Target version:
Story points:
-
Release:
Release relationship:
Auto

Description

Add an extension to cwltool that allows the user to provide an expression that will determine the runtime name of a workflow step or scatter step. When a new cwltool is released, update the dependency arvados-cwl-runner.

Suggested approach

1. Add a new process requirement to cwltool/extensions-v1.1.yml

- name: StepNameHint
  type: record
  inVocab: false
  extends: cwl:ProcessRequirement
  doc: |
    Provide a hint for naming the runtime workflow step in logs or user interface.
  fields:
    - name: class
      type: string
      doc: "Always 'StepNameHint'" 
      jsonldPredicate:
        "_id": "@type" 
        "_type": "@vocab" 
    - name: stepname:
      type: [string, Expression]
      doc: |
        A string or expression returning a string with the preferred name for the step.  
        If it is an expression, it is evaluated after the input object has been completely determined.

2. update supportedProcessRequirements

Add "http://commonwl.org/cwltool#StepNameHint" to process.py supportedProcessRequirements

3. Update setup_schema() in main.py

use_custom_schema("v1.2", "http://commonwl.org/cwltool", ext11)

you should also add this to the "else" branch:
use_standard_schema("v1.2")

4. Update WorkflowJobStep in workflow_job.py

Add code to the job() method that

  1. checks if the current workflow step has "http://commonwl.org/cwltool#StepNameHint" in "hints" or "requirements"
  2. If so, gets the value of "stepname"
  3. Then does self.name = expression.do_eval(stepname)

5. Add tests

Write a workflow that uses the new hint to with an expression that uses something from the input to set the name of the workflow step.

Write a test case that calls cwltool --enable-ext and checks that the log output uses the custom name.


Files

errormsg.txt (97.9 KB) errormsg.txt Jiayong Li, 06/08/2021 08:42 PM

Subtasks 1 (1 open0 closed)

Task #17456: ReviewNewPeter AmstutzActions

Related issues

Related to Arvados Epics - Idea #20273: More CWL runner improvementsNewActions
Actions

Also available in: Atom PDF