-
-
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.
restructure and ready to test on slurm
- Loading branch information
Showing
7 changed files
with
55 additions
and
23 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
slack_webhook="" | ||
SLACK_JOB_WEBHOOK="" <- start with https:// | ||
SLACK_QUOTA_WEBHOOK="" | ||
ENABLE_JOB_DEBUG_MODE=False <- True or False only | ||
PROJECT_IDS="S0090,S0090" <- no space, comma separated, no trailing comma |
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
from hooks.slack import send_slack_message | ||
from utils.subprocess_operations import get_cmd_stdout | ||
|
||
load_dotenv() | ||
|
||
PROJECT_IDs: list[str] = os.getenv("PROJECT_IDS").split(',') | ||
SLACK_WEBHOOK: str = os.getenv("SLACK_QUOTA_WEBHOOK") | ||
|
||
|
||
def get_fileset_quota(project_id: str) -> str: | ||
cmd = f"rquota | grep ${project_id}" | ||
stdout: str = get_cmd_stdout(cmd) | ||
return stdout | ||
|
||
|
||
def monitor(): | ||
... | ||
|
||
|
||
if __name__ == "__main__": | ||
for project_id in PROJECT_IDs: | ||
get_fileset_quota(project_id) |
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
12 changes: 9 additions & 3 deletions
12
utils/stdout_processing.py → utils/subprocess_operations.py
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