Unverified Commit 1256eb63 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Create soft link "_latest" in nni-experiments (#4476)

parent 763f2c87
......@@ -110,8 +110,6 @@ def start_experiment(action, exp_id, config, port, debug, run_mode, url_prefix):
_logger.info('Setting up...')
rest.post(port, '/experiment', config.json(), url_prefix)
return proc
except Exception as e:
_logger.error('Create experiment failed')
if proc is not None:
......@@ -119,6 +117,16 @@ def start_experiment(action, exp_id, config, port, debug, run_mode, url_prefix):
proc.kill()
raise e
link = Path(config.experiment_working_directory, '_latest')
try:
link.unlink(missing_ok=True)
link.symlink_to(exp_id, target_is_directory=True)
except Exception:
if sys.platform != 'win32':
_logger.warning(f'Failed to create link {link}')
return proc
def _start_rest_server(nni_manager_args, run_mode) -> Tuple[int, Popen]:
node_dir = Path(nni_node.__path__[0])
node = str(node_dir / ('node.exe' if sys.platform == 'win32' else 'node'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment