#1949 Added subproc_raise public facing function for calling shell commands
Pull request opened by
pryce-turner
TL;DR
ShellTask works great in simple situations but falls short when the DAG or data structures get complicated.
Type
☐ Bug Fix
☑︎ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☐ Unit tests added
☑︎ Code documentation added
☐ Any pending items have an associated Issue
Complete description
A lot of bioinformatics tools are based on Java/Perl/C++ and therefore require using ShellTask. Over the course of developing the variant discovery demo I started with using ShellTask almost exclusively since it's the first-class abstraction for doing that sort of thing. However, I quickly ran into how limiting it was and switched almost exclusively to the function in this PR to enable the flexibility that I need.
For example, I'm using a list of inputs that's not necessarily known at compile time, requiring the use of dynamic workflows. ShellTask works fine in these, but the interface is so rigid that I couldn't repackage the outputs into the requisite dataclasses after processing, without using a new python task specifically for that purpose. Using a regular python task here allows me to unpack and repack dataclasses before and after executing the shell command. I also tried using ShellTasks within eager so I could operate on those outputs within the workflow context, but eager doesn't support them yet. Long story short, ShellTask works great in simple situations but falls short when the DAG or data structures get complicated. I know there's already _run_script but that's marked private/internal so I didn't think that would be appropriate.
I marked this as a draft to start a conversation around this functionality. I think this would be a good option with few drawbacks but would like to solicit feedback.
Follow-up issue
NA
flyteorg/flytekit
Codecov: 60.64% (-1.98%) compared to 87a3f67
Codecov: 0.00% of diff hit (target 62.61%)
GitHub Actions: build-plugins (3.8, flytekit-whylogs)
GitHub Actions: build-plugins (3.8, flytekit-vscode)
✅ 26 other checks have passed
26/30 successful checks