Repository navigation
Use managed KubeRay by default in Kueue and Ray examples - #6046
Li Chen (AaronLiChen) wants to merge 4 commits into
Conversation
Real AKS CPU functional validation — all four workflows PASSExecuted on a newly created real ARM AKS1.35.9 target, using public managed Kueue The published examples remain GPU-based. CPU copies/overlays were temporary and outside Git, as requested by the author. Actual pretrained Aurora and Qwen2.5-7B models were retained—not downsized substitutes.
What this does—and doesn't—validate
The tests caught real bugs rather than stopping at admission/dry-run: Ray2.55/protobuf7 prevented Serve deployment; then rank-local RNG state was being returned/uploaded instead of rank zero's actual adapter. The complete corrected training→Blob→inference chain passed after those fixes. All25 offline tests and all six PR checks pass at Kueue #6040 was also rerun on real AKSRecorded independently on #6040: exact immutable Only run-owned model jobs/queues/flavors/namespace were cleaned up. Managed-default UIDs and the shared ProvisioningRequest API were preserved before full teardown. The completed CPU environment's VMs, disks, and node resource group are verified deleted. Its parent AKS resource group remains |
There was a problem hiding this comment.
🔵 Needs a closer look
Subscription-scoping fixes remain, and the preview-operator integration needs human review because full GPU execution remains unvalidated.
1 open issue
What changed in this PR
Makes managed KubeRay and Kueue the recommended path for the AKS examples while preserving the separate self-managed Terraform lab. Builds on #6040 and prepares the examples for the companion Learn documentation.
Changes:
- Adds a managed-extension installer with ownership checks, readiness verification, and storage, identity, and dataset guidance.
- Updates GPU runtime defaults and submitter compatibility; validates LoRA artifacts before retrieval and upload.
- Adds offline regression tests and GitHub Actions coverage.
Paths below are relative to examples/kueue-and-ray-on-aks/, except the GitHub Actions workflow.
| File | Description |
|---|---|
README.md |
Presents the managed-first workflow and installation alternatives. |
3-workloads/tests/test_managed_ray.py |
Tests runtime pins, submitter wrappers, and dry runs. |
3-workloads/tests/test_lora_checkpoints.py |
Tests complete-adapter selection and upload rejection. |
3-workloads/README.md |
Documents managed prerequisites and runtime compatibility. |
3-workloads/online-serving/README.md |
Uses managed storage and operator prerequisites. |
3-workloads/online-serving/env.example |
Updates runtime defaults and storage guidance. |
3-workloads/llm-training/submit.sh |
Corrects dry-run exit status and storage guidance. |
3-workloads/llm-training/README.md |
Documents managed setup and adapter validation. |
3-workloads/llm-training/manifests/rayjob.yaml.tmpl |
Adds the submitter’s Python compatibility wrapper. |
3-workloads/llm-training/llm_training.py |
Rejects incomplete rank-local adapter checkpoints. |
3-workloads/llm-training/env.example |
Updates runtime defaults and storage guidance. |
3-workloads/cas-batch-job/README.md |
Uses managed provisioning defaults and scoped demo cleanup. |
3-workloads/batch-inference/submit.sh |
Corrects dry-run exit status and storage guidance. |
3-workloads/batch-inference/README.md |
Switches prerequisites to managed setup. |
3-workloads/batch-inference/manifests/rayjob.yaml.tmpl |
Adds the submitter’s Python compatibility wrapper. |
3-workloads/batch-inference/env.example |
Updates runtime defaults and storage guidance. |
3-workloads/aurora-finetune/submit.sh |
Corrects dry-run exit status and storage guidance. |
3-workloads/aurora-finetune/README.md |
Links managed infrastructure and dataset preparation. |
3-workloads/aurora-finetune/manifests/rayjob.yaml.tmpl |
Adds the submitter’s Python compatibility wrapper. |
3-workloads/aurora-finetune/env.example |
Updates runtime defaults and input-file guidance. |
3-workloads/_template/rayservice.yaml.tmpl |
Updates runtime and storage comments only. |
3-workloads/_template/rayjob.yaml.tmpl |
Adds the reusable wrapper and updates comments. |
2-kueue-queues/tests/test_managed_kueue.py |
Tests managed references, ownership, and queue routing. |
2-kueue-queues/tests/requirements.txt |
Pins the YAML test dependency. |
2-kueue-queues/README.md |
Documents managed installation and queue selection. |
2-kueue-queues/manifests/README.md |
Clarifies manifest ownership and prerequisites. |
2-kueue-queues/manifests/40-autoscale-queue.yaml |
References managed defaults instead of creating them. |
2-kueue-queues/manifests/10-resource-flavors.yaml |
Clarifies customer ownership in comments only. |
1-infrastructure/terraform/variables.tf |
Aligns the Ray image output default. |
1-infrastructure/terraform/README.md |
Labels Terraform as the self-managed alternative. |
1-infrastructure/terraform/legacy-guide.md |
Preserves the full Terraform walkthrough. |
1-infrastructure/README.md |
Directs readers to managed setup. |
1-infrastructure/managed/tests/test_preflight.py |
Tests ownership and API safety checks. |
1-infrastructure/managed/tests/test_installer.py |
Tests installer branches with fake command-line tools. |
1-infrastructure/managed/README.md |
Documents installation, storage, identity, and cleanup. |
1-infrastructure/managed/preflight.py |
Adds read-only ownership and API validation. |
1-infrastructure/managed/install-extensions.sh |
Installs or reuses managed extensions with readiness checks. |
1-infrastructure/managed/data.md |
Documents authenticated dataset preparation and uploads. |
1-infrastructure/managed/.gitignore |
Excludes local state and Python cache files. |
.github/workflows/kueue-ray-examples.yml |
Runs shell syntax and offline contract checks. |
Review effort: Balanced
| kubectl get resourceflavor scalepool # NotFound | ||
| kubectl get namespace cas-kueue-demo # NotFound | ||
| az aks nodepool delete \ | ||
| --resource-group "$RESOURCE_GROUP" --cluster-name "$CLUSTER_NAME" \ |

Summary
Make managed KubeRay and Kueue the recommended executable path for
examples/kueue-and-ray-on-aks, aligned with docs PR4044, while preserving the separate self-managed Terraform alternative.The checked-in examples remain GPU-based. Per the author's request, all four Ray applications were functionally executed on CPU on a real AKS cluster, using temporary test-only adaptations outside Git. The actual Aurora/Qwen2.5-7B models, training/adapter/storage flows, RayService endpoint, and Ray Data/vLLM consumer were exercised. These bounded runs are not full-dataset training, model-quality, GPU-kernel, NCCL, or GPU-performance acceptance.
Merge/publication order
473df1acfefa883d21cfb43bdf3f5977ab23df83; those changes currently appear in the aggregate diff. docs(examples): use managed Kueue for queue and autoscaler demos #6040's branch/manifests remain unchanged.Changes
previewdiscovery, compatible auto-upgrade, Azure/controller/API readiness, explicit subscription, private kubeconfig.--with-cpu-autoscalingchecks the CAS-owned established/served ProvisioningRequestv1API before Kueue startup; never creates/replaces the shared CRD.Bugs found by real execution
41201b00— Ray Serve/protobuf compatibility: the published Ray2.55.1 image has protobuf7.36.2 but Serve calls removedFieldDescriptor.label, failing deployment before model loading. Consistently pin publishedpy3.12-ray2.56.1-cuda13.0, with the upstream compatibility helper and matchingRAY_VERSION. The actual new-image protobuf conversion and full CPU RayService GET/POST passed. An application runtime-env pin alone wouldn't fix the base-image controller.a9160984— complete LoRA artifact selection: a real four-rank training step succeeded, but the old retrieval returned a nonzero rank's RNG-only checkpoint instead of rank zero's80MB model. Now skip incomplete ranks, accept nested/direct adapter layouts, and require nonempty adapter configuration + weights before retrieval/upload. The full real training/upload/inference flow passed after the fix. Five new unit regressions cover RNG-only-first ordering and fail-closed upload behavior.GPU resource requests, CUDA guards, actual model choices, and default worker counts are retained. The only application logic change is device-independent adapter validation/retrieval; no CPU resource/device/library profile is committed.
Real AKS validation — 2026-10-24
Dedicated normal ARM AKS1.35.9, Central US EUAP, with the actual public-preview managed extensions. No mock cluster, self-hosted replacement, shared-cluster mutation, or dry-run-only claim.
Exact #6040 — independently passed twice
Fresh real-AKS rerun result at immutable
473df1ac:ProvisioningRequest Provisioned=True, best-effort-atomic class, thenWorkload Admitted=True.Managed installation/reuse, controller/API checks, account-scoped identity/federation, real WeatherBench2/ViGGO uploads, and remote-worker identity Blob read/write also passed.
All four CPU functional workflows — PASS
device_config=cpuobserved.CPU test scope (not production defaults)
nobind.The earlier isolated A100 allocation returned Azure Compute
InternalExecutionErrorbefore any GPU node registered. That does not establish a quota or physical-capacity root cause; that environment was deleted. The CPU-only environment's owned demo resources were cleaned up with managed defaults/shared API retained. Its CPU VMs, disks, and node resource group are verified deleted; the parent AKS resource group is stillDeleting, so full group deletion is not claimed yet. Shared GPU/NPD labs/operators were untouched.Checks and remaining limits
a9160984; shell syntax/whitespace checks pass.acceleratorlabel write rejected by real AKS; no node-label validation bypass is used.