|
| 1 | +# Cluster Setup |
| 2 | + |
| 3 | +The cluster setup installs Red Hat OpenShift AI and Coscheduler, configures Kueue, |
| 4 | +cluster roles, and priority classes. |
| 5 | + |
| 6 | +If MLBatch is deployed on a cluster that used to run earlier versions of ODH, |
| 7 | +[MCAD](https://github.com/project-codeflare/mcad), Red Hat OpenShift AI, or Coscheduler, |
| 8 | +make sure to scrub traces of these installations. In particular, make sure to |
| 9 | +delete the following custom resource definitions (CRD) if present on the |
| 10 | +cluster. Make sure to delete all instances prior to deleting the CRDs: |
| 11 | +```sh |
| 12 | +# Delete old appwrappers and crd |
| 13 | +oc delete appwrappers --all -A |
| 14 | +oc delete crd appwrappers.workload.codeflare.dev |
| 15 | + |
| 16 | +# Delete old noderesourcetopologies and crd |
| 17 | +oc delete noderesourcetopologies --all -A |
| 18 | +oc delete crd noderesourcetopologies.topology.node.k8s.io |
| 19 | +``` |
| 20 | + |
| 21 | +## Priorities |
| 22 | + |
| 23 | +Create `default-priority`, `high-priority`, and `low-priority` priority classes: |
| 24 | +```sh |
| 25 | +oc apply -f setup.RHOAI-v2.14/mlbatch-priorities.yaml |
| 26 | +``` |
| 27 | + |
| 28 | +## Coscheduler |
| 29 | + |
| 30 | +Install Coscheduler v0.28.9 as a secondary scheduler and configure packing: |
| 31 | +```sh |
| 32 | +helm install scheduler-plugins --namespace scheduler-plugins --create-namespace \ |
| 33 | + scheduler-plugins/manifests/install/charts/as-a-second-scheduler/ \ |
| 34 | + --set-json pluginConfig='[{"args":{"scoringStrategy":{"resources":[{"name":"nvidia.com/gpu","weight":1}],"requestedToCapacityRatio":{"shape":[{"utilization":0,"score":0},{"utilization":100,"score":10}]},"type":"RequestedToCapacityRatio"}},"name":"NodeResourcesFit"}]' |
| 35 | +``` |
| 36 | +Patch Coscheduler pod priorities: |
| 37 | +```sh |
| 38 | +oc patch deployment -n scheduler-plugins --type=json --patch-file setup.RHOAI-v2.14/coscheduler-priority-patch.yaml scheduler-plugins-controller |
| 39 | +oc patch deployment -n scheduler-plugins --type=json --patch-file setup.RHOAI-v2.14/coscheduler-priority-patch.yaml scheduler-plugins-scheduler |
| 40 | +``` |
| 41 | + |
| 42 | +## Red Hat OpenShift AI |
| 43 | + |
| 44 | +Create the Red Hat OpenShift AI subscription: |
| 45 | +```sh |
| 46 | +oc apply -f setup.RHOAI-v2.14/mlbatch-subscription.yaml |
| 47 | +```` |
| 48 | +Identify install plan: |
| 49 | +```sh |
| 50 | +oc get ip -n redhat-ods-operator |
| 51 | +``` |
| 52 | +``` |
| 53 | +NAMESPACE NAME CSV APPROVAL APPROVED |
| 54 | +redhat-ods-operator install-kmh8w rhods-operator.2.10.0 Manual false |
| 55 | +``` |
| 56 | +Approve install plan replacing the generated plan name below with the actual |
| 57 | +value: |
| 58 | +```sh |
| 59 | +oc patch ip -n redhat-ods-operator --type merge --patch '{"spec":{"approved":true}}' install-kmh8w |
| 60 | +``` |
| 61 | +Create DSC Initialization: |
| 62 | +```sh |
| 63 | +oc apply -f setup.RHOAI-v2.14/mlbatch-dsci.yaml |
| 64 | +``` |
| 65 | +Create Data Science Cluster: |
| 66 | +```sh |
| 67 | +oc apply -f setup.RHOAI-v2.14/mlbatch-dsc.yaml |
| 68 | +``` |
| 69 | +The provided DSCI and DSC are intended to install a minimal set of Red Hat OpenShift |
| 70 | +AI managed components: `codeflare`, `kueue`, `ray`, and `trainingoperator`. The |
| 71 | +remaining components such as `dashboard` can be optionally enabled. |
| 72 | + |
| 73 | +The configuration of the managed components differs from the default Red Hat OpenShift |
| 74 | +AI configuration as follows: |
| 75 | +- Kubeflow Training Operator: |
| 76 | + - `gang-scheduler-name` is set to `scheduler-plugins-scheduler`, |
| 77 | +- Kueue: |
| 78 | + - `manageJobsWithoutQueueName` is enabled, |
| 79 | + - `batch/job` integration is disabled, |
| 80 | + - `waitForPodsReady` is disabled, |
| 81 | + - `LendingLimit` feature gate is enabled, |
| 82 | + - `enableClusterQueueResources` metrics is enabled, |
| 83 | +- Codeflare operator: |
| 84 | + - the AppWrapper controller is enabled and configured as follows: |
| 85 | + - `userRBACAdmissionCheck` is disabled, |
| 86 | + - `schedulerName` is set to `scheduler-plugins-scheduler`, |
| 87 | + - `queueName` is set to `default-queue`, |
| 88 | +- pod priorities, resource requests and limits have been adjusted. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +## Kueue Configuration |
| 93 | + |
| 94 | +Create Kueue's default flavor: |
| 95 | +```sh |
| 96 | +oc apply -f setup.RHOAI-v2.14/default-flavor.yaml |
| 97 | +``` |
| 98 | + |
| 99 | +## Cluster Role |
| 100 | + |
| 101 | +Create `mlbatch-edit` role: |
| 102 | +```sh |
| 103 | +oc apply -f setup.RHOAI-v2.14/mlbatch-edit-role.yaml |
| 104 | +``` |
| 105 | + |
| 106 | +## Slack Cluster Queue |
| 107 | + |
| 108 | +Create the designated slack `ClusterQueue` which will be used to automate |
| 109 | +minor adjustments to cluster capacity caused by node failures and |
| 110 | +scheduler maintanence. |
| 111 | +```sh |
| 112 | +oc apply -f- << EOF |
| 113 | +apiVersion: kueue.x-k8s.io/v1beta1 |
| 114 | +kind: ClusterQueue |
| 115 | +metadata: |
| 116 | + name: slack-cluster-queue |
| 117 | +spec: |
| 118 | + namespaceSelector: {} |
| 119 | + cohort: default-cohort |
| 120 | + preemption: |
| 121 | + withinClusterQueue: LowerOrNewerEqualPriority |
| 122 | + reclaimWithinCohort: Any |
| 123 | + borrowWithinCohort: |
| 124 | + policy: Never |
| 125 | + resourceGroups: |
| 126 | + - coveredResources: ["cpu", "memory", "nvidia.com/gpu", "nvidia.com/roce_gdr", "pods"] |
| 127 | + flavors: |
| 128 | + - name: default-flavor |
| 129 | + resources: |
| 130 | + - name: "cpu" |
| 131 | + nominalQuota: 8000m |
| 132 | + - name: "memory" |
| 133 | + nominalQuota: 128Gi |
| 134 | + - name: "nvidia.com/gpu" |
| 135 | + nominalQuota: 8 |
| 136 | + - name: "nvidia.com/roce_gdr" |
| 137 | + nominalQuota: 1 |
| 138 | + - name: "pods" |
| 139 | + nominalQuota: 100 |
| 140 | +EOF |
| 141 | +``` |
| 142 | +Edit the above quantities to adjust the quota to the desired |
| 143 | +values. Pod counts are optional and can be omitted from the list of |
| 144 | +covered resources. The `lendingLimit` for each resource will be |
| 145 | +dynamically adjusted by the MLBatch system to reflect reduced cluster |
| 146 | +capacity. See [QUOTA_MAINTENANCE.md](../QUOTA_MAINTENANCE.md) for a |
| 147 | +detailed discussion of the role of the slack `ClusterQueue`. |
0 commit comments