8000 feat(examples): add gke cluster provisioning to xmc lite example by pachopepe · Pull Request #1049 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content
8000

feat(examples): add gke cluster provisioning to xmc lite example - #1049

Draft
pachopepe wants to merge 6 commits into
feat/xmc-lite-jobset-modefrom
feat/xmc-lite-provision-cluster
Draft

pachopepe wants to merge 6 commits into
feat/xmc-lite-jobset-modefrom
feat/xmc-lite-provision-cluster

Conversation

@pachopepe
@pachopepe pachopepe commented Oct 1, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Adds ./setup.sh --provision-cluster to examples/xmc_lite_job/: a Cluster Toolkit blueprint creates a lightweight GKE cluster with cert-manager, JobSet and Kueue, and ready-to-use Kueue queues are applied. PR 3 of 3 in the stack replacing #998.

Motivation & Context

Extends the b/555533775 example for users without a cluster, providing the JobSet and Kueue setup needed by follow-up b/569821527. It also fixes gaps found when checking #998 against the story: missing provisioning IAM roles, no Kueue queues (so --local_queue had nothing to target), no instructions for getting gcluster, and no cluster teardown.

Key Changes

  • xmc-lite-gke.yaml: blueprint (VPC, GKE, 2x n2-standard-4 node pool, cert-manager, Kueue 0.18.2, JobSet 0.12.0). Same as in feat(examples): add xmc lite kubernetes job and jobset example #998.
  • kueue-queues.yaml (new): default-flavor ResourceFlavor, cluster-queue ClusterQueue (6 CPU / 24Gi), default-queue LocalQueue (kueue.x-k8s.io/v1beta2, matching deploy/helm/templates/kueue-dev).
  • setup.sh: --provision-cluster deploys the blueprint groups, creates ${K8S_NAMESPACE} if needed and applies the queues.
  • README.md: provisioning IAM roles, now including roles/iam.serviceAccountAdmin and roles/resourcemanager.projectIamAdmin (the blueprint creates wl-sa/np-sa and grants them project roles); gcluster build steps; gcluster destroy teardown.

Assumptions

  • ClusterQueue quota of 6 CPU / 24Gi is sized to the 2x n2-standard-4 pool, leaving headroom for system pods. If it's too low, workloads stay queued.
  • The provisioning role list is derived from the blueprint's resources; it has not been checked against a least-privilege account.

Verification & Testing

  • Commands Executed: bash -n setup.sh; ./.githooks/pre-commit (pass).
  • Coverage & Test Status: infrastructure only, no unit tests. The blueprint is unchanged from feat(examples): add xmc lite kubernetes job and jobset example #998. The new provisioning path (kueue-queues.yaml apply, namespace creation) has not been run against a fresh cluster yet.

Related Issues / Bugs

Bug: 569821527

TAG=agy
CONV=328157cc-0621-4429-b4c2-19760fa03506

Adds a `--provision-cluster` path to `examples/xmc_lite_job/setup.sh`
that creates a lightweight GKE cluster from scratch, so the example
can run without a pre-existing cluster.

- `xmc-lite-gke.yaml` is a Cluster Toolkit blueprint with a VPC, a GKE
  cluster, a 2x n2-standard-4 node pool, cert-manager, JobSet and Kueue.
- `kueue-queues.yaml` adds a `default-flavor` ResourceFlavor, a
  `cluster-queue` ClusterQueue (6 CPU / 24Gi) and a `default-queue`
  LocalQueue, so `--local_queue=default-queue` works out of the box.
- `setup.sh --provision-cluster` deploys the blueprint groups, creates
  the workload namespace if needed and applies the Kueue queues.
- `README.md` lists the provisioning IAM roles (including
  `roles/iam.serviceAccountAdmin` and
  `roles/resourcemanager.projectIamAdmin`, needed to create the
  blueprint's service accounts and grant them project roles), how to
  build `gcluster`, and `gcluster destroy` teardown.

Bug: 555533775

TAG=agy
CONV=328157cc-0621-4429-b4c2-19760fa03506
@pachopepe
pachopepe added this pull request to stack #1050 October 1, 2026 11:55
@gemini-code-assist 8000 gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds automatic GKE cluster provisioning capabilities to the xmc_lite_job example using Cluster Toolkit (gcluster), including updating the setup script, adding a Cluster Toolkit blueprint, and defining Kueue resources. Feedback on these changes suggests adding a check in setup.sh to verify the existence of the gcluster binary before execution, and waiting for the Kueue controller manager deployment to be fully ready before applying Kueue queues to avoid webhook connection errors.

Comment thread examples/xmc_lite_job/setup.sh Resolved
Comment thread examples/xmc_lite_job/setup.sh Resolved
…-cluster

# Conflicts:
#	examples/xmc_lite_job/README.md
- Wait for `deployment/kueue-controller-manager` to roll out before
  applying `kueue-queues.yaml`, so the queues are not rejected by Kueue
  webhooks that are not ready yet on a freshly provisioned cluster.
- Fail early with build instructions when the `gcluster` binary is
  missing or not executable.

Comment link: #1049 (comment)
Comment link: #1049 (comment)

Bug: 555533775

TAG=agy
CONV=328157cc-0621-4429-b4c2-19760fa03506
…-cluster

# Conflicts:
#	examples/xmc_lite_job/README.md

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0