matrice-compute 0.1.44__py3-none-any.whl → 0.1.46__py3-none-any.whl
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.
- matrice_compute/__init__.py +21 -10
- matrice_compute/__init__.pyi +2056 -0
- matrice_compute/action_instance.py +21 -6
- matrice_compute/actions_manager.py +2 -1
- matrice_compute/actions_scaledown_manager.py +5 -0
- matrice_compute/instance_manager.py +26 -6
- matrice_compute/instance_utils.py +8 -8
- matrice_compute/k8s_scheduler.py +749 -0
- matrice_compute/prechecks.py +5 -6
- matrice_compute/resources_tracker.py +68 -53
- matrice_compute/scaling.py +31 -2
- matrice_compute/task_utils.py +51 -0
- {matrice_compute-0.1.44.dist-info → matrice_compute-0.1.46.dist-info}/METADATA +4 -4
- matrice_compute-0.1.46.dist-info/RECORD +20 -0
- {matrice_compute-0.1.44.dist-info → matrice_compute-0.1.46.dist-info}/WHEEL +1 -1
- matrice_compute-0.1.44.dist-info/RECORD +0 -18
- {matrice_compute-0.1.44.dist-info → matrice_compute-0.1.46.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice_compute-0.1.44.dist-info → matrice_compute-0.1.46.dist-info}/top_level.txt +0 -0
matrice_compute/__init__.py
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
"""Module providing __init__ functionality."""
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
import subprocess
|
|
4
5
|
import logging
|
|
5
6
|
|
|
6
7
|
from matrice_common.utils import dependencies_check
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
)
|
|
9
|
+
# Check execution mode to determine which dependencies to verify
|
|
10
|
+
execution_mode = os.environ.get("EXECUTION_MODE", "vm").lower()
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
if execution_mode == "kubernetes":
|
|
13
|
+
# Kubernetes mode - only check K8s-related dependencies
|
|
14
|
+
dependencies_check(
|
|
15
|
+
["kubernetes", "psutil", "cryptography"]
|
|
16
|
+
)
|
|
17
|
+
else:
|
|
18
|
+
# VM mode - check docker and other VM-specific dependencies
|
|
19
|
+
dependencies_check(
|
|
20
|
+
["docker", "psutil", "cryptography", "notebook", "aiohttp", "kafka-python"]
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
subprocess.run( # Re-upgrade docker to avoid missing DOCKER_HOST connection error
|
|
24
|
+
["pip", "install", "--upgrade", "docker"],
|
|
25
|
+
check=True,
|
|
26
|
+
stdout=subprocess.DEVNULL, # suppress normal output
|
|
27
|
+
stderr=subprocess.DEVNULL # suppress warnings/progress
|
|
28
|
+
)
|
|
18
29
|
|
|
19
30
|
from matrice_compute.instance_manager import InstanceManager # noqa: E402
|
|
20
31
|
|
|
21
32
|
logging.getLogger("kafka").setLevel(logging.INFO)
|
|
22
33
|
logging.getLogger("confluent_kafka").setLevel(logging.INFO)
|
|
23
34
|
|
|
24
|
-
__all__ = ["InstanceManager"]
|
|
35
|
+
__all__ = ["InstanceManager"]
|