fix(scheduler): Fix SLURM scheduler spec.image and spec.additional_bash_cmds arguments.#876
Conversation
Summary of ChangesHello @nuzant, 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 significantly enhances the Slurm scheduler by addressing key issues related to container image management and command execution. It eliminates a hardcoded container image, allowing for dynamic image specification, and rectifies a bug where native mode failed to execute additional bash commands. These changes ensure more consistent and robust worker provisioning, particularly for scenarios involving forked processes, and improve the overall flexibility of the Slurm integration. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
spec.image and spec.additional_bash_cmds arguments.
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes and improvements to the Slurm scheduler. It removes a hardcoded container image, making it configurable via the scheduling spec. It also fixes an issue where native mode (non-apptainer) would ignore additional bash commands, and unifies command execution between native and apptainer modes. Additionally, it adds port allocation capabilities to the proxy server to support forked workers.
My review focuses on two main areas. First, I've identified a potential race condition in the new port allocation endpoint that could lead to the same port being assigned twice. I've suggested using an asyncio.Lock to ensure thread safety. Second, I've found a bug in how shell commands are escaped when constructing the sbatch script, which could cause issues with commands containing special characters. I've recommended using shlex.quote for a more robust solution.
The rest of the changes, including the test updates for forked workers, look good and align with the goals of the pull request.
8de605d to
1623686
Compare
garrett4wade
left a comment
There was a problem hiding this comment.
The change is not necessarily related to CI. Merging anyways.
…_bash_cmds` arguments. (areal-project#876)
…_bash_cmds` arguments. (areal-project#876)
Description
Fix issues in the Slurm scheduler:
container_imageparameter - usespec.imagefrom scheduling spec insteadspec.additional_bash_cmdsarguments.Related Issue
N/A
Type of Change
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
N/A
Additional Context
Generated with Claude Code