Skip to content

compound workflow with makefile style target #1201

@BoPeng

Description

@BoPeng

Running the following script

[analyze]
parameter: par=5
output: 'out.txt'

print(f'Analyze data with parameter {par}')
with open(_output, 'w') as out:
    out.write(f'Result from parameter {par}')

[summarize]
input: 'out.txt'    
print(f'Writing report with input out.txt')
report: input='out.txt', output='out.md'
    ## A summary report

[clean]
sh:
   echo Cleaning up
   rm -f out.txt out.md

with command

$ sos run test2 clean+summarize --par 20

generate this

INFO: Running clean:
INFO: Running summarize:
Writing report with input out.txt
Cleaning up
INFO: Workflow clean+summarize (ID=95ee5d7541554ad8) is executed successfully with 2 completed steps.

or

INFO: Running clean:
INFO: Running analyze:
Cleaning up
Analyze data with parameter 20
INFO: output:   out.txt
ERROR: [analyze (out.txt)]: Output target out.txt does not exist after the completion of step analyze
[clean+summarize]: 1 pending step: summarize

So basically the clean step is executed in parallel to the summarize workflow, and removes out.txt at an undetermined time.

Perhaps we should handle

clean+summarize

as

sos run clean
sos run summarize

instead of a single workflow with two parts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions