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,13 +30,15 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState> ...@@ -30,13 +30,15 @@ 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) {
const searchSpace = temp.description.parameters; if (temp.acc.default !== undefined) {
accSource.push({ const searchSpace = temp.description.parameters;
acc: temp.acc.default, accSource.push({
index: temp.sequenceId, acc: temp.acc.default,
searchSpace: JSON.stringify(searchSpace) index: temp.sequenceId,
}); searchSpace: JSON.stringify(searchSpace)
});
}
} }
}); });
const resultList: Array<number | string>[] = []; const resultList: Array<number | string>[] = [];
......
...@@ -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):
......
...@@ -113,8 +113,11 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None ...@@ -113,8 +113,11 @@ 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,15 +25,20 @@ import time ...@@ -25,15 +25,20 @@ 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')
pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True) pidList = pgrep_output.decode("utf-8").strip().split()
pidList = [] pidList.pop(0) # remove the key word 'ProcessId'
for pid in pgrep_output.splitlines(): pidList = list(map(int, pidList))
pidList.append(int(pid)) pidList.remove(os.getpid())
pidList.remove(os.getpid()) return len(pidList) == 0
return len(pidList) == 0 else:
pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pidList = []
for pid in pgrep_output.splitlines():
pidList.append(int(pid))
pidList.remove(os.getpid())
return len(pidList) == 0
def main(argv): def main(argv):
metrics_output_dir = os.environ['METRIC_OUTPUT_DIR'] metrics_output_dir = os.environ['METRIC_OUTPUT_DIR']
......
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