Skip to content

Commit

Permalink
feat: override partition description (#741) [DET-9107]
Browse files Browse the repository at this point in the history
Add ability to override partition descriptions.
  • Loading branch information
stoksc authored and EmilyBonar committed Jul 20, 2023
1 parent cf2dd76 commit c66ad76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ type DispatcherPartitionOverrideConfigs struct {
ProxyNetworkInterface *string `json:"proxy_network_interface"`
SlotType *device.Type `json:"slot_type"`
TaskContainerDefaultsConfig *model.TaskContainerDefaultsConfig `json:"task_container_defaults"`
Description string `json:"description"`
}
15 changes: 11 additions & 4 deletions master/internal/rm/dispatcherrm/dispatcher_resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,8 @@ func (m *dispatcherResourceManager) startLauncherJob(
return
}

//nolint:lll
ctx.Log().WithField("allocation-id", msg.AllocationID).WithField("description", msg.Spec.Description).Infof("DispatchID is %s",
dispatchID)
ctx.Log().WithField("allocation-id", msg.AllocationID).
WithField("description", msg.Spec.Description).Infof("DispatchID is %s", dispatchID)

m.addDispatchIDToAllocationMap(dispatchID, req.AllocationID)

Expand Down Expand Up @@ -1418,9 +1417,17 @@ func (m *dispatcherResourceManager) summarizeResourcePool(
slotsPerAgent = int(slotsAvailable) / v.TotalNodes
}

description := wlmName + "-managed pool of resources"
// Due to viper.MergeConfigMap, map keys in configurations lose case. We match case
// insensitive here to handle partitions with upper case characters, at the cost of
// incorrectly matching when names are only equal when comparing case-insensitive.
if overrides, ok := m.rmConfig.PartitionOverrides[strings.ToLower(v.PartitionName)]; ok {
description = overrides.Description
}

pool := resourcepoolv1.ResourcePool{
Name: v.PartitionName,
Description: wlmName + "-managed pool of resources",
Description: description,
Type: resourcepoolv1.ResourcePoolType_RESOURCE_POOL_TYPE_STATIC,
NumAgents: int32(v.TotalNodes),
SlotType: slotType.Proto(),
Expand Down

0 comments on commit c66ad76

Please sign in to comment.