matrice-compute 0.1.42__py3-none-any.whl → 0.1.44__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.
@@ -1905,11 +1905,14 @@ def video_storage_setup_execute(self: ActionInstance):
1905
1905
  self.start(cmd, "video_storage_setup_execute")
1906
1906
  return
1907
1907
 
1908
+ # get the mediaStorage path from jobParams
1909
+ media_storage_path = action_details["jobParams"].get("mediaStoragePath", "/host/data/path/video_storage")
1910
+
1908
1911
  # This is the existing Docker run command
1909
1912
  worker_cmd = (
1910
1913
  f"docker run -d --pull=always --net=host "
1911
1914
  f"--name {self.action_record_id}_{self.action_type} "
1912
- f"-v matrice_myvol:/matrice_data "
1915
+ f"-v {media_storage_path}:/storage "
1913
1916
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1914
1917
  f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1915
1918
  f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
@@ -1543,12 +1543,12 @@ class KafkaResourceMonitor:
1543
1543
  return gpu_usage
1544
1544
 
1545
1545
  @staticmethod
1546
- def get_all_storage_info() -> Dict[str, float]:
1546
+ def get_all_storage_info() -> Dict[str, tuple]:
1547
1547
  """
1548
- Get free storage space for all mounted drives.
1548
+ Get storage information for all mounted drives.
1549
1549
 
1550
1550
  Returns:
1551
- Dict[str, float]: Dictionary mapping mount point to free storage space in GB.
1551
+ Dict[str, tuple]: Dictionary mapping mount point to (free_gb, total_gb).
1552
1552
  """
1553
1553
  storage_info = {}
1554
1554
 
@@ -1563,8 +1563,9 @@ class KafkaResourceMonitor:
1563
1563
 
1564
1564
  # Convert bytes to GB
1565
1565
  free_gb = usage.free / (1024 ** 3)
1566
+ total_gb = usage.total / (1024 ** 3)
1566
1567
 
1567
- storage_info[partition.mountpoint] = round(free_gb, 2)
1568
+ storage_info[partition.mountpoint] = (round(free_gb, 2), round(total_gb, 2))
1568
1569
 
1569
1570
  except PermissionError:
1570
1571
  # Skip drives that we can't access (common on Windows)
@@ -1580,13 +1581,13 @@ class KafkaResourceMonitor:
1580
1581
 
1581
1582
  return storage_info
1582
1583
 
1583
- def get_stats(self) -> Tuple[float, int, float, float, Dict[int, tuple], Dict[str, float]]:
1584
+ def get_stats(self) -> Tuple[float, int, float, float, Dict[int, tuple], Dict[str, tuple]]:
1584
1585
  """
1585
1586
  Collect current system resource statistics.
1586
1587
 
1587
1588
  Returns:
1588
- Tuple[float, int, float, float, Dict[int, tuple], Dict[str, float]]:
1589
- CPU usage %, CPU cores, RAM total GB, RAM used GB, GPU memory dict (used, total), Free storage dict
1589
+ Tuple[float, int, float, float, Dict[int, tuple], Dict[str, tuple]]:
1590
+ CPU usage %, CPU cores, RAM total GB, RAM used GB, GPU memory dict (used, total), Storage dict (free, total)
1590
1591
  """
1591
1592
  cpu_usage = psutil.cpu_percent(interval=1)
1592
1593
  cpu_cores = psutil.cpu_count(logical=True) # Total logical CPU cores
@@ -1627,6 +1628,8 @@ class KafkaResourceMonitor:
1627
1628
 
1628
1629
  # Format GPU info for output: {0: {"used_gb": x, "total_gb": y}, ...}
1629
1630
  gpu_memory_gb = {k: {"used_gb": v[0], "total_gb": v[1]} for k, v in gpus.items()}
1631
+ # Format storage info for output: {"/": {"free_gb": x, "total_gb": y}, ...}
1632
+ storage_gb = {k: {"free_gb": v[0], "total_gb": v[1]} for k, v in storage.items()}
1630
1633
  payload = {
1631
1634
  "instance_id": self.instance_id,
1632
1635
  "cpu_usage_percent": round(cpu, 2),
@@ -1634,7 +1637,7 @@ class KafkaResourceMonitor:
1634
1637
  "ram_total_gb": round(total, 2),
1635
1638
  "ram_used_gb": round(used, 2),
1636
1639
  "gpu_memory_gb": gpu_memory_gb, # dict: {0: {used_gb, total_gb}, ...}
1637
- "free_storage_gb": storage, # dict: {"/": 50.5, "C:": 123.4}
1640
+ "storage_gb": storage_gb, # dict: {"/": {free_gb, total_gb}, ...}
1638
1641
  "timestamp": datetime.now(timezone.utc).isoformat()
1639
1642
  }
1640
1643
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_compute
3
- Version: 0.1.42
3
+ Version: 0.1.44
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -1,5 +1,5 @@
1
1
  matrice_compute/__init__.py,sha256=YZhx7rQlD1TAlhBMbsU3_Xp-tpLyTAxWZDcQvqmwR2g,723
2
- matrice_compute/action_instance.py,sha256=N74jgcNm_l6zk9w8shPlgR9EWFjICXWkfOP4MKwig2o,73979
2
+ matrice_compute/action_instance.py,sha256=Wowl1Sw6gwH2iwXD6yIWnODhgFDNBzM1olpUthV7m44,74145
3
3
  matrice_compute/actions_manager.py,sha256=a_TulMnu462xc0t_A-Mpug5zhQTmtpjiv7mhiC_IAVw,18280
4
4
  matrice_compute/actions_scaledown_manager.py,sha256=pJ0nduNwHWZ10GnqJNx0Ok7cVWabQ_M8E2Vb9pH3A_k,2002
5
5
  matrice_compute/compute_operations_handler.py,sha256=amcMhmXtv2irE6qK8Vbgec_8uFqjWmVVp0VWq-73_MU,17781
@@ -7,12 +7,12 @@ matrice_compute/instance_manager.py,sha256=W0BN1mkfcqCP1jxb6JjhNPUHM-iTmrDu7Woyf
7
7
  matrice_compute/instance_utils.py,sha256=N4yPDvNukFEEBngR0lEt4x_XT5hur1q0P-spM2xQIlU,42025
8
8
  matrice_compute/prechecks.py,sha256=W9YmNF3RcLhOf4U8WBlExvFqDw1aGWSNTlJtA73lbDQ,17196
9
9
  matrice_compute/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- matrice_compute/resources_tracker.py,sha256=1HDCRZLDbYAHGhJojM_Hee8vSpVGbFB96WUUc_rqudY,67870
10
+ matrice_compute/resources_tracker.py,sha256=Hn_auCSQ2vQIc8X3PZ-KvoVOamjfEkQmbL4ekmWgbt8,68149
11
11
  matrice_compute/scaling.py,sha256=UQDI8wN9JEKafvUVPF0Pk9XmhKlbMkeu16AZyyOuSE8,55147
12
12
  matrice_compute/shutdown_manager.py,sha256=rnP9Qes6JJKDnebmBC9rqkH__X9a8TMjhWQPWoOQKFs,13232
13
13
  matrice_compute/task_utils.py,sha256=3qIutiQdYPyGRxH9ZwLbqdg8sZcnp6jp08pszWCRFl0,2820
14
- matrice_compute-0.1.42.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
15
- matrice_compute-0.1.42.dist-info/METADATA,sha256=jSxrKx79IwTZZzRkTuqcHaNwixeEpxT6zG4W2F52UJI,1038
16
- matrice_compute-0.1.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- matrice_compute-0.1.42.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
18
- matrice_compute-0.1.42.dist-info/RECORD,,
14
+ matrice_compute-0.1.44.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
15
+ matrice_compute-0.1.44.dist-info/METADATA,sha256=yrkFxOzfY0cq4wKGpoetb3vt8PoPoRDszI64DKTWZWE,1038
16
+ matrice_compute-0.1.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ matrice_compute-0.1.44.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
18
+ matrice_compute-0.1.44.dist-info/RECORD,,