Custom naming for scatter steps
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.
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
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:
4. Update WorkflowJobStep in workflow_job.py¶
Add code to the job() method that
- checks if the current workflow step has "http://commonwl.org/cwltool#StepNameHint" in "hints" or "requirements"
- If so, gets the value of "stepname"
- 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.