Conversation
added 8 commits
March 27, 2025 15:06
…ed resource requests
added 21 commits
March 27, 2025 16:27
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a SlurmScheduler that leverages the Slurm REST API for job submission and management while also enhancing logging functionality and job specification support (including new resource types such as !Feature and the arch attribute for !Cores). Key changes include:
- Implementation of SlurmScheduler with token management, job submission, and REST API communication.
- Updates to job and scheduler specifications including the addition of extend_env and support for generic !Feature.
- Improvements to logging with a new GatorHandler and modifications to log hierarchy handling.
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/* | Adjust test cases to reflect changes in scheduler command and spec |
| gator/scheduler/slurm.py | New scheduler implementation for Slurm with REST API interaction |
| gator/specs/resource.py & jobs.py | Added arch to !Cores and introduced !Feature resource type |
| gator/common/ws_* & logger.py | Updated websocket and logger functionality to support hierarchy |
| pyproject.toml & mkdocs.yml | Updated dependencies, version, and documentation configuration |
Comments suppressed due to low confidence (1)
gator/scheduler/slurm.py:67
- [nitpick] The variable name '_stdout_dirx' is unclear; consider renaming it to '_stdout_dir' for consistency and clarity.
self._stdout_dirx: Path = self.tracking / "slurm"
Comment on lines
+100
to
+106
| return aiohttp.ClientSession( | ||
| base_url=self._api_root + (f"/slurm/{self._api_version}/" if self._api_version else ""), | ||
| headers={ | ||
| "X-SLURM-USER-NAME": self._username, | ||
| "X-SLURM-USER-TOKEN": self.token, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
[nitpick] Each call to get_session creates a new aiohttp.ClientSession without explicit closure. Consider reusing a session or ensuring proper closure to avoid potential resource overhead.
Suggested change
| return aiohttp.ClientSession( | |
| base_url=self._api_root + (f"/slurm/{self._api_version}/" if self._api_version else ""), | |
| headers={ | |
| "X-SLURM-USER-NAME": self._username, | |
| "X-SLURM-USER-TOKEN": self.token, | |
| }, | |
| ) | |
| return self._session |
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.
SlurmSchedulerthat uses the REST APIGatorHandlerfor log forwarding from a child python process (can be registered withloggingas a handler)Parenta wrapper class around the Gator websocket interface using threads rather than asyncioProcessStatsfor reporting custom CPU/memory statistics back to the parent hierarchyarchto!Coresresource request!Featureresource request - this is for machine specific features such as node locked licenses, GPUs, ...