From b910c7d63de07db50b037ec0a31345ba8a4d08e9 Mon Sep 17 00:00:00 2001 From: Krishna Chilleri Date: Fri, 11 Oct 2024 15:15:21 -0600 Subject: [PATCH] allow beeflow to run on back end node + documentation --- beeflow/client/core.py | 15 ++++++++++----- docs/sphinx/commands.rst | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/beeflow/client/core.py b/beeflow/client/core.py index 49fd7cdd..a468b3cc 100644 --- a/beeflow/client/core.py +++ b/beeflow/client/core.py @@ -296,14 +296,15 @@ def load_check_charliecloud(): sys.exit(1) -def check_dependencies(): +def check_dependencies(backend=False): """Check for various dependencies in the environment.""" - print('Checking dependencies...') # Check if running on compute node under Slurm scheduler - if os.environ.get('SLURM_JOB_NODELIST') is not None: + if not backend and os.environ.get('SLURM_JOB_NODELIST') is not None: warn('Slurm job node detected! Beeflow should not be run on a compute node.') warn(f'SLURM_JOB_NODELIST = {os.environ.get("SLURM_JOB_NODELIST")}') sys.exit(1) + + print('Checking dependencies...') # Check for Charliecloud and its version load_check_charliecloud() # Check for the flux API @@ -385,9 +386,13 @@ def handle_terminate(signum, stack): # noqa @app.command() def start(foreground: bool = typer.Option(False, '--foreground', '-F', - help='run in the foreground')): + help='run in the foreground'), backend: bool = typer.Option(False, '--backend', + '-B', help='allow to run on a backend node')): """Start all BEE components.""" - check_dependencies() + if backend: # allow beeflow to run on backend node + check_dependencies(backend=True) + else: + check_dependencies() mgr = init_components() beeflow_log = paths.log_fname('beeflow') sock_path = paths.beeflow_socket() diff --git a/docs/sphinx/commands.rst b/docs/sphinx/commands.rst index 7b44db5a..a51822da 100644 --- a/docs/sphinx/commands.rst +++ b/docs/sphinx/commands.rst @@ -14,6 +14,7 @@ To interact with the daemon process you'll need to use the ``beeflow core`` sub- Options: -F, --foreground run in the foreground [default: False] + -B, --backend run on a back end node [default: False] ``beeflow core status``: Check the status of beeflow and the components.