-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
from utils.subprocess_operations import get_piped_stdout, stdout_to_quota_records | ||
from hooks.slack import send_slack_message | ||
|
||
load_dotenv() | ||
SLACK_WEBHOOK = os.getenv("SLACK_JOB_WEBHOOK") | ||
|
||
|
||
def get_gpu_jobs() -> str: | ||
main_cmd = "squeue -t RUNNING" | ||
piped_cmd = "grep gpu_cuda" | ||
return get_piped_stdout(main_cmd, piped_cmd) | ||
|
||
|
||
def monitor(): | ||
gpu_jobs = get_gpu_jobs() | ||
return stdout_to_gpu_records(gpu_jobs) | ||
|
||
|
||
if __name__ == "__main__": | ||
print(monitor()) |
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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