Skip to content

Add Slurm license support in workflow manager - #1665

Open
linsword13 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
linsword13:slurm-license
Open

Add Slurm license support in workflow manager#1665
linsword13 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
linsword13:slurm-license

Conversation

@linsword13

Copy link
Copy Markdown
Member

The default behavior works by:

  1. Check for the presence of matching license in the config
  2. If license info is found, assume the app instance requires license, and use the license name to specify {license_name}:{n_ranks} for the sbatch license header
  3. This can be overridden via the slurm_licenses workflow manager variable

This is the "client" side, in practice, this expects the Slurm cluster to configure the license limit properly.

@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 support for Slurm licenses in the Slurm workflow manager. It adds a new slurm_licenses variable, automatically resolves licenses from the configuration based on the application's required licenses if not explicitly provided, and appends the appropriate #SBATCH --licenses directive to the generated sbatch script. Additionally, comprehensive unit tests have been added to verify this behavior. Feedback on the changes suggests safely accessing app_inst.license_names using getattr to prevent potential AttributeError or TypeError if the attribute is undefined or None.

@ramble-pr-bot

ramble-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: b07493b

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.9678 2.9628 (3a20f6c) 2.9783
test_large_template_expansion passed 2.0274 2.0190 (3a20f6c) 2.1383
test_many_experiments passed 31.5806 31.8135 (3a20f6c) 36.8030
test_many_objects_defaults passed 19.1549 19.3860 (3a20f6c) 20.3052
test_matrix_filter_perf passed 1.2198 1.2271 (3a20f6c) 1.5412

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (3a20f6c) to head (b07493b).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1665   +/-   ##
========================================
  Coverage    93.35%   93.35%           
========================================
  Files          368      368           
  Lines        35423    35423           
========================================
  Hits         33068    33068           
  Misses        2355     2355           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@douglasjacobsen

Copy link
Copy Markdown
Collaborator

I don't have any issues with this, but there is a merge conflict that needs to be resolved.

The default behavior works by:

1. Check for the presence of matching license in the config
2. If license info is found, assume the app instance requires license, and use the license name to specify `{license_name}:{n_ranks}` for the sbatch license header
3. This can be overridden via the `slurm_licenses` workflow manager variable

This is the "client" side, in practice, this expects the Slurm cluster to configure the license limit properly.
@linsword13

Copy link
Copy Markdown
Member Author

I don't have any issues with this, but there is a merge conflict that needs to be resolved.

Ah thanks for the reminder. Resolved the conflict.

mutable_mock_apps_repo, make_workspace_from_config
):
test_config = """
ramble:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit; Can we replace this with a manage experiments config?

slurm_licenses = f"{matched_license}:{n_ranks}"

if slurm_licenses:
pragmas.append(f"#SBATCH --licenses={slurm_licenses}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the behavior if the backend portion of this isn't implemented? Is this just ignored, or do we get an error that the license isn't found?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We will actually get an error. To skip the error, one needs to specify slurm_licenses: ''

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK, in that case maybe it would be nice to have a variant (that defaults to false) to enable this behavior? It'd be unfortunate if licensed apps just started to not work because we don't have licensed defined in the slurm cluster.

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.

2 participants