from truefoundry.deploy import Resources, NodeSelector, NvidiaGPU
from truefoundry.workflow import task, workflow, PythonTaskConfig, TaskPythonBuild
sample_task_config = PythonTaskConfig(
# `TaskPythonBuild` helps specify the details of your Python Code.
# These details will be used to templatize a DockerFile to build your Docker Image
image=TaskPythonBuild(
python_version="3.9",
# Pip packages to install.`truefoundry[workflow]` is a mandatory dependency
pip_packages=["truefoundry[workflow]"],
),
resources=Resources(
cpu_request=2,
cpu_limit=4,
memory_request=12000,
memory_limit=14000,
. # Supported GPUs are -> "T4", "A100_40GB", "A100_80GB", "V100"
devices=[NvidiaGPU(name="T4", count=1)]],
node=NodeSelector(
# possible values "spot", "on_demand", "spot_fallback_on_demand"
capacity_type="spot_fallback_on_demand"
)
),
service_account="<service-account>",
)
@task(task_config=sample_task_config)
def my_task():
...