droboticflow/docs/lightweight-operator-pvc-mounts.md

2.1 KiB

Lightweight operator PVC mounts

Lightweight operators keep their executable code in the required codeSubPath mount and may declare additional PVC mounts in runtimeContract.lightweightOperator.mounts.

{
  "runtimeContract": {
    "lightweightOperator": {
      "enabled": true,
      "codeSubPath": "lightweight-operators/example",
      "mountPath": "/opt/droboticflow/lightweight/operator",
      "mounts": [
        {
          "name": "dataset",
          "pvcName": "dataset-pvc",
          "subPath": "robotwin",
          "mountPath": "/data/robotwin",
          "readOnly": true,
          "ideEnabled": true
        },
        {
          "name": "outputs",
          "pvcName": "droboticflow-workspace",
          "subPath": "outputs/example",
          "mountPath": "/outputs",
          "readOnly": false,
          "ideEnabled": true
        }
      ]
    }
  }
}

Every mount requires a unique name, pvcName, and absolute mountPath. subPath may be empty to mount the PVC root. Mount paths must not overlap the code mount, another configured mount, or platform run output paths. Invalid configurations fail before a Kubernetes Job is created; the platform does not infer or replace missing values.

Kubernetes volumes are deduplicated by PVC name, so one PVC can expose multiple independent subdirectories. readOnly is passed directly to the container volume mount. Code remains read-only at runtime, while platform run output paths retain their dedicated writable mount.

The operator file IDE always manages the code directory and also lists mounts with ideEnabled=true. A mount is editable only when readOnly=false. The API process can directly manage only PVCs mounted into its file-management service; selecting another PVC returns an explicit validation error instead of reading a different directory or falling back to the workspace PVC.

File API calls select a configured mount with the optional mount query parameter:

GET /api/operators/:id/lightweight-files?mount=dataset
GET /api/operators/:id/lightweight-files/content?path=state.json&mount=dataset
PUT /api/operators/:id/lightweight-files/content?mount=outputs