33
44import logging
55import os
6- import signal
76from logging import handlers
87from shlex import join
9- from subprocess import check_call as run_and_check_call
8+ from subprocess import check_call
109from subprocess import DEVNULL
1110from subprocess import Popen
1211from subprocess import run
3231# this is a hack to get around us not cleaning up / tracking Popen processes. We effectively ignore
3332# what they do. Note that since this LOC is at the top of this module, PioreactorUI also is affected by
3433# it. https://stackoverflow.com/questions/16807603/python-non-blocking-non-defunct-process and https://www.philipson.co.il/post/a-subprocess-bug-nah/
35- signal .signal (signal .SIGCHLD , signal .SIG_IGN )
34+ # signal.signal(signal.SIGCHLD, signal.SIG_IGN)
3635
3736logger = logging .getLogger ("huey.consumer" )
3837logger .setLevel (logging .INFO )
@@ -91,8 +90,7 @@ def pio_run(*args: str, env: dict[str, str] = {}) -> bool:
9190def add_new_pioreactor (new_pioreactor_name : str , version : str , model : str ) -> bool :
9291 command = [PIO_EXECUTABLE , "workers" , "add" , new_pioreactor_name , "-v" , version , "-m" , model ]
9392 logger .info (f"Executing `{ join (command )} `" )
94- result = run_and_check_call (command )
95- print (result )
93+ check_call (command )
9694 return True
9795
9896
@@ -101,7 +99,7 @@ def update_app_across_cluster() -> bool:
10199 # CPU heavy / IO heavy
102100 logger .info ("Updating app on leader" )
103101 update_app_on_leader = ["pio" , "update" , "app" ]
104- run_and_check_call (update_app_on_leader )
102+ check_call (update_app_on_leader )
105103
106104 logger .info ("Updating app and ui on workers" )
107105 update_app_across_all_workers = [PIOS_EXECUTABLE , "update" , "-y" ]
@@ -114,7 +112,7 @@ def update_app_from_release_archive_across_cluster(archive_location: str, units:
114112 if units == "$broadcast" :
115113 logger .info (f"Updating app on leader from { archive_location } " )
116114 update_app_on_leader = ["pio" , "update" , "app" , "--source" , archive_location ]
117- run_and_check_call (update_app_on_leader )
115+ check_call (update_app_on_leader )
118116 # remove bits if success
119117
120118 logger .info (f"Updating app and ui on workers from { archive_location } " )
0 commit comments