Hi Flyte team! I'm trying to understand the best w...
# flyte-support
s
Hi Flyte team! I'm trying to understand the best way to run containerized workloads with the Flyte Slurm backend. I noticed that SlurmTask doesn't have a
container_image
parameter like regular Flyte tasks. Is there a recommended approach for running Flyte containerized tasks on Slurm?
f
Hi, you can refer to this example. You must use a Slurm or SlurmShellTask in your Python code. However, you need to run a connector/agent that support Slurm task before executing the task.
👍 1
s
Hi, thank you for your reply. I saw the example — it looks like we need to define the task using
SlurmTask
or
SlurmShellTask
in Python. My follow-up question is: *is it possible to define a task using
SlurmFunction
(or similar) that is also containerized?*For example, can we create a task that runs in a container but still submits the job through Slurm?
Copy code
@task(
    task_config=SlurmFunction(
        node_count=1,
        partition="debug",
        time_limit="10:00"
    ),
    container_image="ubuntu:latest"
)
def my_task() -> str:
    return "Hello from container"
f
Hi, for now flyte do not open a container to run Slurm task in flyte backend cluster. Instead it only send the task request to your own Slurm service via agent/connector(a gRPC server). So the data flow will be like: flyte backend -> flyte agent/connector -> your Slurm service. I not sure whether i've answered your question?
🙏 1
s
Yes, you did. This is very helpful!
👍 1