Optional Managed Instance Group (MIG) support for static compute nodes - #6127
Optional Managed Instance Group (MIG) support for static compute nodes#6127arpit974 wants to merge 13 commits into
Conversation
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 introduces support for Managed Instance Groups (MIGs) as an alternative to the existing bulk insert provisioning method for compute nodes. By enabling MIGs, the cluster gains improved instance lifecycle management, including automated repair capabilities. The changes span across Terraform infrastructure definitions to provision the necessary MIG resources and Python scripts to handle the logic for resuming and suspending nodes within these managed groups. 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 introduces support for a Managed Instance Group (MIG) provisioning engine alongside the existing BULK_INSERT engine in the SchedMD Slurm GCP v6 controller. The changes span Terraform configurations to conditionally deploy MIGs, and Python scripts to manage MIG-based node resumption, suspension, and synchronization. The review feedback highlights several critical improvements: correcting Terraform coalesce usage with lists, initializing target_size to 0 for stateful MIGs to avoid duplicate instances, replacing inefficient single-request execute_with_futures calls with ensure_execute, and replacing global is_mig_engine checks with per-nodeset mig_name checks to safely support mixed nodeset environments.
225204a to
793d588
Compare
Neelabh94
left a comment
There was a problem hiding this comment.
Thanks for putting together this PR to support Managed Instance Groups for static compute nodes! This is a great addition for enabling hardware auto-repair and self-healing for long-running Slurm workloads.
Overall the architecture is well thought out. I've left a few inline comments on areas around GCE API compatibility, validation, idempotency, and edge-case handling.
0c797d6 to
d2d1079
Compare
Overview
This pull request introduces native, optional support for provisioning static Slurm compute nodes using Google Cloud Managed Instance Groups (MIGs).
Previously, static compute nodes were provisioned as standalone Compute Engine VMs using bulk insertion. With this change, users can choose to have static nodes managed by Google Cloud MIGs, unlocking automatic infrastructure self-healing and centralized group management while keeping Slurm job scheduling and MPI communication fully intact.
AUTOBehavior: By default (provisioning_engine = "AUTO"), the toolkit automatically routes DWS Flex-Start workloads to MIGs and standard compute workloads to Bulk Insert with zero user configuration. Existing clusters operate completely unchanged, while users who want automated hardware self-healing for their dedicated static nodesets can simply setprovisioning_engine = "MIG".Why Managed Instance Groups?
idleonce healthy.cluster-nodeset-0,cluster-nodeset-1), maintaining full compatibility with Slurm configs and MPI communication.<nodeset>-mig-0,<nodeset>-mig-1) to remain well within Google Cloud's recommended group limits."AUTO", meaning existing blueprints, dynamic auto-scaling nodes, and standard bulk-insert workflows continue to function with zero changes.How It Works
AUTOUser Scenario: Users do not need to configure anything by default."AUTO"preserves standard bulk provisioning for general workloads and automatically engages MIGs for DWS Flex-Start. Users explicitly specify"MIG"only when they want GCE-managed auto-repair on their static compute nodes.0. When the cluster boots, the Slurm controller scripts call GCE APIs to add instances to the group using deterministic names and configurations.suspend.pyremoves them from the group. When resumed,resume.pyrecreates them in the group with the current instance template and binds the Slurm Job ID to instance metadata.slurmsync.pychecks whether GCE is actively repairing a VM. If a node is in aREPAIRINGstate, Slurm marks it asDOWNwith the reason"MIG Auto-Healing instance repair in progress"so no jobs are sent to it until it recovers.Summary of Changes
schedmd-slurm-gcp-v6-nodeset: Addedprovisioning_engineinput variable with validation. Added safety guardrail ensuring pure static sizing whenMIGis selected.schedmd-slurm-gcp-v6-partition: Passed throughprovisioning_engineconfiguration to partition definitions.schedmd-slurm-gcp-v6-controller: Added declarative regional MIG resources, automatic multi-group indexing, and safety preconditions to prevent unsupported engine mutations on active nodes.resume.py: Addedresume_mig_nodes()to provision per-instance configurations into the target MIG.suspend.py: Addedsuspend_mig_nodes()with FQDN short-hostname normalization to remove instances viadeleteInstances.slurmsync.py: Added GCE Auto-Repair status detection to mark repairing nodesDOWNin Slurm.util.py: Added MIG lookup helpers (is_node_mig,node_mig_name,get_mig_instances, and group size expansion math).test_util.pyandtest_resume.pycovering multi-MIG indexing, FQDN node resolution, API schema variations, and auto-repair status reporting.Testing & Verification
1. Automated Test Suites
pytest-check).mypy,terraform_fmt,terraform_validate,codespell,duplicate-diff,module-label-check).2. Live GCP Deployment & Workload Testing
Verified on a live multi-partition Slurm cluster deployed on Google Cloud covering:
srun,sbatch) withExitCode 0:0.ExitCode 0:0.BULK_INSERT.3. Fault Tolerance & Disaster Recovery
slurmsynckept Slurm informed, the node safely transitioned back toidle, and subsequent parallel MPI jobs ran with zero errors.sudo reboot). Services restarted cleanly, reconnected to all managed instances, and resumed job scheduling without manual intervention.gcluster destroycleans up all instances, MIGs, disks, and templates with 0 orphaned cloud resources.