Skip to content

feat(slurm-controller): add x11_parameters to cloud_parameters - #6145

Open
qsogia wants to merge 3 commits into
GoogleCloudPlatform:developfrom
qsogia:feat/slurm-x11-parameters
Open

feat(slurm-controller): add x11_parameters to cloud_parameters#6145
qsogia wants to merge 3 commits into
GoogleCloudPlatform:developfrom
qsogia:feat/slurm-x11-parameters

Conversation

@qsogia

@qsogia qsogia commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Supersedes #5363, which the inactivity bot auto-closed on 2026-08-14 and which GitHub refuses to reopen. Same change, now merged up to current develop.

Description

Adds x11_parameters to the cloud_parameters object in schedmd-slurm-gcp-v6-controller so that Slurm's X11Parameters directive can be set via the blueprint without forking slurm.conf.tpl.

The setting flows through cloud.conf (generated by conf.py), which is already included by slurm.conf via the existing include cloud.conf directive — no template changes required.

Changes

  • modules/slurm_files/scripts/conf.py — map x11_parametersX11Parameters in SlurmConfigGenerator.get_conf_options()
  • modules/slurm_files/variables.tf — add x11_parameters = optional(string) to cloud_parameters
  • variables.tf — same addition at the top-level controller module

Since #5363 was opened, conflines() was refactored into SlurmConfigGenerator, so the mapping now lives in the shared get_conf_options(). SlurmConfigGeneratorV2511 extends it via super() and SlurmConfigGeneratorV2411 does not override it, so 24.11, 25.05 and 25.11 all pick it up. Verified all three emit X11Parameters when the setting is present, and tests/test_conf.py passes unchanged (unset values are filtered out by dict_to_conf, so default output is unaffected).

Usage

- id: slurm_controller
  source: community/modules/scheduler/schedmd-slurm-gcp-v6-controller
  settings:
    cloud_parameters:
      prolog_flags: X11
      x11_parameters: enable_send_credentials

Why

PrologFlags=X11 was already supported via cloud_parameters.prolog_flags. X11Parameters was not. Both are required for srun --x11 to work:

  • PrologFlags=X11 — enables X11 forwarding in slurmctld at allocation time
  • X11Parameters=enable_send_credentials — forwards the MIT-MAGIC-COOKIE from the login node to the compute node so the display tunnel can authenticate

qsogia added 3 commits March 16, 2026 17:21
Adds x11_parameters to the cloud_parameters object so that
X11Parameters can be set in slurm.conf via the blueprint without
forking slurm.conf.tpl. The setting flows through cloud.conf, which
is already included by slurm.conf via the existing include directive.

Example blueprint usage:
  cloud_parameters:
    prolog_flags: X11
    x11_parameters: enable_send_credentials
conflines() moved into SlurmConfigGenerator upstream; X11Parameters now set
in the shared get_conf_options() so all Slurm version generators inherit it.
@qsogia
qsogia requested a review from a team as a code owner August 14, 2026 02:40
@github-actions github-actions Bot added the external PR from external contributor label Aug 14, 2026
@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 the ability to configure Slurm's X11Parameters directive directly through the deployment blueprint. By adding this parameter to the cloud_parameters object, users can now enable X11 forwarding authentication (such as enable_send_credentials) without needing to modify underlying configuration templates. This change ensures that the necessary X11 settings are correctly propagated to compute nodes, facilitating smoother srun --x11 operations.

Highlights

  • Feature Addition: Added support for the x11_parameters directive within the cloud_parameters configuration object.
  • Configuration Mapping: Updated conf.py to map x11_parameters to the Slurm X11Parameters setting, enabling it to be passed through to cloud.conf.
  • Infrastructure Updates: Updated Terraform variable definitions in both the top-level controller and the slurm_files module to include the new optional string parameter.
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 adds support for configuring X11 parameters in the SchedMD Slurm GCP v6 controller module. Specifically, it introduces the x11_parameters optional string variable to the cloud_parameters object in both the main module and the slurm_files submodule, updates the Python configuration script (conf.py) to map this parameter to X11Parameters, and updates the corresponding README documentation files. I have no feedback to provide as the changes are complete and consistent.

@Neelabh94 Neelabh94 self-assigned this Aug 14, 2026
@Neelabh94 Neelabh94 added the release-improvements Added to release notes under the "Improvements" heading. label Aug 14, 2026
@Neelabh94

Copy link
Copy Markdown
Contributor

/gcbrun

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.

Please add / update unit tests in community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/tests/test_conf.py for this change

tree_width = optional(number)
prolog_flags = optional(string)
switch_type = optional(string)
x11_parameters = optional(string)

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.

A comment explaining that that srun --x11 requires xorg-x11-xauth (or equivalent xauth package) installed on both login and compute VM images would be helpful here.

tree_width = optional(number)
prolog_flags = optional(string)
switch_type = optional(string)
x11_parameters = optional(string)

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.

We should add a validation block for variable "cloud_parameters" in
community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf that catches blueprint misconfigurations at terraform plan time. Something like this:

variable "cloud_parameters" {
  description = "cloud.conf options. Default behavior defined in scripts/conf.py"
  type = object({
   .... <Existing>
    switch_type             = optional(string)
    x11_parameters          = optional(string)
  })
  default  = {}
  nullable = false
  validation {
    condition = (
      var.cloud_parameters.x11_parameters == null ||
      (var.cloud_parameters.prolog_flags != null && can(regex("(^|,)X11(,|$)", var.cloud_parameters.prolog_flags)))
    )
    error_message = "When 'x11_parameters' is specified in cloud_parameters, 'prolog_flags' must also be specified and include 'X11' (e.g. prolog_flags = \"X11\")."
  }
}

@Neelabh94 Neelabh94 assigned qsogia and unassigned Neelabh94 Aug 16, 2026
@aslam-quad

Copy link
Copy Markdown
Contributor

Please NOTE : We recently upgraded our repository's Go version to 1.26 (#6173). We strongly recommend rebasing your open branches onto the latest develop branch to avoid or resolve any PR test failures.

Thank you!

@github-actions

Copy link
Copy Markdown

this PR has been inactive for 7 days and has changes requested. @qsogia, please address the requested changes or close the PR if it's no longer needed.

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