Skip to content

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

Open
qsogia wants to merge 2 commits intoGoogleCloudPlatform:developfrom
qsogia:feat/slurm-x11-parameters
Open

feat(slurm-controller): add x11_parameters to cloud_parameters#5363
qsogia wants to merge 2 commits intoGoogleCloudPlatform:developfrom
qsogia:feat/slurm-x11-parameters

Conversation

@qsogia
Copy link

@qsogia qsogia commented Mar 17, 2026

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 conflines()
  • modules/slurm_files/variables.tf — add x11_parameters = optional(string) to cloud_parameters
  • variables.tf — same addition at the top-level controller module

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

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
@qsogia qsogia requested review from a team and samskillman as code owners March 17, 2026 00:22
@google-cla
Copy link

google-cla bot commented Mar 17, 2026

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.

@github-actions github-actions bot added the external PR from external contributor label Mar 17, 2026
@gemini-code-assist
Copy link
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 Slurm GCP controller by integrating a new x11_parameters field into the cloud_parameters configuration. This addition allows users to directly control Slurm's X11Parameters directive through the blueprint, which is crucial for enabling robust X11 forwarding with srun --x11 commands. The change streamlines the configuration process, making it easier to manage X11 settings without modifying core template files.

Highlights

  • X11 Parameter Configuration: Introduced x11_parameters to the cloud_parameters object within the schedmd-slurm-gcp-v6-controller.
  • Blueprint Integration: Enabled setting Slurm's X11Parameters directive directly via the blueprint, eliminating the need to fork slurm.conf.tpl.
  • Enhanced X11 Forwarding: Facilitated full srun --x11 functionality by allowing configuration of X11Parameters for credential forwarding.
Changelog
  • community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/conf.py
    • Mapped the new x11_parameters input to the X11Parameters directive in the generated Slurm configuration.
  • community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/variables.tf
    • Updated the cloud_parameters variable definition to include x11_parameters as an optional string.
  • community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf
    • Updated the top-level cloud_parameters variable definition to include x11_parameters as an optional string.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 the x11_parameters setting to cloud_parameters, allowing for the configuration of Slurm's X11Parameters directive. The changes are implemented correctly across the Python configuration script and the Terraform variable definitions. My review focuses on ensuring the module documentation is updated to reflect this new parameter, which is a requirement for maintainability as per the project's style guide.

tree_width = optional(number)
prolog_flags = optional(string)
switch_type = optional(string)
x11_parameters = optional(string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new x11_parameters field should be documented in the module's README.md to ensure the documentation is complete and clear for users. Please run the pre-commit-terraform-docs-hook to update the inputs table. This aligns with the repository's style guide on documentation.

References
  1. Module README.md files should be clear and provide sufficient information on usage, inputs, and outputs. (link)

tree_width = optional(number)
prolog_flags = optional(string)
switch_type = optional(string)
x11_parameters = optional(string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain documentation quality, the new x11_parameters field should be added to this module's README.md. Please regenerate the documentation to update the cloud_parameters input description. This is required by the repository's style guide.

References
  1. Module README.md files should be clear and provide sufficient information on usage, inputs, and outputs. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant