<#7237 fix: use configurable GPU resource name ins...
# flyte-github
a
#7237 fix: use configurable GPU resource name instead of hardcoded nvidia.com/gpu Pull request opened by nuthalapativarun Tracking issue Closes #6746 Why are the changes needed? Two code paths hardcoded
"<http://nvidia.com/gpu|nvidia.com/gpu>"
when building Kubernetes
ResourceList
entries from Flyte GPU resource requirements. This hardcoding took precedence over the
GpuResourceName
field already configurable in
K8sPluginConfig
(via the
gpu-resource-name
Helm/propeller config value), making it impossible to use alternative GPU resource types such as
<http://amd.com/gpu|amd.com/gpu>
or
<http://intel.com/gpu|intel.com/gpu>
. The affected paths were: •
flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go
—
ToK8sResourceList
used the package-level
ResourceNvidiaGPU
constant. •
flytepropeller/pkg/controller/nodes/task/taskexec_context.go
—
convertTaskResourcesToRequirements
used
utils.ResourceNvidiaGPU
. Note that
SanitizeGPUResourceRequirements
and
ApplyResourceOverrides
in
container_helper.go
already correctly read from
config.GetK8sPluginConfig().GpuResourceName
. This PR brings the two remaining call sites into alignment. What changes were proposed in this pull request? •
flyteplugins/.../flytek8s/utils.go
: Import
flytek8s/config
and replace
ResourceNvidiaGPU
with
config.GetK8sPluginConfig().GpuResourceName
in
ToK8sResourceList
. •
flytepropeller/.../taskexec_context.go
: Import
flytek8s/config
and replace
utils.ResourceNvidiaGPU
with
flytek8sConfig.GetK8sPluginConfig().GpuResourceName
in
convertTaskResourcesToRequirements
. Remove now-unused
flytepropeller/pkg/utils
import. • Tests: Update both test files to assert against
config.GetK8sPluginConfig().GpuResourceName
rather than the hardcoded constant, confirming the behavior is config-driven. How was this patch tested? •
go test ./go/tasks/pluginmachinery/flytek8s/...
in
flyteplugins/
— passes. •
go test ./pkg/controller/nodes/task/...
in
flytepropeller/
— passes. Labels • fixed • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. flyteorg/flyte