matrice-compute 0.1.15__py3-none-any.whl → 0.1.16__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.
@@ -1034,6 +1034,8 @@ def augmentation_server_creation_execute(
1034
1034
  def database_setup_execute(self: ActionInstance):
1035
1035
  """
1036
1036
  Creates and setup the database for facial recognition server.
1037
+ MongoDB runs on port 27020:27017 (localhost only with --net=host).
1038
+ Qdrant runs on port 6334 (localhost only with --net=host).
1037
1039
  """
1038
1040
  action_details = self.get_action_details()
1039
1041
  if not action_details:
@@ -1044,11 +1046,11 @@ def database_setup_execute(self: ActionInstance):
1044
1046
 
1045
1047
  project_id = action_details["_idProject"]
1046
1048
 
1047
- # Run docker compose up
1048
-
1049
+ # MongoDB container with --net=host (Port: 27020:27017)
1049
1050
  cmd = (
1050
- f"docker run --pull=always -p 27020:27017 "
1051
+ f"docker run --pull=always --net=host "
1051
1052
  f"--name mongodbdatabase "
1053
+ f"-v matrice_myvol:/matrice_data "
1052
1054
  f"-e ACTION_RECORD_ID={self.action_record_id} "
1053
1055
  f"-e MATRICE_ACCESS_KEY_ID={self.matrice_access_key_id} "
1054
1056
  f"-e MATRICE_SECRET_ACCESS_KEY={self.matrice_secret_access_key} "
@@ -1056,15 +1058,16 @@ def database_setup_execute(self: ActionInstance):
1056
1058
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1057
1059
  f"{image} "
1058
1060
  )
1059
- print("Docker command", cmd)
1061
+ logging.info("Starting MongoDB container (Port: 27020:27017): %s", cmd)
1060
1062
 
1063
+ # Qdrant container with --net=host (Port: 6334)
1061
1064
  qdrant_cmd = (
1062
- f"docker run --pull=always "
1065
+ f"docker run --pull=always --net=host "
1063
1066
  f"--name qdrant "
1064
- f"-p 6333:6333 "
1065
- f"-p 6334:6334 "
1067
+ f"-v matrice_myvol:/matrice_data "
1066
1068
  f"{'qdrant/qdrant:latest'} "
1067
1069
  )
1070
+ logging.info("Starting Qdrant container (Port: 6334): %s", qdrant_cmd)
1068
1071
 
1069
1072
  # Docker Command run
1070
1073
  self.start(cmd, "database_setup")
@@ -1075,7 +1078,8 @@ def database_setup_execute(self: ActionInstance):
1075
1078
  @log_errors(raise_exception=False)
1076
1079
  def facial_recognition_setup_execute(self: ActionInstance):
1077
1080
  """
1078
- Creates and setup the database for facial recognition server.
1081
+ Creates and setup the facial recognition worker server.
1082
+ Facial recognition worker runs on port 8081 (localhost only with --net=host).
1079
1083
  """
1080
1084
  action_details = self.get_action_details()
1081
1085
 
@@ -1085,18 +1089,18 @@ def facial_recognition_setup_execute(self: ActionInstance):
1085
1089
 
1086
1090
  self.setup_action_requirements(action_details)
1087
1091
 
1088
- # Add worker container run command
1092
+ # Facial recognition worker container with --net=host (Port: 8081)
1089
1093
  worker_cmd = (
1090
- f"docker run -d --pull=always "
1094
+ f"docker run -d --pull=always --net=host "
1091
1095
  f"--name worker "
1092
- f"-p 8081:8081 "
1096
+ f"-v matrice_myvol:/matrice_data "
1093
1097
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1094
1098
  f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1095
1099
  f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1096
1100
  f'-e ACTION_ID="{self.action_record_id}" '
1097
1101
  f"{image}"
1098
1102
  )
1099
- print("Worker docker run command:", worker_cmd)
1103
+ logging.info("Starting facial recognition worker (Port: 8081): %s", worker_cmd)
1100
1104
 
1101
1105
  # Docker Command run
1102
1106
  self.start(worker_cmd, "facial_recognition_setup")
@@ -1104,30 +1108,30 @@ def facial_recognition_setup_execute(self: ActionInstance):
1104
1108
  @log_errors(raise_exception=False)
1105
1109
  def lpr_setup_execute(self: ActionInstance):
1106
1110
  """
1107
- Creates and setup the database for license plate server.
1111
+ Creates and setup the license plate recognition server.
1112
+ LPR worker runs on port 8082 (localhost only with --net=host).
1108
1113
  """
1109
1114
  action_details = self.get_action_details()
1110
1115
 
1111
1116
  if not action_details:
1112
1117
  return
1113
1118
  image = self.docker_container
1114
- external_port = self.scaling.get_open_port()
1115
1119
 
1116
1120
  self.setup_action_requirements(action_details)
1117
1121
 
1118
- # Add worker container run command
1122
+ # LPR worker container with --net=host (Port: 8082)
1119
1123
  worker_cmd = (
1120
1124
  f"docker run -d --net=host --pull=always "
1121
1125
  f"--name lpr-worker "
1122
- f"-p {external_port}:8082 "
1126
+ f"-v matrice_myvol:/matrice_data "
1123
1127
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1124
1128
  f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1125
1129
  f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1126
1130
  f'-e ACTION_ID="{self.action_record_id}" '
1127
- f'-e PORT={external_port} '
1131
+ f'-e PORT=8082 '
1128
1132
  f"{image}"
1129
1133
  )
1130
- print("Worker docker run command:", worker_cmd)
1134
+ logging.info("Starting LPR worker (Port: 8082): %s", worker_cmd)
1131
1135
 
1132
1136
  # Docker Command run
1133
1137
  self.start(worker_cmd, "lpr_setup")
@@ -1169,7 +1173,7 @@ def inference_ws_server_execute(self: ActionInstance):
1169
1173
  def fe_fs_streaming_execute(self: ActionInstance):
1170
1174
  """
1171
1175
  Creates and setup the frontend for fs streaming.
1172
- Frontend streaming runs on port 3000 (localhost only with --net=host).
1176
+ Frontend streaming runs on port 3001 (localhost only with --net=host).
1173
1177
  """
1174
1178
  action_details = self.get_action_details()
1175
1179
 
@@ -1179,16 +1183,17 @@ def fe_fs_streaming_execute(self: ActionInstance):
1179
1183
 
1180
1184
  self.setup_action_requirements(action_details)
1181
1185
 
1182
- # Frontend streaming with --net=host (Port: 3000)
1186
+ # Frontend streaming with --net=host (Port: 3001)
1183
1187
  worker_cmd = (
1184
1188
  f"docker run -d --pull=always --net=host "
1185
1189
  f"--name fe_streaming "
1190
+ f"-v matrice_myvol:/matrice_data "
1186
1191
  f'-e ENV="{os.environ.get("ENV", "prod")}" '
1187
1192
  f'-e MATRICE_SECRET_ACCESS_KEY="{self.matrice_secret_access_key}" '
1188
1193
  f'-e MATRICE_ACCESS_KEY_ID="{self.matrice_access_key_id}" '
1189
1194
  f"{image}"
1190
1195
  )
1191
- logging.info("Starting frontend streaming (Port: 3000): %s", worker_cmd)
1196
+ logging.info("Starting frontend streaming (Port: 3001): %s", worker_cmd)
1192
1197
 
1193
1198
  # Docker Command run
1194
1199
  self.start(worker_cmd, "fe_fs_streaming")
@@ -1462,7 +1467,10 @@ def streaming_gateway_execute(self: ActionInstance):
1462
1467
 
1463
1468
  @log_errors(raise_exception=False)
1464
1469
  def kafka_setup_execute(self: ActionInstance):
1465
- """Execute kafka server task."""
1470
+ """
1471
+ Execute kafka server task.
1472
+ Kafka runs on port 9092 (SASL_PLAINTEXT) and 9093 (CONTROLLER) - localhost only with --net=host.
1473
+ """
1466
1474
  action_details = self.get_action_details()
1467
1475
  if not action_details:
1468
1476
  return
@@ -1470,7 +1478,6 @@ def kafka_setup_execute(self: ActionInstance):
1470
1478
  host_ip = (
1471
1479
  urllib.request.urlopen("https://ident.me", timeout=10).read().decode("utf8")
1472
1480
  )
1473
- container_port = 9092
1474
1481
  # Setup credentials
1475
1482
  self.setup_action_requirements(action_details)
1476
1483
 
@@ -1538,7 +1545,7 @@ def kafka_setup_execute(self: ActionInstance):
1538
1545
  [f"-e {key}={shlex.quote(str(value))}" for key, value in env_vars.items()]
1539
1546
  )
1540
1547
 
1541
- # Build the docker command directly to match user's pattern
1548
+ # Build the docker command with --net=host
1542
1549
  pypi_index = f"https://{'test.' if env != 'prod' else ''}pypi.org/simple/"
1543
1550
 
1544
1551
  if env == 'dev':
@@ -1547,8 +1554,9 @@ def kafka_setup_execute(self: ActionInstance):
1547
1554
  else:
1548
1555
  pkgs = f"matrice_common matrice"
1549
1556
 
1557
+ # Kafka container with --net=host (Ports: 9092, 9093)
1550
1558
  cmd = (
1551
- f"docker run -p {host_port}:{container_port} "
1559
+ f"docker run --net=host "
1552
1560
  f"{env_args} "
1553
1561
  f"--shm-size=30G --pull=always "
1554
1562
  f'aiforeveryone/matrice-kafka:latest /bin/bash -c "'
@@ -1561,5 +1569,5 @@ def kafka_setup_execute(self: ActionInstance):
1561
1569
  f'venv/bin/python3 main.py {self.action_record_id} {host_port}"'
1562
1570
  )
1563
1571
 
1564
- logging.info("cmd is: %s", cmd)
1572
+ logging.info("Starting Kafka container (Ports: 9092, 9093): %s", cmd)
1565
1573
  self.start(cmd, "kafka_setup")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_compute
3
- Version: 0.1.15
3
+ Version: 0.1.16
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=_EYTNmUDnKKMmiRX2WCjP_MC2o5kA1RYAvHVKhadnvk,59774
2
+ matrice_compute/action_instance.py,sha256=cilzBD3o6K5CpDZEJCGMrNg0bCoUyOW3aCLNrMGyS10,60554
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
@@ -10,8 +10,8 @@ matrice_compute/resources_tracker.py,sha256=n57IJmT5GjNEX8yQL7nbKv57bjvESYM-vRQc
10
10
  matrice_compute/scaling.py,sha256=3F8SWvy9wWczpJ6dbY5RrXWw5ByZlIzAPJklir3KIFI,35359
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.15.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
14
- matrice_compute-0.1.15.dist-info/METADATA,sha256=kHaPM9mLcbUZF0k3QxCRQ1jn1zuasO2l73S8yPlfPf0,1038
15
- matrice_compute-0.1.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- matrice_compute-0.1.15.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
17
- matrice_compute-0.1.15.dist-info/RECORD,,
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,,