truss 0.11.18__py3-none-any.whl → 0.11.18rc500__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.
@@ -5,6 +5,7 @@ from pathlib import Path
5
5
  from typing import List, Optional
6
6
 
7
7
  from helpers.context_managers import current_directory
8
+ from shared.util import kill_child_processes
8
9
 
9
10
  INFERENCE_SERVER_FAILED_FILE = Path("~/inference_server_crashed.txt").expanduser()
10
11
  TERMINATION_TIMEOUT_SECS = 120.0
@@ -46,17 +47,20 @@ class InferenceServerProcessController:
46
47
  self._inference_server_ever_started = True
47
48
  self._logged_unrecoverable_since_last_restart = False
48
49
 
50
+ def _terminate_children_and_process(self):
51
+ """Kill child processes first, then parent. Prevents port binding conflicts."""
52
+ kill_child_processes(self._inference_server_process.pid)
53
+ self._inference_server_process.terminate()
54
+
49
55
  def stop(self):
50
56
  if self._inference_server_process is not None:
51
- self._inference_server_process.terminate()
57
+ self._terminate_children_and_process()
52
58
  self._inference_server_process.wait()
53
- # Introduce delay to avoid failing to grab the port
54
- time.sleep(3)
55
59
 
56
60
  self._inference_server_started = False
57
61
 
58
62
  def terminate_with_wait(self):
59
- self._inference_server_process.terminate()
63
+ self._terminate_children_and_process()
60
64
  self._inference_server_terminated = True
61
65
  termination_check_attempts = int(
62
66
  TERMINATION_TIMEOUT_SECS / TERMINATION_CHECK_INTERVAL_SECS
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truss
3
- Version: 0.11.18
3
+ Version: 0.11.18rc500
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Project-URL: Repository, https://github.com/basetenlabs/truss
6
6
  Project-URL: Homepage, https://truss.baseten.co
@@ -81,7 +81,7 @@ truss/templates/control/control/helpers/context_managers.py,sha256=W6dyFgLBhPa5m
81
81
  truss/templates/control/control/helpers/custom_types.py,sha256=n_lTudtLTpy4oPV3aDdJ4X2rh3KCV5btYO9UnTeUouQ,5471
82
82
  truss/templates/control/control/helpers/errors.py,sha256=LddFuQywuCCdYTEnFT5EalxdWos4uR89rbhMakCy2bA,970
83
83
  truss/templates/control/control/helpers/inference_server_controller.py,sha256=anFm7FwkGaUnYRQo2dxXohA9__c-XAVAqfA1EL2bIIY,6324
84
- truss/templates/control/control/helpers/inference_server_process_controller.py,sha256=2So-3FhBr7OE61ShS-dYrDiEqQ-h4JU6EbWdIxL4Yks,4227
84
+ truss/templates/control/control/helpers/inference_server_process_controller.py,sha256=8jhAWsUjG2JQ3elJA6ldCPJ8deo0vOLoD3rI8eKwkvk,4426
85
85
  truss/templates/control/control/helpers/inference_server_starter.py,sha256=Fz2Puijro6Cc5cvTsAqOveNJbBQR_ARYJXl4lvETJ8Y,2633
86
86
  truss/templates/control/control/helpers/truss_patch/__init__.py,sha256=CXZdUV_ylqLTJrKuFpvSnUT6PUFrZrMF2y6jiHbdaKU,998
87
87
  truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py,sha256=LTIIADLz0wRn7V49j64dU1U7Hbta9YLde3pb5YZWvzQ,2001
@@ -374,8 +374,8 @@ truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,307
374
374
  truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
375
375
  truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
376
376
  truss_train/restore_from_checkpoint.py,sha256=8hdPm-WSgkt74HDPjvCjZMBpvA9MwtoYsxVjOoa7BaM,1176
377
- truss-0.11.18.dist-info/METADATA,sha256=vlaTGYYSaK0iMt1NvmUEuF6uhy-hygDj2MLDbQQpJO0,6678
378
- truss-0.11.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
379
- truss-0.11.18.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
380
- truss-0.11.18.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
381
- truss-0.11.18.dist-info/RECORD,,
377
+ truss-0.11.18rc500.dist-info/METADATA,sha256=o9mIIX2iDFH8mEVD39WocUjQofwSiLA6t8IM0vVBHFI,6683
378
+ truss-0.11.18rc500.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
379
+ truss-0.11.18rc500.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
380
+ truss-0.11.18rc500.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
381
+ truss-0.11.18rc500.dist-info/RECORD,,