damp-lion-88352
02/06/2025, 3:44 PM@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?average-finland-92144
02/06/2025, 8:13 PMred-school-96573
02/07/2025, 9:24 AM