Skip to content

feat: make Cluster Director export opt-out by default and upgrade to v1beta - #6807

Open
SwarnaBharathiMantena wants to merge 5 commits into
GoogleCloudPlatform:developfrom
SwarnaBharathiMantena:feat/cd-export-opt-out
Open

SwarnaBharathiMantena wants to merge 5 commits into
GoogleCloudPlatform:developfrom
SwarnaBharathiMantena:feat/cd-export-opt-out

Conversation

@SwarnaBharathiMantena

Copy link
Copy Markdown
Contributor

Summary

Switches Cluster Director export (export_to_cluster_director, introduced as opt-in in #6748) to opt-out by default, upgrades the Cluster Director API client from v1alpha to v1beta, and updates docs/cluster-director.md to close preview documentation gaps.

Key changes

  1. Opt-out default (true when unset) with two-tier error handling:

    • pkg/config/config.go: Blueprint.ExportToClusterDirectorEnabled() now returns true when export_to_cluster_director is unset (nil). Blueprint.ExportToClusterDirector remains nil in expanded blueprints so existing golden copies and generated artifacts stay unchanged.
    • pkg/clusterdirector/lifecycle.go: effectiveExportDecision() distinguishes explicit configuration (export_to_cluster_director: true|false in a blueprint/-d file or --export-to-cluster-director=true|false) from the implicit opt-out default:
      • Implicit default (unset): If exporting fails (for example, hypercomputecluster.googleapis.com is not enabled or IAM permissions are missing), gcluster deploy logs a warning with enable/IAM/opt-out instructions and succeeds (exit 0), avoiding breakage for existing users and CI pipelines.
      • Explicit true: Export failures continue to fail gcluster deploy (exit 1, without rolling back infrastructure).
      • Explicit false: Skips exporting, or deletes a previously exported Cluster Director record (failing if deletion fails).
      • PreviousExportSetting() only carries forward explicit settings persisted in expanded_blueprint.yaml (so a marker created under the implicit default is not promoted into an explicit true across -w).
    • cmd/clusterdirector_lifecycle.go: Registers --export-to-cluster-director with default true and updated help text.
    • pkg/telemetry/collector_util.go: Reflects the new true default in isExportToClusterDirector.
  2. Cluster Director v1beta API & gcloud beta hints:

    • pkg/clusterdirector/client.go: Switches DefaultAPIVersion from v1alpha to v1beta (matching the public preview Cluster Director API and gcloud beta cluster-director CLI) and updates the 403 AccessHint message to point directly to roles/hypercomputecluster.admin / roles/hypercomputecluster.editor.
    • pkg/clusterdirector/lifecycle.go: Updates manual cleanup commands in warnings and errors from gcloud alpha cluster-director clusters delete to gcloud beta cluster-director clusters delete.
  3. Documentation updates (docs/cluster-director.md, cmd/README.md, examples/README.md):

    • Documents the opt-out default, two-tier failure behavior (warn on implicit default vs. hard-fail on explicit true), and v1beta / gcloud beta commands.
    • Clarifies silent skip conditions (non-literal project_id/region/deployment_name, any GKE module including hybrid blueprints, empty groups), silent deletion of a previous export if a deployment becomes non-exportable, and how to confirm export succeeded.
    • Clarifies that gcluster deploy <DEPLOYMENT_DIR> --export-to-cluster-director=true|false runs Terraform across every group before updating Cluster Director.
    • Clarifies storage scope (Terraform-managed resources only; pre-existing storage data sources are not registered; buckets from built-in modules outside file-system/ and files/ are skipped), regional subnetworks, Shared VPC fallback persistence (skip_cross_project_networks: true), ownership check scope, local artifact fields, and expanded troubleshooting rows.

Verification

  • Verified google.cloud.hypercomputecluster.v1beta schema parity across all used RPCs and resource types (CreateCluster, GetCluster, UpdateCluster, DeleteCluster, ListNodes, Cluster, ExistingNetworkConfig, ExistingBucketConfig, ExistingFilestoreConfig, ExistingLustreConfig, ComputeEngineOrchestrator.existing_instances, update_mask) and confirmed GET /v1beta/.../clusters returns HTTP 200 on production hypercomputecluster.googleapis.com.
  • go test -count=1 -race ./pkg/clusterdirector/... ./pkg/config/... ./pkg/telemetry/... ./cmd/...: all packages passed (including new tests for implicit-default warning vs. explicit hard-fail and marker-only PreviousExportSetting).
  • make validate_golden_copy: passed unchanged.
  • pre-commit run on all changed files (addlicense, catalog-gen, validate-readme-snippets, go-unit-tests, go-imports, go-cyclo, go-fmt, go-vet, go-mod-tidy, golangci-lint, PyMarkdown, end-of-file-fixer, codespell): all passed.

Follow-up before marking ready for review

  • Run a live end-to-end deploy/update/opt-out/destroy pass against hypercomputecluster.googleapis.com/v1beta.

Cloud-Docs: tracked internally

…beta API

Switch export_to_cluster_director to default to true (opt-out) while keeping
unset blueprints nil in expanded_blueprint.yaml so golden copies stay unchanged.
Distinguish explicit configuration from the implicit default: failures under the
implicit default log a warning and return nil so deployments without Cluster
Director API or IAM setup continue succeeding, whereas explicit
export_to_cluster_director: true (or --export-to-cluster-director=true) keeps
hard-failing gcluster deploy.

Upgrade the Cluster Director client from v1alpha to v1beta and switch manual
cleanup hints from gcloud alpha to gcloud beta.
…view caveats

Update docs/cluster-director.md, cmd/README.md, and examples/README.md for the
opt-out default, warning vs. hard-fail semantics, v1beta / gcloud beta usage,
literal variable requirements, silent skip and deletion behavior, Terraform apply
behavior on toggle, storage/network/Shared VPC scope, ownership check scope, and
expanded troubleshooting entries.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the Cluster Director integration to be enabled by default, improving discoverability while maintaining stability for existing CI/CD pipelines through a new two-tier error handling mechanism. It also migrates the underlying API client to v1beta and provides comprehensive documentation updates to clarify the new default behavior and troubleshooting steps.

Highlights

  • Cluster Director Export Default: Changed the default behavior for Cluster Director export from opt-in to opt-out (enabled by default). Implicitly enabled exports now log a warning on failure instead of causing a hard deployment failure.
  • API Upgrade: Upgraded the Cluster Director API client from v1alpha to v1beta to align with the public preview release.
  • Two-Tier Error Handling: Implemented distinct error handling: implicit defaults provide a non-breaking warning on failure, while explicit opt-in configurations continue to enforce hard failures.
  • Documentation and CLI Updates: Updated documentation and CLI help text to reflect the new default behavior, v1beta API usage, and updated gcloud command syntax.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 transitions the Cluster Director export feature from an opt-in preview using the v1alpha API to an opt-out default behavior using the v1beta API. Exporting is now enabled by default for Compute Engine and Slurm deployments, with failures logging a warning rather than failing the deployment unless explicitly required. The documentation, CLI flags, tests, and error messages have been updated to reflect this change, including updating manual command hints to use gcloud beta. No review comments were provided, so I have no feedback to address.

@SwarnaBharathiMantena SwarnaBharathiMantena self-assigned this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-key-new-features Added to release notes under the "Key New Features" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants