Skip to content

Commit

Permalink
Add flag to allow beeflow to run on back end node (#947)
Browse files Browse the repository at this point in the history
The --backend flag has been added for CI testing purposes and should be avoided by the user. They should run beeflow on the front-end.
  • Loading branch information
kchilleri authored Oct 14, 2024
1 parent 018e351 commit 41548d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions beeflow/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ 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
Expand Down Expand Up @@ -385,9 +385,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()
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 41548d0

Please sign in to comment.