Policy YAML Examples
This page provides YAML examples for NVIDIA Run:ai native workload policies. These policies use a hierarchical YAML format with defaults, rules, and imposedAssets blocks organized by spec section.
Creating a New Rule Within a Policy
This example shows how to add a new limitation to the GPU usage for workloads of type workspace:
-
Check the workload API fields documentation and select the field(s) that are most relevant for GPU usage.
-
Search the field in the Policy YAML fields - reference table. For example, gpuDevicesRequest appears under the Compute fields sub-table and appears as follow:
-
Use the value type of the gpuDevicesRequest field indicated in the table - “integer” and navigate to the Value types table to view the possible rules that can be applied to this value type -
for integer, the options are:
- canEdit
- required
- min
- max
- step
-
Proceed to the Rule Type table, select the required rule for the limitation of the field - for example “max” and use the examples syntax to indicate the maximum GPU device requested.
Policy YAML Best Practices
Create a policy that has multiple defaults and rules
Create a policy that has multiple defaults and rules
Best practices description
Presentation of the syntax while adding a set of defaults and rules
Example
Allow only single selection out of many
Allow only single selection out of many
Best practices description
Blocking the option to create all types of data sources except the one that is allowed is the solution
Example
Create a robust set of guidelines
Create a robust set of guidelines
Best practices description
Set rules for specific compute resource usage, addressing most relevant spec fields
Example
Policy for distributed training workloads
Policy for distributed training workloads
Best practices description
Set rules and defaults for a distributed training workload with different setting for master and workers
Example
Examples for specific sections in the policy
Examples for specific sections in the policy
Best practices description
Environment creation
Example
Best practices description
Setting security measures
Example
Best practices description
Overriding the privileged system policy
Example
Best practices description
Impose an asset
Example