Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/flux remote #408

Merged
merged 3 commits into from
May 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/radical/utils/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def _locked_start_service(self,
if launcher:
cmd += shlex.split(launcher)

cmd += ['flux', 'start', 'bash', '-c', 'echo URI:$FLUX_URI && sleep inf']
cmd += ['flux', 'start', 'bash', '-c',
'echo "HOST:$(hostname) URI:$FLUX_URI" && sleep inf']

self._log.debug('flux command', cmd)
mtitov marked this conversation as resolved.
Show resolved Hide resolved

flux_proc = sp.Popen(cmd, encoding="utf-8",
stdin=sp.DEVNULL, stdout=sp.PIPE, stderr=sp.PIPE)
Expand All @@ -164,9 +167,15 @@ def _locked_start_service(self,

self._log.debug('flux output: %s', line)

if line.startswith('URI:'):
flux_uri = line.split(':', 1)[1].strip()
flux_env['FLUX_URI'] = flux_uri
if line.startswith('HOST:'):

flux_host, flux_uri = line.split(' ', 1)

flux_host = flux_host.split(':', 1)[1].strip()
flux_uri = flux_uri.split(':', 1)[1].strip()

flux_env['FLUX_HOST'] = flux_host
flux_env['FLUX_URI'] = flux_uri
break

if flux_proc.poll() is not None:
Expand All @@ -181,7 +190,7 @@ def _locked_start_service(self,
# make sure that the flux url can be reached from other hosts
# FIXME: this also routes local access via ssh which may slow comm
flux_url = Url(flux_env['FLUX_URI'])
flux_url.host = get_hostname()
flux_url.host = flux_env['FLUX_HOST']
flux_url.schema = 'ssh'
flux_uri = str(flux_url)
flux_env['FLUX_URI'] = flux_uri
Expand All @@ -190,6 +199,8 @@ def _locked_start_service(self,
self._env = flux_env
self._proc = flux_proc

self._log.debug('flux uri', flux_uri)
mtitov marked this conversation as resolved.
Show resolved Hide resolved

self._prof.prof('flux_started', msg=self._uid)

# start watcher thread to monitor the instance
Expand Down
Loading