<#1324 Preserve DRA resource claims when overridin...
# flyte-github
a
#1324 Preserve DRA resource claims when overriding task resources Pull request opened by popojk Problem For GPU tasks that claim devices through Kubernetes Dynamic Resource Allocation (a
ResourceClaimTemplate
linked via the primary container's
resources.claims
), declaring a task-level
Resources(cpu=..., memory=...)
silently dropped that claim. Both resource paths rebuilt the container resources with only `limits`/`requests` and left
.claims
out: • Build path — `task_serde._get_k8s_pod`: when a task declares cpu/mem it merges those into the pod template's primary container but rebuilt
V1ResourceRequirements(limits=, requests=)
without
claims
. • Remote override path —
_apply_overrides_to_primary_container
(reached from
TaskDetails.override(resources=...)
on a
k8s_pod
task): fully replaced the container's
resources
, discarding
claims
. Result: the DRA claim link was lost, so the pod scheduled with no GPU (or failed to schedule). Users had to work around it by never setting
resources=
on GPU tasks. Fix Preserve the existing
.claims
when rebuilding the container resources on both paths. cpu/mem/gpu overrides now merge in alongside the DRA claim instead of replacing it. Tests •
test_get_k8s_pod_preserves_dra_claims_with_task_resources
— build path keeps the claim next to task-declared cpu/memory. •
test_resource_override_on_pod_template_preserves_dra_claims
—
.override(resources=...)
on a pod-template task keeps the claim. flyteorg/flyte-sdk