matrice-compute 0.1.16__py3-none-any.whl → 0.1.18__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.
@@ -75,7 +75,9 @@ class ActionInstance:
75
75
  "facial_recognition_setup": facial_recognition_setup_execute,
76
76
  "fe_fs_streaming": fe_fs_streaming_execute,
77
77
  "inference_ws_server": inference_ws_server_execute,
78
- "lpr_setup": lpr_setup_execute
78
+ "fe_analytics_service": fe_analytics_service_execute,
79
+ "lpr_setup": lpr_setup_execute,
80
+ "inference_tracker_server": inference_tracker_setup_execute
79
81
  }
80
82
  if self.action_type not in self.actions_map:
81
83
  raise ValueError(f"Unknown action type: {self.action_type}")
@@ -471,11 +473,12 @@ class ActionInstance:
471
473
  # Try to get model codebase URLs from action_details first
472
474
  model_codebase_url = job_params.get("model_codebase_url")
473
475
  model_requirements_url = job_params.get("model_requirements_url")
476
+ dockerId = job_params.get("_idDocker")
474
477
 
475
478
  # Fallback to API calls if not provided in action_details
476
479
  if not model_codebase_url:
477
480
  model_codebase_url, error, message = self.scaling.get_model_codebase(
478
- model_family
481
+ dockerId
479
482
  )
480
483
  if error:
481
484
  logging.warning(f"Failed to get model codebase URL: {message}")
@@ -486,7 +489,7 @@ class ActionInstance:
486
489
  model_codebase_requirements_url = model_requirements_url
487
490
  else:
488
491
  model_codebase_requirements_url, error, message = (
489
- self.scaling.get_model_codebase_requirements(model_family)
492
+ self.scaling.get_model_codebase_requirements(dockerId)
490
493
  )
491
494
  if error:
492
495
  logging.warning(
@@ -1173,7 +1176,7 @@ def inference_ws_server_execute(self: ActionInstance):
1173
1176
  def fe_fs_streaming_execute(self: ActionInstance):
1174
1177
  """
1175
1178
  Creates and setup the frontend for fs streaming.
1176
- Frontend streaming runs on port 3001 (localhost only with --net=host).
1179
+ Frontend streaming runs on port 3000 (localhost only with --net=host).
1177
1180
  """
1178
1181
  action_details = self.get_action_details()
1179
1182
 
@@ -1183,7 +1186,7 @@ def fe_fs_streaming_execute(self: ActionInstance):
1183
1186
 
1184
1187
  self.setup_action_requirements(action_details)
1185
1188
 
1186
- # Frontend streaming with --net=host (Port: 3001)
1189
+ # Frontend streaming with --net=host (Port: 3000)
1187
1190
  worker_cmd = (
1188
1191
  f"docker run -d --pull=always --net=host "
1189
1192
  f"--name fe_streaming "
@@ -1191,14 +1194,49 @@ def fe_fs_streaming_execute(self: ActionInstance):
1191
1194
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1192
1195
  f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1193
1196
  f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1197
+ f"-e PORT=3000 "
1194
1198
  f"{image}"
1195
1199
  )
1196
- logging.info("Starting frontend streaming (Port: 3001): %s", worker_cmd)
1200
+ logging.info("Starting frontend streaming (Port: 3000): %s", worker_cmd)
1197
1201
 
1198
1202
  # Docker Command run
1199
1203
  self.start(worker_cmd, "fe_fs_streaming")
1200
1204
 
1201
1205
 
1206
+ @log_errors(raise_exception=False)
1207
+ def fe_analytics_service_execute(self: ActionInstance):
1208
+ """
1209
+ Creates and setup the frontend analytics service.
1210
+ Frontend analytics service runs on port 3001 (localhost only with --net=host).
1211
+ """
1212
+ action_details = self.get_action_details()
1213
+
1214
+ if not action_details:
1215
+ return
1216
+ image = action_details["actionDetails"].get("docker")
1217
+
1218
+ self.setup_action_requirements(action_details)
1219
+
1220
+ project_id = action_details["_idProject"]
1221
+
1222
+ # Frontend analytics service with --net=host (Port: 3001)
1223
+ worker_cmd = (
1224
+ f"docker run -d --pull=always --net=host "
1225
+ f"--name fe-analytics "
1226
+ f'-e NEXT_PUBLIC_DEPLOYMENT_ENV="{os.environ.get("ENV", "prod")}" '
1227
+ f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1228
+ f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1229
+ f'-e ACTION_ID="{self.action_record_id}" '
1230
+ f"-e PORT=3001 "
1231
+ f'-e PROJECT_ID="{project_id}" '
1232
+ f"{image}"
1233
+ )
1234
+ logging.info("Starting frontend analytics service (Port: 3001): %s", worker_cmd)
1235
+
1236
+ # Docker Command run
1237
+ self.start(worker_cmd, "fe_analytics_service")
1238
+
1239
+
1202
1240
  @log_errors(raise_exception=False)
1203
1241
  def synthetic_dataset_generation_execute(self: ActionInstance):
1204
1242
  """Execute synthetic dataset generation task."""
@@ -1571,3 +1609,34 @@ def kafka_setup_execute(self: ActionInstance):
1571
1609
 
1572
1610
  logging.info("Starting Kafka container (Ports: 9092, 9093): %s", cmd)
1573
1611
  self.start(cmd, "kafka_setup")
1612
+
1613
+
1614
+ @log_errors(raise_exception=False)
1615
+ def inference_tracker_setup_execute(self: ActionInstance):
1616
+
1617
+ """
1618
+ Creates and start inference tracker.
1619
+ Inference tracker runs on port 8110 (localhost only with --net=host).
1620
+ """
1621
+
1622
+ action_details = self.get_action_details()
1623
+ if not action_details:
1624
+ return
1625
+
1626
+ image = self.docker_container
1627
+
1628
+ self.setup_action_requirements(action_details)
1629
+
1630
+ # This is the existing Docker run command
1631
+ worker_cmd = (
1632
+ f"docker run -d --pull=always --net=host "
1633
+ f"--name inference-tracker-worker "
1634
+ f"-v matrice_myvol:/matrice_data "
1635
+ f'-e ENV="{os.environ.get("ENV", "prod")}" '
1636
+ f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1637
+ f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1638
+ f'-e ACTION_ID="{self.action_record_id}" '
1639
+ f"{image}"
1640
+ )
1641
+
1642
+ self.start(worker_cmd, "inference_tracker_setup")
@@ -674,16 +674,16 @@ class Scaling:
674
674
  )
675
675
 
676
676
  @log_errors(log_error=True)
677
- def get_model_codebase_requirements(self, model_family_id):
677
+ def get_model_codebase_requirements(self, dockerId):
678
678
  """Get model codebase requirements.
679
679
 
680
680
  Args:
681
- model_family_id: ID of the model family
681
+ dockerId: ID of the docker
682
682
 
683
683
  Returns:
684
684
  Tuple of (data, error, message) from API response
685
685
  """
686
- path = f"/v1/model_store/get_user_requirements_download_path/{model_family_id}"
686
+ path = f"/v1/model_store/get_user_requirements_download_path/{dockerId}"
687
687
  resp = self.rpc.get(path=path)
688
688
  return self.handle_response(
689
689
  resp,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_compute
3
- Version: 0.1.16
3
+ Version: 0.1.18
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=ZzQcFsT005VCgq9VZUh565f4upOooEb_FwZ6RgweNZs,597
2
- matrice_compute/action_instance.py,sha256=cilzBD3o6K5CpDZEJCGMrNg0bCoUyOW3aCLNrMGyS10,60554
2
+ matrice_compute/action_instance.py,sha256=NYjcDLlJ2k47Cx7yhTkSY3U-Eog9dRx0unvv1ip5Pqo,62904
3
3
  matrice_compute/actions_manager.py,sha256=5U-xM6tl_Z6x96bi-c7AJM9ru80LqTN8f5Oce8dAu_A,7780
4
4
  matrice_compute/actions_scaledown_manager.py,sha256=pJ0nduNwHWZ10GnqJNx0Ok7cVWabQ_M8E2Vb9pH3A_k,2002
5
5
  matrice_compute/instance_manager.py,sha256=8USyX09ZxLvnVNIrjRogbyUeMCfgWnasuRqYkkVF4tQ,10146
@@ -7,11 +7,11 @@ matrice_compute/instance_utils.py,sha256=cANKRUlUzfecnzVEMC6Gkg9K7GZajH9ojNPiChd
7
7
  matrice_compute/prechecks.py,sha256=W9YmNF3RcLhOf4U8WBlExvFqDw1aGWSNTlJtA73lbDQ,17196
8
8
  matrice_compute/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  matrice_compute/resources_tracker.py,sha256=n57IJmT5GjNEX8yQL7nbKv57bjvESYM-vRQcQ0DgQXQ,19256
10
- matrice_compute/scaling.py,sha256=3F8SWvy9wWczpJ6dbY5RrXWw5ByZlIzAPJklir3KIFI,35359
10
+ matrice_compute/scaling.py,sha256=fAoXsDmMgtNjX-5gXB3KvaWeAi78rDDyRsG1GUmwykg,35332
11
11
  matrice_compute/shutdown_manager.py,sha256=0MYV_AqygqR9NEntYf7atUC-PbWXyNkm1f-8c2aizgA,13234
12
12
  matrice_compute/task_utils.py,sha256=3qIutiQdYPyGRxH9ZwLbqdg8sZcnp6jp08pszWCRFl0,2820
13
- matrice_compute-0.1.16.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
14
- matrice_compute-0.1.16.dist-info/METADATA,sha256=gTIsLb7gHIZCl4rvaQ5tKQW8b2OW2jfvLqyYxn_BMFo,1038
15
- matrice_compute-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- matrice_compute-0.1.16.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
17
- matrice_compute-0.1.16.dist-info/RECORD,,
13
+ matrice_compute-0.1.18.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
14
+ matrice_compute-0.1.18.dist-info/METADATA,sha256=NoeXPLhIa4x2IAUXphbVZXUF6u0YVgb-WVF1093ouDc,1038
15
+ matrice_compute-0.1.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ matrice_compute-0.1.18.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
17
+ matrice_compute-0.1.18.dist-info/RECORD,,