Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cmd/admission/app/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ type Options struct {
ProbeAddr string
WebhookPort int
FakeGPUNodes bool
GpuCdiEnabled bool
VolumeBindingTimeoutSeconds int
GPUSharingEnabled bool
}

Expand Down Expand Up @@ -61,12 +59,6 @@ func InitOptions() *Options {
fs.BoolVar(&options.FakeGPUNodes,
"fake-gpu-nodes", false,
"Enables running fractions on fake gpu nodes for testing")
fs.BoolVar(&options.GpuCdiEnabled,
"cdi-enabled", false,
"Specifies if the gpu device plugin uses the cdi devices api to set gpu devices to the pods")
fs.IntVar(&options.VolumeBindingTimeoutSeconds,
"volume-binding-timeout-seconds", 120,
"Volume binding timeout in seconds")
fs.BoolVar(&options.GPUSharingEnabled,
"gpu-sharing-enabled", false,
"Specifies if the GPU sharing is enabled")
Expand Down
3 changes: 1 addition & 2 deletions cmd/admission/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ func main() {
func registerPlugins(app *app.App) error {
admissionPlugins := plugins.New()

admissionGpuSharingPlugin := gpusharing.New(app.Client,
app.Options.GpuCdiEnabled, app.Options.GPUSharingEnabled)
admissionGpuSharingPlugin := gpusharing.New(app.Client, app.Options.GPUSharingEnabled)

admissionPlugins.RegisterPlugin(admissionGpuSharingPlugin)
app.RegisterPlugins(admissionPlugins)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ spec:
- "--health-probe-bind-address=:{{ .Values.admission.ports.probePort }}"
- "--metrics-bind-address=:{{ .Values.admission.ports.metricsPort }}"
- "--gpu-sharing-enabled={{ .Values.global.gpuSharing }}"
- "--cdi-enabled={{ .Values.admission.cdi }}"
{{- if .Values.admission.additionalArgs }}
{{- toYaml .Values.admission.additionalArgs | nindent 12 }}
{{- end }}
Expand Down
1 change: 0 additions & 1 deletion deployments/kai-scheduler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,3 @@ admission:
requests:
cpu: "250m"
memory: "128Mi"
cdi: false
12 changes: 5 additions & 7 deletions pkg/admission/webhook/v1alpha2/gpusharing/gpu_sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ const (
)

type GPUSharing struct {
kubeClient client.Client
gpuDevicePluginUsesCdi bool
gpuSharingEnabled bool
kubeClient client.Client
gpuSharingEnabled bool
}

func New(kubeClient client.Client, gpuDevicePluginUsesCdi bool, gpuSharingEnabled bool) *GPUSharing {
func New(kubeClient client.Client, gpuSharingEnabled bool) *GPUSharing {
return &GPUSharing{
kubeClient: kubeClient,
gpuDevicePluginUsesCdi: gpuDevicePluginUsesCdi,
gpuSharingEnabled: gpuSharingEnabled,
kubeClient: kubeClient,
gpuSharingEnabled: gpuSharingEnabled,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestValidate(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
kubeClient := fake.NewClientBuilder().WithRuntimeObjects(tt.pod).Build()
gpuSharingPlugin := New(kubeClient, false, tt.GPUSharingEnabled)
gpuSharingPlugin := New(kubeClient, tt.GPUSharingEnabled)
err := gpuSharingPlugin.Validate(tt.pod)
if err == nil && tt.error != nil {
t.Errorf("Validate() expected and error but actual is nil")
Expand Down
5 changes: 0 additions & 5 deletions pkg/binder/controllers/integration_tests/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (

schedulingv1alpha2 "github.com/NVIDIA/KAI-scheduler/pkg/apis/scheduling/v1alpha2"

admissionplugins "github.com/NVIDIA/KAI-scheduler/pkg/admission/plugins"
"github.com/NVIDIA/KAI-scheduler/pkg/admission/webhook/v1alpha2/gpusharing"
"github.com/NVIDIA/KAI-scheduler/pkg/binder/binding"
"github.com/NVIDIA/KAI-scheduler/pkg/binder/binding/resourcereservation"
"github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers"
Expand Down Expand Up @@ -112,14 +110,11 @@ var _ = BeforeSuite(func() {
informerFactory := informers.NewSharedInformerFactory(kubeClient, 0)

binderPlugins := plugins.New()
admissionPlugins := admissionplugins.New()
k8sPlugins, err := k8s_plugins.New(kubeClient, informerFactory, int64(options.VolumeBindingTimeoutSeconds))
Expect(err).NotTo(HaveOccurred())
binderPlugins.RegisterPlugin(k8sPlugins)
clientWithWatch, err := client.NewWithWatch(cfg, client.Options{})
Expect(err).NotTo(HaveOccurred())
gpuSharingPlugin := gpusharing.New(clientWithWatch, options.GpuCdiEnabled, options.GPUSharingEnabled)
admissionPlugins.RegisterPlugin(gpuSharingPlugin)

rrs := resourcereservation.NewService(false, clientWithWatch, "", 40*time.Second,
resourceReservationNameSpace, resourceReservationServiceAccount, resourceReservationAppLabelValue, scalingPodsNamespace)
Expand Down
Loading