Skip to content

add Slurm hybrid cloud burst blueprints and instructions - #6262

Open
juntangc wants to merge 1 commit into
GoogleCloudPlatform:developfrom
juntangc:slurm-hybrid-cloud-burst
Open

add Slurm hybrid cloud burst blueprints and instructions#6262
juntangc wants to merge 1 commit into
GoogleCloudPlatform:developfrom
juntangc:slurm-hybrid-cloud-burst

Conversation

@juntangc

@juntangc juntangc commented Sep 3, 2026

Copy link
Copy Markdown

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

…s for GCP and GCD

Change-Id: Ibf93be1024a99cf8d504f997ef304417589f0da8
Signed-off-by: Jun Tang <juntangc@google.com>
@juntangc
juntangc requested a review from a team as a code owner September 3, 2026 21:02
@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 introduces significant enhancements to the HPC Cluster Toolkit, primarily focusing on hybrid cloud bursting capabilities and improved configuration management. It adds comprehensive blueprints for Slurm hybrid cloud bursting, refines the CLI configuration experience, and introduces automated test infrastructure management. Additionally, it includes updates to support ML Diagnostics and improves the robustness of CI/CD test pipelines.

Highlights

  • Slurm Hybrid Cloud Bursting: Added blueprints and documentation for configuring multi-cluster Slurm environments with elastic cloud bursting, supporting both commercial GCP and Google Cloud Dedicated (GCD) sovereign environments.
  • Configuration Management: Enhanced gcluster job config to support interactive editing of default settings via the system editor and added a show command to display current configurations.
  • Artifact Registry Integration: Implemented dynamic lookup for Docker repositories in Artifact Registry to improve the user experience when configuring GCLUSTER_IMAGE_REPO.
  • ML Diagnostics: Added support for ML Diagnostics via the --enable-ml-diagnostics flag in job submissions.
  • Infrastructure Updates: Updated various example blueprints to use n2d-standard machine types and improved the reliability of test infrastructure through automated Kueue lock management and cleanup scripts.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/sync-assignees.yml
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 introduces interactive configuration editing for 'gcluster job config', adds support for GKE ML Diagnostics, automates GCS Fuse Anywhere Cache IAM role creation, and adds Slurm blueprints for Google Cloud Dedicated (GCD) and hybrid cloud bursting. The review feedback highlights a potential runtime 'NameError' in 'util.py' due to missing imports, an insecure SSH configuration in the GCD Slurm blueprint, unhandled file read errors in the configuration editor, and insecure file permissions ('0644') for the saved configuration file.

Comment on lines +1460 to +1461
if universe_domain() != DEFAULT_UNIVERSE_DOMAIN:
assert retry_cb is None, "retry_cb not supported for non-default universe domains"

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.

high

The newly added batch_execute logic uses ThreadPoolExecutor and as_completed without importing them (or concurrent.futures) at the top of util.py. This will cause a NameError at runtime in custom universe domains. Importing them inline inside the if block is a safe way to resolve this.

Suggested change
if universe_domain() != DEFAULT_UNIVERSE_DOMAIN:
assert retry_cb is None, "retry_cb not supported for non-default universe domains"
# Custom universe domains (GCD / Sovereign Cloud) do not support BatchHttpRequest.
if universe_domain() != DEFAULT_UNIVERSE_DOMAIN:
from concurrent.futures import ThreadPoolExecutor, as_completed
assert retry_cb is None, "retry_cb not supported for non-default universe domains"

# 3. Disable StrictHostKeyChecking safely for internal network jumps only
if ! grep -q "Host 10.\*" /etc/ssh/ssh_config; then
if ! grep -q "StrictHostKeyChecking no" /etc/ssh/ssh_config; then
echo -e "Host 10.* 172.16.* 192.168.* *.internal *\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null" >> /etc/ssh/ssh_config

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.

security-medium medium

Disabling StrictHostKeyChecking globally by appending a trailing * to the Host pattern list poses a significant security risk (man-in-the-middle vulnerability) for any external SSH connections initiated from the cluster. It is safer to restrict this configuration strictly to the internal IP ranges and domains.

              echo -e "Host 10.* 172.16.* 192.168.* *.internal\n    StrictHostKeyChecking no\n    UserKnownHostsFile=/dev/null" >> /etc/ssh/ssh_config

Comment thread cmd/job/config.go
Comment on lines +91 to +98
fileData, err := os.ReadFile(sourcePath)
if err == nil {
if _, err := tempFile.Write(fileData); err != nil {
_ = tempFile.Close()
_ = os.Remove(tempFileName)
return "", fmt.Errorf("failed to write to temp file: %w", err)
}
}

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.

medium

If os.ReadFile fails with an error other than os.ErrNotExist (e.g., permission denied), the error is silently ignored. This results in an empty temp file being created, which will subsequently overwrite the user's existing configuration with empty or invalid data when saved. The error should be handled explicitly.

Suggested change
fileData, err := os.ReadFile(sourcePath)
if err == nil {
if _, err := tempFile.Write(fileData); err != nil {
_ = tempFile.Close()
_ = os.Remove(tempFileName)
return "", fmt.Errorf("failed to write to temp file: %w", err)
}
}
fileData, err := os.ReadFile(sourcePath)
if err != nil && !os.IsNotExist(err) {
_ = tempFile.Close()
_ = os.Remove(tempFileName)
return "", fmt.Errorf("failed to read source config file: %w", err)
}
if err == nil {
if _, err := tempFile.Write(fileData); err != nil {
_ = tempFile.Close()
_ = os.Remove(tempFileName)
return "", fmt.Errorf("failed to write to temp file: %w", err)
}
}

Comment thread cmd/job/config.go
return fmt.Errorf("config file contains structural errors or invalid JSON: %w", err)
}

if err := os.WriteFile(targetFile, tempFileData, 0644); err != nil {

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.

security-medium medium

The configuration file contains project IDs, cluster names, and locations. Saving it with 0644 permissions allows other local users on the system to read this configuration. It is highly recommended to restrict the file permissions to the owner only (0600).

Suggested change
if err := os.WriteFile(targetFile, tempFileData, 0644); err != nil {
if err := os.WriteFile(targetFile, tempFileData, 0600); err != nil {

@agrawalkhushi18
agrawalkhushi18 changed the base branch from main to develop September 4, 2026 03:20
@agrawalkhushi18

Copy link
Copy Markdown
Contributor

Hi @juntangc , Thanks for the contrinbution. Just FYI: Please avoid raising PRs directly to the main branch, I have changed the base branch to develop. Please check if the commit now covers all the changes you have added.
Thanks

@AdarshK15 AdarshK15 self-assigned this Sep 4, 2026
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.

3 participants