Unverified Commit c7cc8db3 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Merge pull request #1030 from Microsoft/v0.7

V0.7 merge back to master
parents 71e8ced7 1680f2e5
...@@ -77,6 +77,8 @@ class MsgDispatcherBase(Recoverable): ...@@ -77,6 +77,8 @@ class MsgDispatcherBase(Recoverable):
break break
else: else:
self.enqueue_command(command, data) self.enqueue_command(command, data)
if self.worker_exceptions:
break
_logger.info('Dispatcher exiting...') _logger.info('Dispatcher exiting...')
self.stopping = True self.stopping = True
......
...@@ -30,7 +30,8 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState> ...@@ -30,7 +30,8 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
const accSource: Array<DetailAccurPoint> = []; const accSource: Array<DetailAccurPoint> = [];
Object.keys(showSource).map(item => { Object.keys(showSource).map(item => {
const temp = showSource[item]; const temp = showSource[item];
if (temp.status === 'SUCCEEDED' && temp.acc.default !== undefined) { if (temp.status === 'SUCCEEDED' && temp.acc !== undefined) {
if (temp.acc.default !== undefined) {
const searchSpace = temp.description.parameters; const searchSpace = temp.description.parameters;
accSource.push({ accSource.push({
acc: temp.acc.default, acc: temp.acc.default,
...@@ -38,6 +39,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState> ...@@ -38,6 +39,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
searchSpace: JSON.stringify(searchSpace) searchSpace: JSON.stringify(searchSpace)
}); });
} }
}
}); });
const resultList: Array<number | string>[] = []; const resultList: Array<number | string>[] = [];
Object.keys(accSource).map(item => { Object.keys(accSource).map(item => {
......
...@@ -32,9 +32,12 @@ def get_yml_content(file_path): ...@@ -32,9 +32,12 @@ def get_yml_content(file_path):
try: try:
with open(file_path, 'r') as file: with open(file_path, 'r') as file:
return yaml.load(file, Loader=yaml.Loader) return yaml.load(file, Loader=yaml.Loader)
except TypeError as err: except yaml.scanner.ScannerError as err:
print('Error: ', err) print_error('yaml file format error!')
return None exit(1)
except Exception as exception:
print_error(exception)
exit(1)
def get_json_content(file_path): def get_json_content(file_path):
'''Load json file content''' '''Load json file content'''
...@@ -42,7 +45,7 @@ def get_json_content(file_path): ...@@ -42,7 +45,7 @@ def get_json_content(file_path):
with open(file_path, 'r') as file: with open(file_path, 'r') as file:
return json.load(file) return json.load(file)
except TypeError as err: except TypeError as err:
print('Error: ', err) print_error('json file format error!')
return None return None
def print_error(content): def print_error(content):
......
...@@ -114,7 +114,10 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None ...@@ -114,7 +114,10 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
entry_dir = get_nni_installation_path() entry_dir = get_nni_installation_path()
entry_file = os.path.join(entry_dir, 'main.js') entry_file = os.path.join(entry_dir, 'main.js')
cmds = ['node', entry_file, '--port', str(port), '--mode', platform, '--start_mode', mode] node_command = 'node'
if sys.platform == 'win32':
node_command = os.path.join(entry_dir[:-3], 'Scripts', 'node.exe')
cmds = [node_command, entry_file, '--port', str(port), '--mode', platform, '--start_mode', mode]
if log_dir is not None: if log_dir is not None:
cmds += ['--log_dir', log_dir] cmds += ['--log_dir', log_dir]
if log_level is not None: if log_level is not None:
......
...@@ -136,7 +136,7 @@ def import_data(args): ...@@ -136,7 +136,7 @@ def import_data(args):
args.port = get_experiment_port(args) args.port = get_experiment_port(args)
if args.port is not None: if args.port is not None:
if import_data_to_restful_server(args, content): if import_data_to_restful_server(args, content):
print_normal('Import data success!') pass
else: else:
print_error('Import data failed!') print_error('Import data failed!')
......
...@@ -25,9 +25,14 @@ import time ...@@ -25,9 +25,14 @@ import time
from xml.dom import minidom from xml.dom import minidom
def check_ready_to_run(): def check_ready_to_run():
#TODO check process in windows
if sys.platform == 'win32': if sys.platform == 'win32':
return True pgrep_output = subprocess.check_output('wmic process where "CommandLine like \'%nni_gpu_tool.gpu_metrics_collector%\' and name like \'%python%\'" get processId')
pidList = pgrep_output.decode("utf-8").strip().split()
pidList.pop(0) # remove the key word 'ProcessId'
pidList = list(map(int, pidList))
pidList.remove(os.getpid())
return len(pidList) == 0
else:
pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True) pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pidList = [] pidList = []
for pid in pgrep_output.splitlines(): for pid in pgrep_output.splitlines():
......
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