boundless-lifeguard-61788
09/18/2024, 10:07 PMshell_task = ShellTask(
name="shell_task",
debug=True,
script="""
{inputs.command} >> {outputs.stdout} 2>> {outputs.stderr}
""",
inputs=kwtypes(command=str),
output_locs=[
OutputLocation(var="stdout", var_type=FlyteFile, location="stdout.txt"),
OutputLocation(var="stderr", var_type=FlyteFile, location="stderr.txt"),
],
)
@task(
requests=Resources(cpu="4", mem="16Gi")
)
def call_shell_task(....
"name": "flytekit", "levelname": "ERROR", "message": "You are not supposed to nest @Task/@Workflow inside a @Task!"}
thankful-minister-83577
thankful-minister-83577
boundless-lifeguard-61788
09/19/2024, 12:56 AMthankful-minister-83577
thankful-minister-83577
boundless-lifeguard-61788
09/19/2024, 12:59 AMthankful-minister-83577
kwargs
so you have to follow up the stack. And yeah, docs could use a boostboundless-lifeguard-61788
09/19/2024, 2:13 PMshell_task = ShellTask(
name="shell_task",
debug=True,
script="""
{inputs.command} >> {outputs.stdout} 2>> {outputs.stderr}
""",
inputs=kwtypes(command=str),
output_locs=[
OutputLocation(var="stdout", var_type=FlyteFile, location="stdout.txt"),
OutputLocation(var="stderr", var_type=FlyteFile, location="stderr.txt"),
],
requests=Resources(cpu="2", mem="16Gi")
)
boundless-lifeguard-61788
09/20/2024, 5:41 PMValueError: Error encountered while executing 'load':
Only tasks with a single output are supported in map tasks.
Are Shell tasks just running python subprocess? https://github.com/flyteorg/flytekit/blob/2dcbb90f7a331eb2d75a826053fc41f944ad4aa2/flytekit/extras/tasks/shell.py#L52
I can use a regular task that runs python subprocess instead of ShellTask and map that task. What advantages do ShellTasks have ?