salmon-flower-36598
09/17/2024, 2:45 PMfrom flytekit import task, Resources, workflow
@task(
requests=Resources(
cpu="2",
mem="0.5Gi",
),
limits=Resources(
cpu="2",
mem="0.5Gi",
),
)
def foo():
print('task')
@workflow
def my_wf():
foo()
foo().with_overrides(
requests=Resources(
cpu="1",
mem="2Gi",
),
limits=Resources(
cpu="1",
mem="4Gi",
),
)
Here is the output of limits on the pod:
NAMESPACE POD CONTAINER MEM_REQ MEM_LIM CPU_REQ CPU_LIM
flyte flyte-backend-flyte-binary-548f5d59fc-ln6q8 flyte <none> <none> <none> <none>
flytesnacks-development azpd24c4qpc2w2jlqvhz-n0-0 azpd24c4qpc2w2jlqvhz-n0-0 512Mi 512Mi 2 2
flytesnacks-development azpd24c4qpc2w2jlqvhz-n1-0 azpd24c4qpc2w2jlqvhz-n1-0 1Gi 1Gi 1 1
Here is the task resource config:
task_resources:
defaults:
cpu: 500m
memory: 10Gi
As you see, I am setting a memory default of 10Gi, but the pod only gets allocated max of 1Gi, which I believe is the default.
Is there somewhere else , I need to update ?damp-lion-88352
09/17/2024, 3:12 PMdamp-lion-88352
09/17/2024, 3:12 PMdamp-lion-88352
09/17/2024, 3:12 PMsalmon-flower-36598
09/17/2024, 3:30 PMsalmon-flower-36598
09/17/2024, 3:41 PMsalmon-flower-36598
09/17/2024, 3:49 PMdamp-lion-88352
09/17/2024, 4:25 PMdamp-lion-88352
09/17/2024, 4:30 PMdamp-lion-88352
09/17/2024, 4:31 PMsalmon-flower-36598
09/17/2024, 4:43 PMsalmon-flower-36598
09/17/2024, 4:43 PMaverage-finland-92144
09/17/2024, 4:55 PMrequests=limits
, and that's better for the K8s schedulersalmon-flower-36598
09/17/2024, 5:03 PMaverage-finland-92144
09/17/2024, 5:06 PMtask_resources
it seems you need to set both. After doing so, what's the behavior of just setting requests
in the @task
decorator?salmon-flower-36598
09/17/2024, 5:07 PMaverage-finland-92144
09/17/2024, 5:11 PMdamp-lion-88352
09/18/2024, 1:25 AMdamp-lion-88352
09/18/2024, 1:25 AMaverage-finland-92144
09/18/2024, 10:38 AMdefaults
requests
and limits
is not well explained