|
| 1 | +# Resources add-on for fluence. Turns on fluence-managed resources by supplying |
| 2 | +# (1) the resources config and (2) the device plugin that advertises them. |
| 3 | +# Quantum backends are just the example payload here; any resource type fluence |
| 4 | +# can model goes in the same ConfigMap. Apply AFTER deploy/fluence.yaml: |
| 5 | +# |
| 6 | +# kubectl apply -f deploy/fluence.yaml # base scheduler (no devices) |
| 7 | +# kubectl apply -f deploy/fluence-resources.yaml # + resources config + device plugin |
| 8 | +# kubectl rollout restart deployment/fluence -n kube-system # scheduler re-reads resources |
| 9 | +# |
| 10 | +# The base scheduler already mounts the `fluence-resources` ConfigMap optionally |
| 11 | +# and reads FLUENCE_RESOURCES, so this add-on is purely additive — no edits to |
| 12 | +# the base Deployment. |
| 13 | + |
| 14 | +# Resources config: the SINGLE source of truth for the resource types fluence |
| 15 | +# injects/advertises. The scheduler builds qpu/qubit graph vertices from it; the |
| 16 | +# device plugin derives which extended resources to advertise from the SAME |
| 17 | +# document (same rule), so the two cannot drift. |
| 18 | +apiVersion: v1 |
| 19 | +kind: ConfigMap |
| 20 | +metadata: |
| 21 | + name: fluence-resources |
| 22 | + namespace: kube-system |
| 23 | +data: |
| 24 | + resources.yaml: | |
| 25 | + backends: |
| 26 | + - name: ibm_fez |
| 27 | + num_qubits: 156 |
| 28 | + vendor: ibm |
| 29 | + qrmi_type: qiskit-runtime-service |
| 30 | + - name: ibm_marrakesh |
| 31 | + num_qubits: 156 |
| 32 | + vendor: ibm |
| 33 | + qrmi_type: qiskit-runtime-service |
| 34 | +--- |
| 35 | +# Device plugin: advertises the exotic Fluxion resource types (derived from the |
| 36 | +# resources config above) on every node, so pods can request them via resources |
| 37 | +# and NodeResourcesFit is satisfied. |
| 38 | +apiVersion: apps/v1 |
| 39 | +kind: DaemonSet |
| 40 | +metadata: |
| 41 | + name: fluence-deviceplugin |
| 42 | + namespace: kube-system |
| 43 | + labels: {app: fluence-deviceplugin} |
| 44 | +spec: |
| 45 | + selector: |
| 46 | + matchLabels: {app: fluence-deviceplugin} |
| 47 | + template: |
| 48 | + metadata: |
| 49 | + labels: {app: fluence-deviceplugin} |
| 50 | + spec: |
| 51 | + priorityClassName: system-node-critical |
| 52 | + tolerations: |
| 53 | + - operator: Exists # run on every node, including tainted/control-plane |
| 54 | + containers: |
| 55 | + - name: deviceplugin |
| 56 | + image: ghcr.io/converged-computing/fluence:test |
| 57 | + command: ["/bin/fluence-deviceplugin"] |
| 58 | + env: |
| 59 | + - name: FLUENCE_RESOURCES |
| 60 | + value: /etc/fluence/resources.yaml |
| 61 | + - name: FLUENCE_RESOURCE_CAPACITY |
| 62 | + value: "1000" |
| 63 | + securityContext: |
| 64 | + privileged: true |
| 65 | + volumeMounts: |
| 66 | + - name: device-plugin |
| 67 | + mountPath: /var/lib/kubelet/device-plugins |
| 68 | + - name: resources |
| 69 | + mountPath: /etc/fluence |
| 70 | + volumes: |
| 71 | + - name: device-plugin |
| 72 | + hostPath: |
| 73 | + path: /var/lib/kubelet/device-plugins |
| 74 | + - name: resources |
| 75 | + configMap: |
| 76 | + name: fluence-resources |
0 commit comments