Skip to content

Commit

Permalink
set up unique remote port number as the default
Browse files Browse the repository at this point in the history
  • Loading branch information
kchilleri committed Feb 10, 2025
1 parent 3600fd8 commit ddff2a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion beeflow/common/config_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ def filepath_completion_input(*pargs, **kwargs):
return input(*pargs, **kwargs)


def unique_port():
"""Assign unique port for remote user."""
uid = os.getuid()
port = ((uid%(16000-7777))+7777)
return port


# Below is the definition of all bee config options, defaults and requirements.
# This will be used to validate config files on loading them in the BeeConfig
# singleton class above.
Expand Down Expand Up @@ -256,7 +263,7 @@ def filepath_completion_input(*pargs, **kwargs):
default=False, validator=validation.bool_, prompt=False)

VALIDATOR.option('DEFAULT', 'remote_api_port', info='BEE remote REST API port',
default=7777, validator=int, prompt=False)
default=unique_port(), validator=int, prompt=False)

VALIDATOR.option('DEFAULT', 'workload_scheduler', choices=('Slurm', 'LSF', 'Flux', 'Simple'),
default='Slurm', info='backend workload scheduler to interact with ',
Expand Down

0 comments on commit ddff2a4

Please sign in to comment.