Skip to content

Adding a scheduler for Slurm - #16

Merged
Intuity merged 36 commits into
mainfrom
slurm
Jun 23, 2025
Merged

Adding a scheduler for Slurm#16
Intuity merged 36 commits into
mainfrom
slurm

Conversation

@Intuity

@Intuity Intuity commented Mar 6, 2025

Copy link
Copy Markdown
Owner
  • Adding SlurmScheduler that uses the REST API
  • Correctly shutting down websockets in the event of a bad exit
  • Adding GatorHandler for log forwarding from a child python process (can be registered with logging as a handler)
  • Added Parent a wrapper class around the Gator websocket interface using threads rather than asyncio
  • Added ProcessStats for reporting custom CPU/memory statistics back to the parent hierarchy
  • Tracking log hierarchy
  • Adding arch to !Cores resource request
  • Adding a generic !Feature resource request - this is for machine specific features such as node locked licenses, GPUs, ...
  • Removing plotly plotting

@Intuity Intuity changed the title Initial integration of a Slurm-based scheduler Adding a scheduler for Slurm Jun 23, 2025
@Intuity
Intuity requested a review from Copilot June 23, 2025 17:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 thread gator/scheduler/slurm.py
Comment thread gator/scheduler/slurm.py
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,
},
)

Copilot AI Jun 23, 2025

Copy link

Choose a reason for hiding this comment

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

[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

Copilot uses AI. Check for mistakes.
@Intuity
Intuity merged commit 7c86610 into main Jun 23, 2025
6 checks passed
@Intuity
Intuity deleted the slurm branch June 23, 2025 17:53
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