from ansi import bg, fg, underline, reset
import argparse_utils
import config
-import exec_utils
+from exec_utils import run_silently, cmd_in_background
from decorator_utils import singleton
import histogram
-import string_utils
logger = logging.getLogger(__name__)
if hostname not in machine:
cmd = f'{RSYNC} {bundle.code_file} {username}@{machine}:{bundle.code_file}'
logger.info(f"Copying work to {worker} via {cmd}")
- exec_utils.run_silently(cmd)
+ run_silently(cmd)
# Do it.
cmd = (f'{SSH} {bundle.username}@{bundle.machine} '
f'"source remote-execution/bin/activate &&'
f' /home/scott/lib/python_modules/remote_worker.py'
f' --code_file {bundle.code_file} --result_file {bundle.result_file}"')
- p = exec_utils.cmd_in_background(cmd, silent=True)
+ p = cmd_in_background(cmd, silent=True)
bundle.pid = pid = p.pid
logger.info(f"Running {cmd} in the background as process {pid}")
f"Fetching results from {username}@{machine} via {cmd}"
)
try:
- exec_utils.run_silently(cmd)
+ run_silently(cmd)
except subprocess.CalledProcessError:
pass
- exec_utils.run_silently(f'{SSH} {username}@{machine}'
- f' "/bin/rm -f {code_file} {result_file}"')
+ run_silently(f'{SSH} {username}@{machine}'
+ f' "/bin/rm -f {code_file} {result_file}"')
bundle.end_ts = time.time()
assert bundle.worker is not None
self.status.record_release_worker_already_locked(
return result
def create_original_bundle(self, pickle):
- uuid = string_utils.generate_uuid(as_hex=True)
+ from string_utils import generate_uuid
+ uuid = generate_uuid(as_hex=True)
code_file = f'/tmp/{uuid}.code.bin'
result_file = f'/tmp/{uuid}.result.bin'