Skip to content

feat(controller): expose controller IG and named ports for LB integration#5967

Open
mangal390 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
mangal390:feat/controller-ig-lb
Open

feat(controller): expose controller IG and named ports for LB integration#5967
mangal390 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
mangal390:feat/controller-ig-lb

Conversation

@mangal390

Copy link
Copy Markdown

Description

This PR enhances the schedmd-slurm-gcp-v6-controller module by natively exposing the Managed Instance Group (MIG) and its named ports, allowing users to seamlessly integrate the controller with Google Cloud Load Balancers (such as Internal Passthrough or Internal Application LBs).

Changes made:

  1. Added named_ports variable: Added an optional named_ports list variable to variables_controller_instance.tf which applies directly to the underlying google_compute_instance_group_manager / google_compute_region_instance_group_manager.
  2. Updated Controller MIGs: Added a dynamic "named_port" block iterating over the new variable so users can expose ports (example: slurm-restapi: 6820) for Load Balancer backend discovery.
  3. Exposed MIG Outputs: Added standard outputs to outputs.tf (controller_instance_group, controller_mig_name, controller_mig_id, and controller_instance_names) that output the self-links and IDs of the deployed MIG when HA is enabled.

@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 enhances the schedmd-slurm-gcp-v6-controller module by providing native support for named ports on the controller's Managed Instance Group. This change enables seamless integration with various Google Cloud Load Balancer configurations. Additionally, it exposes several key infrastructure identifiers as outputs, improving the observability and manageability of the deployed controller resources.

Highlights

  • Named Ports Configuration: Introduced a new named_ports variable to allow users to define named ports for the controller Managed Instance Group (MIG), facilitating easier integration with Google Cloud Load Balancers.
  • MIG Integration: Updated both zonal and regional controller MIG configurations to dynamically apply the named_ports settings.
  • Enhanced Outputs: Exposed new outputs including controller_instance_group, controller_mig_name, controller_mig_id, and controller_instance_names to improve visibility into the deployed infrastructure.
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.

@github-actions github-actions Bot added the external PR from external contributor label Jul 16, 2026
@google-cla

google-cla Bot commented Jul 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 a new named_ports input variable to the Slurm GCP v6 controller module, dynamically applying these ports to both zonal and regional controller managed instance groups. It also adds several outputs to expose details about the controller instance groups. The review feedback recommends replacing the try() function in the new outputs with one(concat(...)) to avoid masking configuration errors, and adding input validation to the named_ports variable to ensure valid port numbers and RFC 1035 compliant names.

Comment thread community/modules/scheduler/schedmd-slurm-gcp-v6-controller/outputs.tf Outdated
Comment thread community/modules/scheduler/schedmd-slurm-gcp-v6-controller/outputs.tf Outdated
@mangal390
mangal390 force-pushed the feat/controller-ig-lb branch 3 times, most recently from 70b8b1d to cbd4a09 Compare July 17, 2026 09:59
@mangal390
mangal390 marked this pull request as ready for review July 17, 2026 10:02
@mangal390
mangal390 requested a review from a team as a code owner July 17, 2026 10:02
@Neelabh94 Neelabh94 added the release-improvements Added to release notes under the "Improvements" heading. label Jul 17, 2026
@mangal390
mangal390 force-pushed the feat/controller-ig-lb branch from cbd4a09 to 32e59da Compare July 20, 2026 08:24
@arpit974

Copy link
Copy Markdown
Contributor

/gemini review

@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 a new named_ports input variable to the Slurm GCP v6 controller module, enabling the configuration of named ports on the controller's zonal and regional Managed Instance Groups (MIGs). It also adds several outputs to expose MIG details and updates the module's documentation. The review feedback recommends referencing the MIG resources directly in the controller_mig_name output to preserve Terraform's dependency graph, and adding a validation rule to ensure all named port names are unique to prevent API errors.

@arpit974 arpit974 assigned mangal390 and unassigned arpit974 Jul 21, 2026
@arpit974
arpit974 self-requested a review July 21, 2026 07:37
@mangal390
mangal390 force-pushed the feat/controller-ig-lb branch from 32e59da to 736b8d1 Compare July 21, 2026 13:05
@mangal390
mangal390 force-pushed the feat/controller-ig-lb branch from 736b8d1 to c633db0 Compare July 21, 2026 13:16
@mangal390 mangal390 removed their assignment Jul 21, 2026
@mangal390

Copy link
Copy Markdown
Author

@arpit974 - I have resolved the conflicts and update the validation block.

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

Labels

external PR from external contributor release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants