Skip to content

Commit

Permalink
loggedilog
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-merzky committed May 27, 2024
1 parent 52964c6 commit 4d84ffb
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 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']

selg._log.debug('=== flux command', cmd)

flux_proc = sp.Popen(cmd, encoding="utf-8",
stdin=sp.DEVNULL, stdout=sp.PIPE, stderr=sp.PIPE)
Expand All @@ -162,11 +165,17 @@ def _locked_start_service(self,
if not line:
continue

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

if line.startswith('HOST:'):

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

if line.startswith('URI:'):
flux_uri = line.split(':', 1)[1].strip()
flux_env['FLUX_URI'] = flux_uri
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

selg._log.debug('=== flux uri', flux_uri)

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

# start watcher thread to monitor the instance
Expand Down

0 comments on commit 4d84ffb

Please sign in to comment.