skypilot-users

Is there a way to create a python Task object from .yaml config?

I want to create a python Task object from a .yaml config file. Is there a built-in method in the library to achieve this?

Ja

Jason Krone

Asked on Jan 31, 2024

Yes, you can create a python Task object from a .yaml config file using the Task.from_yaml() method. Here's an example:

import sky
from sky import Task

t = Task.from_yaml('~/mytask.yaml')

sky.launch(t, cluster_name='myclus')

You can also add more information to the YAML file in your python script, such as filling in arguments.

Jan 31, 2024Edited by