matrice-compute 0.1.21__py3-none-any.whl → 0.1.22__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.
@@ -677,7 +677,7 @@ class Scaling:
677
677
 
678
678
  @log_errors(log_error=True)
679
679
  def assign_jobs(self, is_gpu):
680
- """Assign jobs to the instance using Kafka (with REST fallback).
680
+ """Assign jobs to the instance using REST API.
681
681
 
682
682
  Args:
683
683
  is_gpu: Boolean or any value indicating if this is a GPU instance.
@@ -690,30 +690,41 @@ class Scaling:
690
690
  is_gpu_bool = bool(is_gpu)
691
691
  logging.info("Assigning jobs for instance %s (GPU: %s)", self.instance_id, is_gpu_bool)
692
692
 
693
- payload = {
694
- "instanceID": self.instance_id,
695
- "isGPUInstance": is_gpu_bool,
696
- }
697
-
698
- # Define REST fallback function
699
- def rest_fallback():
700
- is_gpu_str = str(is_gpu_bool).lower()
701
- path = f"/v1/actions/assign_jobs/{is_gpu_str}/{self.instance_id}"
702
- resp = self.rpc.get(path=path)
703
- return self.handle_response(
704
- resp,
705
- "Pinged successfully",
706
- "Could not ping the scaling jobs",
707
- )
708
-
709
- # Use hybrid approach: Kafka first, REST fallback, cache if both fail
710
- return self._hybrid_request(
711
- api="assign_jobs",
712
- payload=payload,
713
- request_topic=self.kafka_config["action_request_topic"] if self.enable_kafka else None,
714
- response_topic=self.kafka_config["action_response_topic"] if self.enable_kafka else None,
715
- rest_fallback_func=rest_fallback
693
+ # Use REST API directly
694
+ is_gpu_str = str(is_gpu_bool).lower()
695
+ path = f"/v1/actions/assign_jobs/{is_gpu_str}/{self.instance_id}"
696
+ resp = self.rpc.get(path=path)
697
+ return self.handle_response(
698
+ resp,
699
+ "Pinged successfully",
700
+ "Could not ping the scaling jobs",
716
701
  )
702
+
703
+ # # Kafka approach (commented out - using REST only)
704
+ # payload = {
705
+ # "instanceID": self.instance_id,
706
+ # "isGPUInstance": is_gpu_bool,
707
+ # }
708
+ #
709
+ # # Define REST fallback function
710
+ # def rest_fallback():
711
+ # is_gpu_str = str(is_gpu_bool).lower()
712
+ # path = f"/v1/actions/assign_jobs/{is_gpu_str}/{self.instance_id}"
713
+ # resp = self.rpc.get(path=path)
714
+ # return self.handle_response(
715
+ # resp,
716
+ # "Pinged successfully",
717
+ # "Could not ping the scaling jobs",
718
+ # )
719
+ #
720
+ # # Use hybrid approach: Kafka first, REST fallback, cache if both fail
721
+ # return self._hybrid_request(
722
+ # api="assign_jobs",
723
+ # payload=payload,
724
+ # request_topic=self.kafka_config["action_request_topic"] if self.enable_kafka else None,
725
+ # response_topic=self.kafka_config["action_response_topic"] if self.enable_kafka else None,
726
+ # rest_fallback_func=rest_fallback
727
+ # )
717
728
 
718
729
 
719
730
  @log_errors(log_error=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_compute
3
- Version: 0.1.21
3
+ Version: 0.1.22
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -7,11 +7,11 @@ matrice_compute/instance_utils.py,sha256=tCI_A3L5iohw62acmlXuOJns0DjIkvwN4znlUAI
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=pkdt0aVKx_TpY_Sq---73w9INkDffZZe3mZGlp1EftE,22573
10
- matrice_compute/scaling.py,sha256=RBqfhButiocWueu-OeUbo8KquYs3BpYi2GiksFM9H10,45998
10
+ matrice_compute/scaling.py,sha256=VMRhUYqPtYPWPd3Qt0PtHnYw04EIPokhYMEnQHzYbXE,46444
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.21.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
14
- matrice_compute-0.1.21.dist-info/METADATA,sha256=_2gHnRw1cg9bwDjtSJ2_Dkb7XzTfrrQyvMWdFNB1RE8,1038
15
- matrice_compute-0.1.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- matrice_compute-0.1.21.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
17
- matrice_compute-0.1.21.dist-info/RECORD,,
13
+ matrice_compute-0.1.22.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
14
+ matrice_compute-0.1.22.dist-info/METADATA,sha256=A3T2jtGU5YaQaYqa-5d33c8vFDNoLNUsxMLftZ7qIT4,1038
15
+ matrice_compute-0.1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ matrice_compute-0.1.22.dist-info/top_level.txt,sha256=63Plr3L1GzBUWZO5JZaFkiv8IcB10xUPU-9w3i6ptvE,16
17
+ matrice_compute-0.1.22.dist-info/RECORD,,