policy

API Reference: v1/policy.proto

Policy specifies the power policies for devices. Policies are defined within a topology with unique names describing the power min-max values.

Table of Contents

Messages

ComputerSystemLimitsPolicy

A ComputerSystemLimit.v1 policy type can be bound to any ComputerSystem type device or entity, as designated by the Scope field. Some ComputerSystem devices may be suited for a more specific policy (e.g. VeraRubinLimits.v1 ).

Field Type Description
type string Defines the policy type. Policy types will be associated with a pre-defined struct within DPS and will allow DPS to interpret the values of the policy.
scope PolicyScope Defines which entities/resource groups the policy applies to
spec ComputerSystemLimitsSpec Specifies the policy spec

ComputerSystemLimitsSpec

ComputerSystemLimitsSpec specifies the computer system operating range

Field Type Description
oneof range_spec.operating_range_watts ComputerSystemLimitsSpec.OperatingRange Operating range in watts
oneof range_spec.operating_range_percent ComputerSystemLimitsSpec.OperatingRange Operating range in percentages of device max
gpu_target_percent double Relative GPU target, as a percentage. This value represents a % of the node ceiling. Must be finite and between 0 and 100, inclusive.
cpu_target_percent double Relative CPU target, as a percentage. This value represents a % of the node ceiling. Must be finite and between 0 and 100, inclusive.
memory_target_percent double Relative Memory target, as a percentage. This value represents a % of the node ceiling. Must be finite and between 0 and 100, inclusive.

ComputerSystemLimitsSpec.OperatingRange

Field Type Description
ceiling double Operating range ceiling. Must be finite and greater than or equal to 0.
target double Operating range target. Must be finite and greater than or equal to 0.
floor double Operating range floor. Must be finite and greater than or equal to 0.

GPUPolicies

GPUPolicies is a list of GPUPolicy objects. Each policy in the list should address a unique GPU.

Field Type Description
policies repeated GPUPolicy The GPU policies. Each policy should address a distinct GPU

GPUPolicy

GPUPolicy specifies the power policy for a single GPU in a node.

Field Type Description
oneof _gpu_id.gpu_id optional uint32 The GPU ID
oneof _power_limit.power_limit optional PowerLimit The power limit. Null value means the GPU does not have a set policy. Use null to remove GPU-specific policy assignment

PolicyApplyStatus

Policy application status including applied policy details

Field Type Description
policy PolicyObject The policy that was applied
status Status Operation status

PolicyCreateRequest

PolicyCreateRequest is used by the TopologyManagementService.PolicyCreate.

Field Type Description
object PolicyObject Full policy object to be created (name, limits, properties)

PolicyCreateResponse

PolicyCreateResponse is returned if policy creation was successful.

Field Type Description
status Status Operation status

PolicyLimit

PolicyLimit specifies a power limit for a specific entity type.

Field Type Description
element_type PolicyElementType The entity type to which the power limit applies. A valid PolicyObject must include at least one limit with POLICY_ELEMENT_TYPE_NODE (Node). Must be a defined enum value.
power_limit PowerLimit The power limit value

PolicyObject

PolicyObject specifies a topology or resource group entity power policy.

Field Type Description
name string Name of the policy. The name must be unique within a topology.
limits repeated PolicyLimit Limits for the policy. Must contain at least one item and include at least one limit with element_type NODE.
properties google.protobuf.Struct Properties for the policy

PolicyScope

PolicyScope specifies entities from a pool a policy applies to. These entities are selected by:

  • entity name, or other entity properties
  • entity device properties
  • entity membership in a resource group
  • go-expr expression that selects entities

The pool of entities is determined by the policy binding and can be:

  • all defined entities (global)
  • entities in the topology
  • entities that are members of a resource group
Field Type Description
oneof scope.entities PolicyScope.Entities none
oneof scope.devices PolicyScope.Devices none
oneof scope.resource_groups PolicyScope.ResourceGroups none
oneof scope.expr string none

PolicyScope.Device

Device message type contains the device type and model. Both fields are optional, but at least one must be present

Field Type Description
type string none
model string none

PolicyScope.Devices

Devices message type contains a list of entity devices

Field Type Description
devices repeated PolicyScope.Device Entity devices in scope. Must contain at least one item.

PolicyScope.Entities

Entities message type contains entity names

Field Type Description
entities repeated string Entity names in scope. Each entity name must not be empty.

PolicyScope.ResourceGroups

ResourceGroups message type contains resource groups by id

Field Type Description
resource_groups repeated string Resource group ids in scope. Each resource group id must not be empty.

PowerLimit

PowerLimit specifies a power limit for a specific entity

Field Type Description
oneof power_limit.watts double Power limit in watts. Must be finite and greater than 0.
oneof power_limit.percentage double Power limit as a percentage. Must be finite and greater than 0 and no more than 100.

Enums

PolicyElementType

PolicyElementType specifies the type of entity to which the power limit applies

Name Number Description
POLICY_ELEMENT_TYPE_NODE 0 none
POLICY_ELEMENT_TYPE_GPU 1 none
POLICY_ELEMENT_TYPE_CPU 2 none
POLICY_ELEMENT_TYPE_MEMORY 3 none

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type

double
double double float

float
float float float

int32
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int

int64
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long

uint32
Uses variable-length encoding. uint32 int int/long

uint64
Uses variable-length encoding. uint64 long int/long

sint32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int

sint64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long

fixed32
Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int

fixed64
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long

sfixed32
Always four bytes. int32 int int

sfixed64
Always eight bytes. int64 long int/long

bool
bool boolean boolean

string
A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode

bytes
May contain any arbitrary sequence of bytes. string ByteString str