From ddff2a438c2a8551d50f848ce01a6c12a304949e Mon Sep 17 00:00:00 2001 From: Krishna Chilleri Date: Mon, 10 Feb 2025 11:03:24 -0700 Subject: [PATCH 1/3] set up unique remote port number as the default --- beeflow/common/config_driver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/beeflow/common/config_driver.py b/beeflow/common/config_driver.py index 554bcfd1..3bacdf26 100644 --- a/beeflow/common/config_driver.py +++ b/beeflow/common/config_driver.py @@ -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. @@ -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 ', From 304ffce4867c75316baae7a95338b4053ecaa4f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Feb 2025 18:21:37 +0000 Subject: [PATCH 2/3] Updated coverage.svg --- coverage.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coverage.svg b/coverage.svg index 6d24dca8..1618ede7 100644 --- a/coverage.svg +++ b/coverage.svg @@ -15,7 +15,7 @@ coverage coverage - 73% - 73% + 74% + 74% From 889da0501d7f2248d08520e600196801e1903259 Mon Sep 17 00:00:00 2001 From: Krishna Chilleri Date: Mon, 10 Feb 2025 11:40:39 -0700 Subject: [PATCH 3/3] remove comment about default remote port number being 7777 --- beeflow/remote/remote.py | 1 - 1 file changed, 1 deletion(-) diff --git a/beeflow/remote/remote.py b/beeflow/remote/remote.py index 70cc6cf0..98ed6087 100644 --- a/beeflow/remote/remote.py +++ b/beeflow/remote/remote.py @@ -137,7 +137,6 @@ def find_free_port(start_port=1024, end_port=65535, host='127.0.0.1'): def create_app(): """Start the web-server for the API with uvicorn.""" - # decide what port we're using for the long term. I set it to port 7777 temporarily port_number = bc.get('DEFAULT', 'remote_api_port') if is_port_taken(port_number) is True: