Repository navigation
feat: make Cluster Director export opt-out by default and upgrade to v1beta - #6807
SwarnaBharathiMantena wants to merge 5 commits into
Conversation
…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.
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
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 fromv1alphatov1beta, and updatesdocs/cluster-director.mdto close preview documentation gaps.Key changes
Opt-out default (
truewhen unset) with two-tier error handling:pkg/config/config.go:Blueprint.ExportToClusterDirectorEnabled()now returnstruewhenexport_to_cluster_directoris unset (nil).Blueprint.ExportToClusterDirectorremainsnilin expanded blueprints so existing golden copies and generated artifacts stay unchanged.pkg/clusterdirector/lifecycle.go:effectiveExportDecision()distinguishes explicit configuration (export_to_cluster_director: true|falsein a blueprint/-dfile or--export-to-cluster-director=true|false) from the implicit opt-out default:hypercomputecluster.googleapis.comis not enabled or IAM permissions are missing),gcluster deploylogs a warning with enable/IAM/opt-out instructions and succeeds (exit0), avoiding breakage for existing users and CI pipelines.true: Export failures continue to failgcluster deploy(exit1, without rolling back infrastructure).false: Skips exporting, or deletes a previously exported Cluster Director record (failing if deletion fails).PreviousExportSetting()only carries forward explicit settings persisted inexpanded_blueprint.yaml(so a marker created under the implicit default is not promoted into an explicittrueacross-w).cmd/clusterdirector_lifecycle.go: Registers--export-to-cluster-directorwith defaulttrueand updated help text.pkg/telemetry/collector_util.go: Reflects the newtruedefault inisExportToClusterDirector.Cluster Director
v1betaAPI &gcloud betahints:pkg/clusterdirector/client.go: SwitchesDefaultAPIVersionfromv1alphatov1beta(matching the public preview Cluster Director API andgcloud beta cluster-directorCLI) and updates the 403AccessHintmessage to point directly toroles/hypercomputecluster.admin/roles/hypercomputecluster.editor.pkg/clusterdirector/lifecycle.go: Updates manual cleanup commands in warnings and errors fromgcloud alpha cluster-director clusters deletetogcloud beta cluster-director clusters delete.Documentation updates (
docs/cluster-director.md,cmd/README.md,examples/README.md):true), andv1beta/gcloud betacommands.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.gcluster deploy <DEPLOYMENT_DIR> --export-to-cluster-director=true|falseruns Terraform across every group before updating Cluster Director.file-system/andfiles/are skipped), regional subnetworks, Shared VPC fallback persistence (skip_cross_project_networks: true), ownership check scope, local artifact fields, and expanded troubleshooting rows.Verification
google.cloud.hypercomputecluster.v1betaschema parity across all used RPCs and resource types (CreateCluster,GetCluster,UpdateCluster,DeleteCluster,ListNodes,Cluster,ExistingNetworkConfig,ExistingBucketConfig,ExistingFilestoreConfig,ExistingLustreConfig,ComputeEngineOrchestrator.existing_instances,update_mask) and confirmedGET /v1beta/.../clustersreturns HTTP200on productionhypercomputecluster.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-onlyPreviousExportSetting).make validate_golden_copy: passed unchanged.pre-commit runon 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
hypercomputecluster.googleapis.com/v1beta.Cloud-Docs: tracked internally