From 6f0cefd2cc74af9570efbcc0068acb1a297d5849 Mon Sep 17 00:00:00 2001 From: "Jerry J. Harrow" <84593277+jerryharrow@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:09:48 -0500 Subject: [PATCH] feat: Add accelerator type for Slurm [FOUNDENG-483] (#711) If the Slrum hpcPartitionDetails contains accelerator type set it for the resource pool. --- master/internal/rm/dispatcherrm/dispatcher_resource_manager.go | 2 ++ .../rm/dispatcherrm/dispatcher_resource_manager_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/master/internal/rm/dispatcherrm/dispatcher_resource_manager.go b/master/internal/rm/dispatcherrm/dispatcher_resource_manager.go index f294b78f447..021e7de3b5a 100644 --- a/master/internal/rm/dispatcherrm/dispatcher_resource_manager.go +++ b/master/internal/rm/dispatcherrm/dispatcher_resource_manager.go @@ -97,6 +97,7 @@ type hpcPartitionDetails struct { TotalGpuSlots int `json:"totalGpuSlots"` TotalAvailableCPUSlots int `json:"totalAvailableCpuSlots"` TotalCPUSlots int `json:"totalCpuSlots"` + Accelerator string `json:"accelerator"` } // hpcNodeDetails holds HPC Slurm node details. @@ -1379,6 +1380,7 @@ func (m *dispatcherResourceManager) summarizeResourcePool( ImageId: "", InstanceType: wlmName, Details: &resourcepoolv1.ResourcePoolDetail{}, + Accelerator: v.Accelerator, } poolNameMap[pool.Name] = &pool result = append(result, &pool) diff --git a/master/internal/rm/dispatcherrm/dispatcher_resource_manager_test.go b/master/internal/rm/dispatcherrm/dispatcher_resource_manager_test.go index eec8538742c..a88dc9f2b40 100644 --- a/master/internal/rm/dispatcherrm/dispatcher_resource_manager_test.go +++ b/master/internal/rm/dispatcherrm/dispatcher_resource_manager_test.go @@ -243,6 +243,7 @@ func Test_summarizeResourcePool(t *testing.T) { TotalAvailableGpuSlots: 2, TotalNodes: 10, TotalGpuSlots: 5, + Accelerator: "tesla", } p2 := hpcPartitionDetails{ TotalAvailableNodes: 0, @@ -339,6 +340,7 @@ func Test_summarizeResourcePool(t *testing.T) { SlotsAvailable: 5, SlotsUsed: 3, NumAgents: 10, + Accelerator: "tesla", }, { Name: "partition 2",