matrice-compute 0.1.21__tar.gz → 0.1.22__tar.gz
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-0.1.21 → matrice_compute-0.1.22}/PKG-INFO +1 -1
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/PKG-INFO +1 -1
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/scaling.py +35 -24
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/LICENSE.txt +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/README.md +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/SOURCES.txt +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/dependency_links.txt +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/not-zip-safe +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/top_level.txt +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/pyproject.toml +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/setup.cfg +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/setup.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/__init__.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/action_instance.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/actions_manager.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/actions_scaledown_manager.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/instance_manager.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/instance_utils.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/prechecks.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/py.typed +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/resources_tracker.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/shutdown_manager.py +0 -0
- {matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/task_utils.py +0 -0
|
@@ -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
|
|
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
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matrice_compute-0.1.21 → matrice_compute-0.1.22}/matrice_compute.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matrice_compute-0.1.21 → matrice_compute-0.1.22}/src/matrice_compute/actions_scaledown_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|