Workspaces Policy
A Workspaces policy places resource restrictions and defaults on workspaces in the Run:ai platform. Restrictions and default values can be placed on CPUs, GPUs, and other resources or entities.
Example¶
Below is an example policy you can use in your platform.
Note
- Not all the configurable fields available are listed in the example below.
- Replace the values listed in the example below with values that match your platform requirements.
defaults:
environment:
allowPrivilegeEscalation: false
createHomeDir: true
environmentVariables:
- name: MY_ENV
value: my_value
workspace:
allowOverQuota: true
rules:
compute:
cpuCoreLimit:
min: 0
max: 9
required: true
gpuPortionRequest:
min: 0
max: 10
s3:
url:
options:
- displayed: "Google"
value: "https://www.google.com"
- displayed: "Yahoo"
value: "https://www.yahoo.com"
environment:
imagePullPolicy:
options:
- displayed: "Always"
value: "Always"
- displayed: "Never"
value: "Never"
required: true
runAsUid:
min: 1
max: 32700
createHomeDir:
canEdit: false
allowPrivilegeEscalation:
canEdit: false
workspace:
allowOverQuota:
canEdit: false
imposedAssets:
dataSources:
nfs:
canAdd: false
Viewing or Edit a Policy¶
To view or edit a policy:
- Press Tools and Settings.
- Press Policies. The policy grid is displayed.
- Select a policy from the list. If there are no policies, then create a new policy.
- Pres Edit to view the policy details, then press Edit Policy to edit the YAML file.
- When done, press Apply.
Creating a New Policy¶
To create a policy:
- Press Tools and Settings.
- Press Policies. The policy grid is displayed.
- Press New Policy.
- Select a scope for the policy.
- Select a workload type using the dropdown.
- In the Policy YAML pane, press + POLICY YAML to open the policy editor.
- Enter your policy in the policy editor. Add policy properties and variables in YAML format. When complete, press APPLY.
- When done, press SAVE POLICY.
Note
After saving, the form will wait for the policy to sync with the cluster.