Unverified Commit 5b0034e4 authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Merge pull request #204 from microsoft/master

merge master
parents 704b50e2 19173aa4
...@@ -98,7 +98,7 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> { ...@@ -98,7 +98,7 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
For the entire parameter set, please refer to the following " For the entire parameter set, please refer to the following "
<a href={trialink} target="_blank">{trialink}</a>". <a href={trialink} target="_blank">{trialink}</a>".
<br/> <br/>
Current Phase: {record.description.progress}. Current Phase: {record.description.multiProgress}.
</Row> </Row>
: :
<div /> <div />
......
...@@ -275,7 +275,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState> ...@@ -275,7 +275,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
<div> <div>
<div className="default-metric"> <div className="default-metric">
<div className="position"> <div className="position">
<span className="bold">optimization curve</span> <span className="bold">Optimization curve</span>
<Switch defaultChecked={false} onChange={this.loadDefault} /> <Switch defaultChecked={false} onChange={this.loadDefault} />
</div> </div>
</div> </div>
......
...@@ -292,7 +292,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -292,7 +292,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
isFilter isFilter
? ?
<span> <span>
<span className="filter-x"># Intermeidate</span> <span className="filter-x"># Intermediate</span>
<input <input
// placeholder="point" // placeholder="point"
ref={input => this.pointInput = input} ref={input => this.pointInput = input}
...@@ -321,7 +321,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -321,7 +321,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
null null
} }
</Row> </Row>
<Row className="intermeidate-graph"> <Row className="intermediate-graph">
<ReactEcharts <ReactEcharts
option={interSource} option={interSource}
style={{ width: '100%', height: 418, margin: '0 auto' }} style={{ width: '100%', height: 418, margin: '0 auto' }}
......
...@@ -237,7 +237,8 @@ class Para extends React.Component<ParaProps, ParaState> { ...@@ -237,7 +237,8 @@ class Para extends React.Component<ParaProps, ParaState> {
show: true show: true
}, },
axisLabel: { axisLabel: {
formatter: function (value: string) { formatter: function (value?: string) {
if (value !== undefined) {
const length = value.length; const length = value.length;
if (length > 16) { if (length > 16) {
const temp = value.split(''); const temp = value.split('');
...@@ -248,6 +249,9 @@ class Para extends React.Component<ParaProps, ParaState> { ...@@ -248,6 +249,9 @@ class Para extends React.Component<ParaProps, ParaState> {
} else { } else {
return value; return value;
} }
} else {
return null;
}
} }
}, },
} }
......
...@@ -4,7 +4,7 @@ import ReactEcharts from 'echarts-for-react'; ...@@ -4,7 +4,7 @@ import ReactEcharts from 'echarts-for-react';
import { Row, Table, Button, Popconfirm, Modal, Checkbox, Select, Icon } from 'antd'; import { Row, Table, Button, Popconfirm, Modal, Checkbox, Select, Icon } from 'antd';
const Option = Select.Option; const Option = Select.Option;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
import { MANAGER_IP, trialJobStatus, COLUMN, COLUMN_INDEX, COLUMNPro } from '../../static/const'; import { MANAGER_IP, trialJobStatus, COLUMN_INDEX, COLUMNPro } from '../../static/const';
import { convertDuration, intermediateGraphOption, killJob, filterByStatus } from '../../static/function'; import { convertDuration, intermediateGraphOption, killJob, filterByStatus } from '../../static/function';
import { TableObj, TrialJob } from '../../static/interface'; import { TableObj, TrialJob } from '../../static/interface';
import OpenRow from '../public-child/OpenRow'; import OpenRow from '../public-child/OpenRow';
...@@ -32,6 +32,8 @@ interface TableListProps { ...@@ -32,6 +32,8 @@ interface TableListProps {
platform: string; platform: string;
logCollection: boolean; logCollection: boolean;
isMultiPhase: boolean; isMultiPhase: boolean;
columnList: Array<string>; // user select columnKeys
changeColumn: (val: Array<string>) => void;
} }
interface TableListState { interface TableListState {
...@@ -39,7 +41,6 @@ interface TableListState { ...@@ -39,7 +41,6 @@ interface TableListState {
modalVisible: boolean; modalVisible: boolean;
isObjFinal: boolean; isObjFinal: boolean;
isShowColumn: boolean; isShowColumn: boolean;
columnSelected: Array<string>; // user select columnKeys
selectRows: Array<TableObj>; selectRows: Array<TableObj>;
isShowCompareModal: boolean; isShowCompareModal: boolean;
selectedRowKeys: string[] | number[]; selectedRowKeys: string[] | number[];
...@@ -69,7 +70,6 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -69,7 +70,6 @@ class TableList extends React.Component<TableListProps, TableListState> {
isObjFinal: false, isObjFinal: false,
isShowColumn: false, isShowColumn: false,
isShowCompareModal: false, isShowCompareModal: false,
columnSelected: COLUMN,
selectRows: [], selectRows: [],
selectedRowKeys: [], // close selected trial message after modal closed selectedRowKeys: [], // close selected trial message after modal closed
intermediateData: [], intermediateData: [],
...@@ -120,6 +120,8 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -120,6 +120,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
} }
} }
// intermediate button click -> intermediate graph for each trial
// support intermediate is dict
selectOtherKeys = (value: string) => { selectOtherKeys = (value: string) => {
const isShowDefault: boolean = value === 'default' ? true : false; const isShowDefault: boolean = value === 'default' ? true : false;
...@@ -193,7 +195,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -193,7 +195,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
case 'Status': case 'Status':
case 'Operation': case 'Operation':
case 'Default': case 'Default':
case 'Intermeidate count': case 'Intermediate count':
break; break;
default: default:
finalKeys.push(checkedValues[m]); finalKeys.push(checkedValues[m]);
...@@ -226,7 +228,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -226,7 +228,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
}); });
if (this._isMounted) { if (this._isMounted) {
this.setState(() => ({ columnSelected: wantResult })); this.props.changeColumn(wantResult);
} }
} }
...@@ -277,8 +279,8 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -277,8 +279,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
render() { render() {
const { entries, tableSource, updateList } = this.props; const { entries, tableSource, updateList, columnList } = this.props;
const { intermediateOption, modalVisible, isShowColumn, columnSelected, const { intermediateOption, modalVisible, isShowColumn,
selectRows, isShowCompareModal, selectedRowKeys, intermediateOtherKeys } = this.state; selectRows, isShowCompareModal, selectedRowKeys, intermediateOtherKeys } = this.state;
const rowSelection = { const rowSelection = {
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
...@@ -316,8 +318,8 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -316,8 +318,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
value: item value: item
}); });
}); });
Object.keys(columnSelected).map(key => { Object.keys(columnList).map(key => {
const item = columnSelected[key]; const item = columnList[key];
switch (item) { switch (item) {
case 'Trial No.': case 'Trial No.':
showColumn.push({ showColumn.push({
...@@ -392,7 +394,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -392,7 +394,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
sorter: (a: TableObj, b: TableObj): number => a.status.localeCompare(b.status) sorter: (a: TableObj, b: TableObj): number => a.status.localeCompare(b.status)
}); });
break; break;
case 'Intermeidate count': case 'Intermediate count':
showColumn.push({ showColumn.push({
title: 'Intermediate count', title: 'Intermediate count',
dataIndex: 'progress', dataIndex: 'progress',
...@@ -413,13 +415,12 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -413,13 +415,12 @@ class TableList extends React.Component<TableListProps, TableListState> {
key: 'acc', key: 'acc',
width: 120, width: 120,
sorter: (a: TableObj, b: TableObj) => { sorter: (a: TableObj, b: TableObj) => {
const aa = a.description.intermediate; const oneArr = a.description.intermediate;
const bb = b.description.intermediate; const otherArr = b.description.intermediate;
if (aa !== undefined && bb !== undefined) { const one = (oneArr[oneArr.length - 1] !== undefined) ? oneArr[oneArr.length - 1] : 0;
return aa[aa.length - 1] - bb[bb.length - 1]; const other = (otherArr[otherArr.length - 1] !== undefined)
} else { ? otherArr[otherArr.length - 1] : 0;
return NaN; return one - other;
}
}, },
render: (text: string, record: TableObj) => { render: (text: string, record: TableObj) => {
return ( return (
...@@ -581,7 +582,8 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -581,7 +582,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
> >
<CheckboxGroup <CheckboxGroup
options={showTitle} options={showTitle}
defaultValue={columnSelected} defaultValue={columnList}
// defaultValue={columnSelected}
onChange={this.selectedColumn} onChange={this.selectedColumn}
className="titleColumn" className="titleColumn"
/> />
......
...@@ -9,13 +9,15 @@ import TrialsDetail from './components/TrialsDetail'; ...@@ -9,13 +9,15 @@ import TrialsDetail from './components/TrialsDetail';
import './index.css'; import './index.css';
ReactDOM.render( ReactDOM.render(
(
<Router history={browserHistory}> <Router history={browserHistory}>
<Route path="/" component={App}> <Route path="/" component={App}>
<IndexRedirect to="/oview" /> <IndexRedirect to="/oview" />
<Route path="/oview" component={Overview} /> <Route path="/oview" component={Overview} />
<Route path="/detail" component={TrialsDetail} /> <Route path="/detail" component={TrialsDetail} />
</Route> </Route>
</Router>, </Router>
),
document.getElementById('root') as HTMLElement document.getElementById('root') as HTMLElement
); );
registerServiceWorker(); registerServiceWorker();
...@@ -42,7 +42,7 @@ const COLUMN_INDEX = [ ...@@ -42,7 +42,7 @@ const COLUMN_INDEX = [
index: 4 index: 4
}, },
{ {
name: 'Intermeidate count', name: 'Intermediate count',
index: 5 index: 5
}, },
{ {
...@@ -57,7 +57,7 @@ const COLUMN_INDEX = [ ...@@ -57,7 +57,7 @@ const COLUMN_INDEX = [
// defatult selected column // defatult selected column
const COLUMN = ['Trial No.', 'ID', 'Duration', 'Status', 'Default', 'Operation']; const COLUMN = ['Trial No.', 'ID', 'Duration', 'Status', 'Default', 'Operation'];
// all choice column !dictory final // all choice column !dictory final
const COLUMNPro = ['Trial No.', 'ID', 'Duration', 'Status', 'Intermeidate count', 'Default', 'Operation']; const COLUMNPro = ['Trial No.', 'ID', 'Duration', 'Status', 'Intermediate count', 'Default', 'Operation'];
export { export {
MANAGER_IP, DOWNLOAD_IP, trialJobStatus, COLUMNPro, MANAGER_IP, DOWNLOAD_IP, trialJobStatus, COLUMNPro,
CONTROLTYPE, MONACO, COLUMN, COLUMN_INDEX, DRAWEROPTION CONTROLTYPE, MONACO, COLUMN, COLUMN_INDEX, DRAWEROPTION
......
...@@ -27,7 +27,7 @@ interface Parameters { ...@@ -27,7 +27,7 @@ interface Parameters {
parameters: ErrorParameter; parameters: ErrorParameter;
logPath?: string; logPath?: string;
intermediate: Array<number>; intermediate: Array<number>;
progress?: number; multiProgress?: number;
} }
interface Experiment { interface Experiment {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
} }
.compare-intermeidate{ .compare-intermediate{
position: relative; position: relative;
.compare-yAxis{ .compare-yAxis{
color: #333; color: #333;
......
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
} }
} }
/* for # intermediate in intermeidate graph*/ /* for # intermediate in intermediate graph*/
.intermeidate-graph{ .intermediate-graph{
position: relative; position: relative;
.yAxis{ .yAxis{
color: #333; color: #333;
......
...@@ -21,13 +21,7 @@ ...@@ -21,13 +21,7 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"baseUrl": "." "baseUrl": "."
}, },
"exclude": [ "include": [
"node_modules", "src/**/*"
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
] ]
} }
This diff is collapsed.
...@@ -131,5 +131,3 @@ if __name__ == '__main__': ...@@ -131,5 +131,3 @@ if __name__ == '__main__':
setup_experiment(args.preinstall) setup_experiment(args.preinstall)
run(args) run(args)
#
\ No newline at end of file
...@@ -103,11 +103,11 @@ def stop_experiment_test(): ...@@ -103,11 +103,11 @@ def stop_experiment_test():
snooze() snooze()
assert not detect_port(8990), '`nnictl stop %s` failed to stop experiments' % experiment_id assert not detect_port(8990), '`nnictl stop %s` failed to stop experiments' % experiment_id
# test cmd `nnictl stop all` # test cmd `nnictl stop --all`
proc = subprocess.run(['nnictl', 'stop', 'all']) proc = subprocess.run(['nnictl', 'stop', '--all'])
assert proc.returncode == 0, '`nnictl stop all` failed with code %d' % proc.returncode assert proc.returncode == 0, '`nnictl stop --all` failed with code %d' % proc.returncode
snooze() snooze()
assert not detect_port(8888) and not detect_port(8989), '`nnictl stop all` failed to stop experiments' assert not detect_port(8888) and not detect_port(8989), '`nnictl stop --all` failed to stop experiments'
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -54,7 +54,7 @@ def start_container(image, name, nnimanager_os): ...@@ -54,7 +54,7 @@ def start_container(image, name, nnimanager_os):
else: else:
return '/tmp/nni/dist/{0}'.format(wheel_name) return '/tmp/nni/dist/{0}'.format(wheel_name)
pip_cmds = ['docker', 'exec', name, 'python3', '-m', 'pip', 'install', '--upgrade', 'pip'] pip_cmds = ['docker', 'exec', name, 'python3', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools==39.1.0']
check_call(pip_cmds) check_call(pip_cmds)
sdk_cmds = ['docker', 'exec', name, 'python3', '-m', 'pip', 'install', get_dist(wheel_name)] sdk_cmds = ['docker', 'exec', name, 'python3', '-m', 'pip', 'install', get_dist(wheel_name)]
check_call(sdk_cmds) check_call(sdk_cmds)
......
...@@ -7,7 +7,7 @@ __nnictl_update_searchspace_cmds="--filename" ...@@ -7,7 +7,7 @@ __nnictl_update_searchspace_cmds="--filename"
__nnictl_update_concurrency_cmds="--value" __nnictl_update_concurrency_cmds="--value"
__nnictl_update_duration_cmds="--value" __nnictl_update_duration_cmds="--value"
__nnictl_update_trialnum_cmds="--value" __nnictl_update_trialnum_cmds="--value"
__nnictl_stop_cmds="--port all" __nnictl_stop_cmds="--port --all"
__nnictl_trial_cmds="ls kill codegen" __nnictl_trial_cmds="ls kill codegen"
__nnictl_trial_kill_cmds="--trial_id" __nnictl_trial_kill_cmds="--trial_id"
__nnictl_trial_codegen_cmds="--trial_id" __nnictl_trial_codegen_cmds="--trial_id"
......
...@@ -70,8 +70,8 @@ common_schema = { ...@@ -70,8 +70,8 @@ common_schema = {
} }
} }
tuner_schema_dict = { tuner_schema_dict = {
('TPE', 'Anneal', 'SMAC'): { ('Anneal', 'SMAC'): {
'builtinTunerName': setChoice('builtinTunerName', 'TPE', 'Anneal', 'SMAC'), 'builtinTunerName': setChoice('builtinTunerName', 'Anneal', 'SMAC'),
Optional('classArgs'): { Optional('classArgs'): {
'optimize_mode': setChoice('optimize_mode', 'maximize', 'minimize'), 'optimize_mode': setChoice('optimize_mode', 'maximize', 'minimize'),
}, },
...@@ -94,7 +94,7 @@ tuner_schema_dict = { ...@@ -94,7 +94,7 @@ tuner_schema_dict = {
}, },
'TPE': { 'TPE': {
'builtinTunerName': 'TPE', 'builtinTunerName': 'TPE',
'classArgs': { Optional('classArgs'): {
Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'), Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'),
Optional('parallel_optimize'): setType('parallel_optimize', bool), Optional('parallel_optimize'): setType('parallel_optimize', bool),
Optional('constant_liar_type'): setChoice('constant_liar_type', 'min', 'max', 'mean') Optional('constant_liar_type'): setChoice('constant_liar_type', 'min', 'max', 'mean')
...@@ -104,7 +104,7 @@ tuner_schema_dict = { ...@@ -104,7 +104,7 @@ tuner_schema_dict = {
}, },
'NetworkMorphism': { 'NetworkMorphism': {
'builtinTunerName': 'NetworkMorphism', 'builtinTunerName': 'NetworkMorphism',
'classArgs': { Optional('classArgs'): {
Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'), Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'),
Optional('task'): setChoice('task', 'cv','nlp','common'), Optional('task'): setChoice('task', 'cv','nlp','common'),
Optional('input_width'): setType('input_width', int), Optional('input_width'): setType('input_width', int),
...@@ -116,7 +116,7 @@ tuner_schema_dict = { ...@@ -116,7 +116,7 @@ tuner_schema_dict = {
}, },
'MetisTuner': { 'MetisTuner': {
'builtinTunerName': 'MetisTuner', 'builtinTunerName': 'MetisTuner',
'classArgs': { Optional('classArgs'): {
Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'), Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'),
Optional('no_resampling'): setType('no_resampling', bool), Optional('no_resampling'): setType('no_resampling', bool),
Optional('no_candidates'): setType('no_candidates', bool), Optional('no_candidates'): setType('no_candidates', bool),
...@@ -128,7 +128,7 @@ tuner_schema_dict = { ...@@ -128,7 +128,7 @@ tuner_schema_dict = {
}, },
'GPTuner': { 'GPTuner': {
'builtinTunerName': 'GPTuner', 'builtinTunerName': 'GPTuner',
'classArgs': { Optional('classArgs'): {
Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'), Optional('optimize_mode'): setChoice('optimize_mode', 'maximize', 'minimize'),
Optional('utility'): setChoice('utility', 'ei', 'ucb', 'poi'), Optional('utility'): setChoice('utility', 'ei', 'ucb', 'poi'),
Optional('kappa'): setType('kappa', float), Optional('kappa'): setType('kappa', float),
...@@ -233,8 +233,7 @@ pai_trial_schema = { ...@@ -233,8 +233,7 @@ pai_trial_schema = {
'cpuNum': setNumberRange('cpuNum', int, 0, 99999), 'cpuNum': setNumberRange('cpuNum', int, 0, 99999),
'memoryMB': setType('memoryMB', int), 'memoryMB': setType('memoryMB', int),
'image': setType('image', str), 'image': setType('image', str),
Optional('authFile'): And(Regex(r'hdfs://(([0-9]{1,3}.){3}[0-9]{1,3})(:[0-9]{2,5})?(/.*)?'),\ Optional('authFile'): And(os.path.exists, error=SCHEMA_PATH_ERROR % 'authFile'),
error='ERROR: authFile format error, authFile format is hdfs://xxx.xxx.xxx.xxx:xxx'),
Optional('shmMB'): setType('shmMB', int), Optional('shmMB'): setType('shmMB', int),
Optional('dataDir'): And(Regex(r'hdfs://(([0-9]{1,3}.){3}[0-9]{1,3})(:[0-9]{2,5})?(/.*)?'),\ Optional('dataDir'): And(Regex(r'hdfs://(([0-9]{1,3}.){3}[0-9]{1,3})(:[0-9]{2,5})?(/.*)?'),\
error='ERROR: dataDir format error, dataDir format is hdfs://xxx.xxx.xxx.xxx:xxx'), error='ERROR: dataDir format error, dataDir format is hdfs://xxx.xxx.xxx.xxx:xxx'),
......
...@@ -519,14 +519,14 @@ def resume_experiment(args): ...@@ -519,14 +519,14 @@ def resume_experiment(args):
#find the latest stopped experiment #find the latest stopped experiment
if not args.id: if not args.id:
print_error('Please set experiment id! \nYou could use \'nnictl resume {id}\' to resume a stopped experiment!\n' \ print_error('Please set experiment id! \nYou could use \'nnictl resume {id}\' to resume a stopped experiment!\n' \
'You could use \'nnictl experiment list all\' to show all of stopped experiments!') 'You could use \'nnictl experiment list --all\' to show all experiments!')
exit(1) exit(1)
else: else:
if experiment_dict.get(args.id) is None: if experiment_dict.get(args.id) is None:
print_error('Id %s not exist!' % args.id) print_error('Id %s not exist!' % args.id)
exit(1) exit(1)
if experiment_dict[args.id]['status'] != 'STOPPED': if experiment_dict[args.id]['status'] != 'STOPPED':
print_error('Experiment %s is running!' % args.id) print_error('Only stopped experiments can be resumed!')
exit(1) exit(1)
experiment_id = args.id experiment_id = args.id
print_normal('Resuming experiment %s...' % experiment_id) print_normal('Resuming experiment %s...' % experiment_id)
......
...@@ -56,12 +56,30 @@ def parse_path(experiment_config, config_path): ...@@ -56,12 +56,30 @@ def parse_path(experiment_config, config_path):
expand_path(experiment_config, 'searchSpacePath') expand_path(experiment_config, 'searchSpacePath')
if experiment_config.get('trial'): if experiment_config.get('trial'):
expand_path(experiment_config['trial'], 'codeDir') expand_path(experiment_config['trial'], 'codeDir')
if experiment_config['trial'].get('authFile'):
expand_path(experiment_config['trial'], 'authFile')
if experiment_config['trial'].get('ps'):
if experiment_config['trial']['ps'].get('privateRegistryAuthPath'):
expand_path(experiment_config['trial']['ps'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('master'):
if experiment_config['trial']['master'].get('privateRegistryAuthPath'):
expand_path(experiment_config['trial']['master'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('worker'):
if experiment_config['trial']['worker'].get('privateRegistryAuthPath'):
expand_path(experiment_config['trial']['worker'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('taskRoles'):
for index in range(len(experiment_config['trial']['taskRoles'])):
if experiment_config['trial']['taskRoles'][index].get('privateRegistryAuthPath'):
expand_path(experiment_config['trial']['taskRoles'][index], 'privateRegistryAuthPath')
if experiment_config.get('tuner'): if experiment_config.get('tuner'):
expand_path(experiment_config['tuner'], 'codeDir') expand_path(experiment_config['tuner'], 'codeDir')
if experiment_config.get('assessor'): if experiment_config.get('assessor'):
expand_path(experiment_config['assessor'], 'codeDir') expand_path(experiment_config['assessor'], 'codeDir')
if experiment_config.get('advisor'): if experiment_config.get('advisor'):
expand_path(experiment_config['advisor'], 'codeDir') expand_path(experiment_config['advisor'], 'codeDir')
if experiment_config.get('machineList'):
for index in range(len(experiment_config['machineList'])):
expand_path(experiment_config['machineList'][index], 'sshKeyPath')
#if users use relative path, convert it to absolute path #if users use relative path, convert it to absolute path
root_path = os.path.dirname(config_path) root_path = os.path.dirname(config_path)
...@@ -69,6 +87,21 @@ def parse_path(experiment_config, config_path): ...@@ -69,6 +87,21 @@ def parse_path(experiment_config, config_path):
parse_relative_path(root_path, experiment_config, 'searchSpacePath') parse_relative_path(root_path, experiment_config, 'searchSpacePath')
if experiment_config.get('trial'): if experiment_config.get('trial'):
parse_relative_path(root_path, experiment_config['trial'], 'codeDir') parse_relative_path(root_path, experiment_config['trial'], 'codeDir')
if experiment_config['trial'].get('authFile'):
parse_relative_path(root_path, experiment_config['trial'], 'authFile')
if experiment_config['trial'].get('ps'):
if experiment_config['trial']['ps'].get('privateRegistryAuthPath'):
parse_relative_path(root_path, experiment_config['trial']['ps'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('master'):
if experiment_config['trial']['master'].get('privateRegistryAuthPath'):
parse_relative_path(root_path, experiment_config['trial']['master'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('worker'):
if experiment_config['trial']['worker'].get('privateRegistryAuthPath'):
parse_relative_path(root_path, experiment_config['trial']['worker'], 'privateRegistryAuthPath')
if experiment_config['trial'].get('taskRoles'):
for index in range(len(experiment_config['trial']['taskRoles'])):
if experiment_config['trial']['taskRoles'][index].get('privateRegistryAuthPath'):
parse_relative_path(root_path, experiment_config['trial']['taskRoles'][index], 'privateRegistryAuthPath')
if experiment_config.get('tuner'): if experiment_config.get('tuner'):
parse_relative_path(root_path, experiment_config['tuner'], 'codeDir') parse_relative_path(root_path, experiment_config['tuner'], 'codeDir')
if experiment_config.get('assessor'): if experiment_config.get('assessor'):
......
...@@ -91,6 +91,7 @@ def parse_args(): ...@@ -91,6 +91,7 @@ def parse_args():
parser_stop = subparsers.add_parser('stop', help='stop the experiment') parser_stop = subparsers.add_parser('stop', help='stop the experiment')
parser_stop.add_argument('id', nargs='?', help='the id of experiment, use \'all\' to stop all running experiments') parser_stop.add_argument('id', nargs='?', help='the id of experiment, use \'all\' to stop all running experiments')
parser_stop.add_argument('--port', '-p', dest='port', help='the port of restful server') parser_stop.add_argument('--port', '-p', dest='port', help='the port of restful server')
parser_stop.add_argument('--all', '-a', action='store_true', help='stop all of experiments')
parser_stop.set_defaults(func=stop_experiment) parser_stop.set_defaults(func=stop_experiment)
#parse trial command #parse trial command
......
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