feat(templates): declarative K8S compute configs for 3 pilot templates - #940
Open
Aydin-ab wants to merge 3 commits into
Open
feat(templates): declarative K8S compute configs for 3 pilot templates#940Aydin-ab wants to merge 3 commits into
Aydin-ab wants to merge 3 commits into
Conversation
The AWS/GCP compute keys name VM instance types, which K8s-stack clouds (AKS/EKS/GKE) cannot honor — the backend currently flattens them to a head-only CPU pod at launch. A declarative k8s.yaml (required_resources) instead resolves server-side into free pods, needing no registered instance types, and one config covers every K8s stack — hence a single K8S key rather than per-provider ones. Pilots span the shape space: single node + auto-select (workspace-intro), multi-node CPU (getting-started), multi-node GPU (pytorch-fsdp, 2x T4 — chosen because Azure GPU pools have no L4/A10G). The validator keeps k8s.yaml declarative (instance_type is an error) so the file class cannot drift back into per-cluster registration dependencies. Claude-Session: https://claude.ai/code/session_013BsS5dSk6s6xsLx2FbBy7g Signed-off-by: Aydin Abiar <aydin@anyscale.com>
A non-dict node (e.g. a bare string in worker_nodes) crashed the hook
with a traceback before collected errors printed — pydantic already
reports those, so skip them here. And required_resources: {} slipped
past the is-None guard while the SDK rejects it at deploy time; treat
empty as missing.
Claude-Session: https://claude.ai/code/session_013BsS5dSk6s6xsLx2FbBy7g
Signed-off-by: Aydin Abiar <aydin@anyscale.com>
Two authoring errors vs the declarative contract (docs.anyscale.com/configuration/compute/declarative + product compute_templates.py check_gpu_accelerator_consistency): auto_select_worker_config is not compatible with declarative configs, and the GPU type must ride in required_labels (ray.io/accelerator-type) — the launch-time GPU validation never reads required_resources.accelerator, so the previous form would have been rejected at launch. basic-single-node becomes an explicit single cpu_worker group, heads slim to coordinator sizing (4CPU/8Gi, they are CPU: 0), the FSDP GPU workers keep the AWS-proven g4dn.xlarge shape (4CPU/16Gi/1xT4). The hook now enforces all three rules so the next k8s.yaml can't repeat this. Claude-Session: https://claude.ai/code/session_013BsS5dSk6s6xsLx2FbBy7g Signed-off-by: Aydin Abiar <aydin@anyscale.com>
elliot-barn
reviewed
Aug 14, 2026
| @@ -0,0 +1,12 @@ | |||
| head_node: | |||
Contributor
There was a problem hiding this comment.
can we rename them to azure.yaml to match the convention of the other templates?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
K8S:compute-config key pointing at a declarativek8s.yaml—required_resourcesshapes resolved server-side into free pods, no registered instance types, one config covering AKS/EKS/GKE. Three pilots span the shape space:workspace-intro(single node),getting-started(multi-node CPU),pytorch-fsdp(multi-node GPU, 2×T4 viarequired_labels: {ray.io/accelerator-type: T4}— Azure GPU pools have no L4/A10G). The validator accepts the new key and enforces the declarative contract: noinstance_type, noauto_select_worker_config(incompatible with declarative configs), and GPU counts paired with the accelerator-type label (launch validation reads the label, not arequired_resources.acceleratorkey).Groundwork for the Azure/K8s template path:
rayapp buildalready carries the key into bundles as-is; the product launch path selecting + honoring it lands separately (today it force-selects AWS and flattens on K8s clouds), so the key is inert in prod until then.Testing
pre-commit run --all-filesgreen (BUILD.yaml validator gate included).rayapp build: all 56 bundles build; the three pilots'ray-app.jsoncarry theK8Sconfig withrequired_resources+required_labelspreserved verbatim.anyscale.compute_config.models.ComputeConfig(instance_type→custom).check_gpu_accelerator_consistency(GPU count must pair with theray.io/accelerator-typelabel; auto-select unsupported with declarative).instance_type,auto_select_worker_config, GPU without label,acceleratorinsiderequired_resources, emptyrequired_resources, non-dict nodes, cross-dir K8S path, wrong filename — each fails with a targeted error.https://claude.ai/code/session_013BsS5dSk6s6xsLx2FbBy7g