feat(slurm): add reservation support to job configuration#147
Open
mkuznet1 wants to merge 1 commit into
Open
Conversation
- Updated SlurmDeployment to include a new "reservation" field in the job configuration, allowing users to specify job reservations. - Modified job.sh.j2 template to conditionally include the reservation directive in the SLURM job script if a reservation is provided. This enhancement improves the flexibility of job submissions in SLURM environments.
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for specifying a Slurm reservation when submitting jobs via the Slurm deployment path, ensuring the configuration value is available to the job-script renderer and emitted as an #SBATCH directive.
Changes:
- Passes
reservationfromslurm_configinto the Jinja template render context. - Updates the Slurm job script template to conditionally emit
#SBATCH --reservationwhen provided.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/madengine/deployment/templates/slurm/job.sh.j2 | Conditionally adds #SBATCH --reservation={{ reservation }} to the generated job script. |
| src/madengine/deployment/slurm.py | Adds reservation to the template context so the script template can render it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for specifying a Slurm reservation in job submissions. The main changes ensure that the
reservationparameter from the Slurm configuration is passed through the deployment code and correctly rendered in the Slurm job script template.Support for Slurm reservation:
reservationfield to the Slurm job configuration dictionary inslurm.py, so it can be accessed and used when generating job scripts.job.sh.j2) to include the#SBATCH --reservationdirective if a reservation is specified.- Updated SlurmDeployment to include a new "reservation" field in the job configuration, allowing users to specify job reservations.This enhancement improves the flexibility of job submissions in SLURM environments.