Here is a demo with slurm's python function task. ...
# slurm-flyte-wg
d
Here is a demo with slurm's python function task.
Copy code
@task(
    task_config=SlurmFunction(
        slurm_host="<http://ec2-18-207-193-50.compute-1.amazonaws.com|ec2-18-207-193-50.compute-1.amazonaws.com>",
        srun_conf={
            "partition": "debug",
            "job-name": "fn-task",
            "output": "/home/ubuntu/fn_task.log"
        },
        script="""
#!/bin/bash

# == Pre-Execution ==
echo "Hello, world!"

# Setup env vars
export MY_ENV_VAR=456

# Activate virtual env
. /home/ubuntu/.cache/pypoetry/virtualenvs/demo-poetry-RLi6T71_-py3.12/bin/activate

# == Execute Flyte Task Function ==
{task.fn}

# == Post-Execution ==
echo "Success!!"
"""
    )
)
def plus_one(x: int) -> int:
    print(os.getenv("MY_ENV_VAR"))
    return int(os.getenv("MY_ENV_VAR")) + 1
pr link: https://github.com/flyteorg/flytekit/pull/3005 cc @glamorous-carpet-83516 @freezing-airport-6809 @eager-processor-63090 can we tag some potential users to take a look at this?
a
@red-school-96573
r
Thank you, @average-finland-92144, for pointing this out. Great job, everyone! It looks promising. I will happily test the new Slurm agent.