nodeocc 1.0.19.post1__tar.gz → 1.0.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/PKG-INFO +1 -1
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/pyproject.toml +1 -1
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/model/infrastructure.py +9 -9
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/PKG-INFO +1 -1
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/utils.py +2 -2
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/README.md +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/setup.cfg +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/setup.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/__init__.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/controller/controller.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/model/job.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/SOURCES.txt +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/dependency_links.txt +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/entry_points.txt +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/requires.txt +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/nodeocc.egg-info/top_level.txt +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/readers/compute_wait_time.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/readers/slurmreader.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/__init__.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/curses_multiwindow.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/slurm_list.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/slurm_viz.py +0 -0
- {nodeocc-1.0.19.post1 → nodeocc-1.0.20}/src/view/styles.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nodeocc"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.20"
|
|
8
8
|
authors = [{ name = "Matteo Boschini" }]
|
|
9
9
|
maintainers = [{ name = "Lorenzo Bonicelli" }, { name = "Aniello Panariello" }]
|
|
10
10
|
description = "TUI application for viewing the status of GPU allocations on a Slurm cluster"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Optional
|
|
2
2
|
|
|
3
3
|
from view.utils import to_datetime
|
|
4
4
|
|
|
@@ -46,9 +46,7 @@ class Maintenance:
|
|
|
46
46
|
return m
|
|
47
47
|
|
|
48
48
|
def to_nested_dict(self):
|
|
49
|
-
return {
|
|
50
|
-
k: v for k, v in self.__dict__.items()
|
|
51
|
-
}
|
|
49
|
+
return {k: v for k, v in self.__dict__.items()}
|
|
52
50
|
|
|
53
51
|
|
|
54
52
|
class Infrastructure:
|
|
@@ -84,8 +82,7 @@ class Infrastructure:
|
|
|
84
82
|
|
|
85
83
|
def to_nested_dict(self):
|
|
86
84
|
return {
|
|
87
|
-
k: ([n.__dict__ for n in self.nodes] if k == 'nodes' else
|
|
88
|
-
([n.to_nested_dict() for n in self.maintenances] if k == 'maintenances' else v))
|
|
85
|
+
k: ([n.__dict__ for n in self.nodes] if k == 'nodes' else ([n.to_nested_dict() for n in self.maintenances] if k == 'maintenances' else v))
|
|
89
86
|
for k, v in self.__dict__.items()
|
|
90
87
|
}
|
|
91
88
|
|
|
@@ -94,8 +91,11 @@ class Infrastructure:
|
|
|
94
91
|
f"\n\nlimits:({self.gpu_limit_pu}:{self.gpu_limit_grp}),({self.gpu_limit_stu}:{self.gpu_limit_stugrp})"
|
|
95
92
|
|
|
96
93
|
def get_sorted_nodes(self):
|
|
97
|
-
|
|
98
94
|
return sorted(self.nodes, key=lambda x: self.prior.index(x.gpu_model.split(',')[0]) if x.gpu_model.split(',')[0] in self.prior else -1)
|
|
99
95
|
|
|
100
|
-
def get_next_maintenance(self):
|
|
101
|
-
|
|
96
|
+
def get_next_maintenance(self) -> Optional[Maintenance]:
|
|
97
|
+
if self.maintenances:
|
|
98
|
+
if hasattr(self.maintenances[0], 'start_time'): # if it is the master this is a dict
|
|
99
|
+
return sorted(self.maintenances, key=lambda x: to_datetime(x.start_time))[0]
|
|
100
|
+
return Maintenance(**sorted(self.maintenances, key=lambda x: to_datetime(x.get('start_time')))[0])
|
|
101
|
+
return None
|
|
@@ -38,8 +38,8 @@ def maintenance_status(infrastructure):
|
|
|
38
38
|
if len(infrastructure.maintenances):
|
|
39
39
|
# time format: '0 2023-12-04 14:00:00\nName: StartTime, dtype: datetime64[ns]'
|
|
40
40
|
next_maintenance = infrastructure.get_next_maintenance()
|
|
41
|
-
start_time = to_datetime(next_maintenance.
|
|
42
|
-
end_time = to_datetime(next_maintenance.
|
|
41
|
+
start_time = to_datetime(next_maintenance.start_time)
|
|
42
|
+
end_time = to_datetime(next_maintenance.end_time)
|
|
43
43
|
time_to_maintenance = (start_time - np.datetime64('now')).astype(float)
|
|
44
44
|
# TODO: fix timezone
|
|
45
45
|
if time_to_maintenance < 0 and (end_time - np.datetime64('now')) > 0:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|