From 69cbd9c6c91c2315a7388475e0dce2c4f1c9b74c Mon Sep 17 00:00:00 2001 From: Jeev B Date: Wed, 11 Oct 2023 20:19:45 -0700 Subject: [PATCH] No auto injection of toleration for explicitly requested unpartitioned GPUs Signed-off-by: Jeev B --- .../go/tasks/pluginmachinery/flytek8s/pod_helper.go | 9 --------- .../go/tasks/pluginmachinery/flytek8s/pod_helper_test.go | 6 ------ 2 files changed, 15 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go index caa83def5e7..6c80fbd09d8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go @@ -33,8 +33,6 @@ const defaultContainerTemplateName = "default" const primaryContainerTemplateName = "primary" const PrimaryContainerKey = "primary_container_name" -const GpuPartitionSizeNotSet = "NotSet" - // AddRequiredNodeSelectorRequirements adds the provided v1.NodeSelectorRequirement // objects to an existing v1.Affinity object. If there are no existing required // node selectors, the new v1.NodeSelectorRequirement will be added as-is. @@ -195,13 +193,6 @@ func ApplyGPUNodeSelectors(podSpec *v1.PodSpec, gpuAccelerator *core.GPUAccelera } if config.GetK8sPluginConfig().GpuUnpartitionedToleration != nil { partitionSizeTol = config.GetK8sPluginConfig().GpuUnpartitionedToleration - } else { - partitionSizeTol = &v1.Toleration{ - Key: config.GetK8sPluginConfig().GpuPartitionSizeNodeLabel, - Value: GpuPartitionSizeNotSet, - Operator: v1.TolerationOpEqual, - Effect: v1.TaintEffectNoSchedule, - } } case *core.GPUAccelerator_PartitionSize: partitionSizeNsr = &v1.NodeSelectorRequirement{ diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go index 5b6c66a691b..5c503239d0f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go @@ -626,12 +626,6 @@ func TestApplyGPUNodeSelectors(t *testing.T) { Operator: v1.TolerationOpEqual, Effect: v1.TaintEffectNoSchedule, }, - { - Key: "gpu-partition-size", - Value: GpuPartitionSizeNotSet, - Operator: v1.TolerationOpEqual, - Effect: v1.TaintEffectNoSchedule, - }, }, podSpec.Tolerations, )