import string_utils
from ansi import bg, fg, reset, underline
from decorator_utils import singleton
-from exec_utils import cmd_in_background, cmd_with_timeout, run_silently
+from exec_utils import cmd_exitcode, cmd_in_background, run_silently
from thread_utils import background_thread
logger = logging.getLogger(__name__)
workers = max_workers
elif 'executors_threadpool_size' in config.config:
workers = config.config['executors_threadpool_size']
- logger.debug('Creating threadpool executor with %d workers', workers)
+ if workers is not None:
+ logger.debug('Creating threadpool executor with %d workers', workers)
+ else:
+ logger.debug('Creating a default sized threadpool executor')
self._thread_pool_executor = fut.ThreadPoolExecutor(
max_workers=workers, thread_name_prefix="thread_executor_helper"
)
workers = max_workers
elif 'executors_processpool_size' in config.config:
workers = config.config['executors_processpool_size']
- logger.debug('Creating processpool executor with %d workers.', workers)
+ if workers is not None:
+ logger.debug('Creating processpool executor with %d workers.', workers)
+ else:
+ logger.debug('Creating a default sized processpool executor')
self._process_executor = fut.ProcessPoolExecutor(
max_workers=workers,
)
self.status.record_processing_began(uuid)
cmd = (
f'{SSH} {bundle.username}@{bundle.machine} '
- f'"source py38-venv/bin/activate &&'
+ f'"source py39-venv/bin/activate &&'
f' /home/scott/lib/python_modules/remote_worker.py'
f' --code_file {bundle.code_file} --result_file {bundle.result_file}"'
)
def _ping(host) -> bool:
logger.debug('RUN> ping -c 1 %s', host)
try:
- x = cmd_with_timeout(f'ping -c 1 {host} >/dev/null 2>/dev/null', timeout_seconds=1.0)
+ x = cmd_exitcode(f'ping -c 1 {host} >/dev/null 2>/dev/null', timeout_seconds=1.0)
return x == 0
except Exception:
return False