creamy-shampoo-53278
02/18/2025, 4:39 PMSlurmShellTask
! Here’s an example task:
write_file_task = SlurmShellTask(
name="write-file",
script="""#!/bin/bash
echo "[SlurmShellTask] Write something into a file..." >> {inputs.x}
if grep "file" {inputs.x}
then
echo "Found a string 'file'!" >> {inputs.x}
else
echo "'file' not found!"
fi
""",
task_config=Slurm(
ssh_config={
"host": "aws2",
"username": "ubuntu",
},
sbatch_conf={
"partition": "debug",
"job-name": "tiny-slurm",
}
),
inputs=kwtypes(x=str),
output_locs=[OutputLocation(var="i", var_type=FlyteFile, location="{inputs.x}")],
)
A workflow that demonstrates passing files between tasks: https://github.com/JiangJiaWei1103/Flyte-Demos/blob/main/slurm_agent/script/shell_3.py
Observations when passing files between tasks:
1. FlyteFile as an input type is problematic – The file will be created on the Slurm cluster and can't be found on the local machine
2. Output location type mismatch – Even though var_type
in output_locs
is set to FlyteFile
, it’s actually a str
I’d love to hear your thoughts on this. Thanks!average-finland-92144
02/18/2025, 6:08 PMdamp-lion-88352
02/19/2025, 3:04 PMcreamy-shampoo-53278
02/19/2025, 4:42 PMaverage-finland-92144
02/19/2025, 5:03 PMeager-processor-63090
02/22/2025, 12:36 AMslurm-agent-dev
branch? Seems most active. Also, are the scripts in the flyte-demos repo above the most up to date examples moving forward?damp-lion-88352
02/22/2025, 3:42 AMdamp-lion-88352
02/22/2025, 3:43 AMdamp-lion-88352
02/22/2025, 5:50 AMdamp-lion-88352
02/24/2025, 4:42 AM