Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge V0.2 #38

Merged
merged 2 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions src/webui/src/components/TrialStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface TabState {
trialJobs: object;
intermediateOption: object;
modalVisible: boolean;
disTensorButton: boolean;
}

class TrialStatus extends React.Component<{}, TabState> {
Expand Down Expand Up @@ -79,7 +80,8 @@ class TrialStatus extends React.Component<{}, TabState> {
option: {},
intermediateOption: {},
trialJobs: {},
modalVisible: false
modalVisible: false,
disTensorButton: false
};
}

Expand Down Expand Up @@ -346,13 +348,34 @@ class TrialStatus extends React.Component<{}, TabState> {
};
}

// experiment mode is pai, display tensorboard button
disTensorBoard = () => {
axios(`${MANAGER_IP}/experiment`, {
method: 'GET'
})
.then(res => {
if (res.status === 200) {
const experimentObj = res.data;
const trainPlatform = experimentObj.params.trainingServicePlatform;
if (trainPlatform && trainPlatform === 'pai') {
if (this._isMounted) {
this.setState(() => ({
disTensorButton: true
}));
}
}
}
});
}

componentDidMount() {

this._isMounted = true;
// the init of running chart
this.drawRunGraph();
// the init of trials status in the table
this.drawTable();
this.disTensorBoard();
this.intervalID = window.setInterval(this.drawRunGraph, 10000);
this.intervalIDS = window.setInterval(this.drawTable, 10000);
}
Expand All @@ -365,7 +388,7 @@ class TrialStatus extends React.Component<{}, TabState> {
}

render() {
const { intermediateOption, modalVisible, option, tableData } = this.state;
const { intermediateOption, modalVisible, option, tableData, disTensorButton } = this.state;
let bgColor = '';
const trialJob: Array<TrialJob> = [];
trialJobStatus.map(item => {
Expand Down Expand Up @@ -457,7 +480,7 @@ class TrialStatus extends React.Component<{}, TabState> {
</Button>
)
);
},
}
}, {
title: 'Tensor',
dataIndex: 'tensor',
Expand All @@ -468,6 +491,7 @@ class TrialStatus extends React.Component<{}, TabState> {
<Button
type="primary"
className="tableButton"
disabled={disTensorButton}
onClick={this.getTensorpage.bind(this, record.id)}
>
TensorBoard
Expand All @@ -476,7 +500,6 @@ class TrialStatus extends React.Component<{}, TabState> {
},
}
];

const openRow = (record: TableObj) => {
const parametersRow = {
parameters: record.description.parameters
Expand Down
2 changes: 1 addition & 1 deletion tools/nnicmd/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'builtinAssessorName': lambda x: x in ['Medianstop'],
'classArgs': {
'optimize_mode': lambda x: x in ['maximize', 'minimize']},
'gpuNum': And(int, lambda x: 0 <= x <= 99999)
Optional('gpuNum'): And(int, lambda x: 0 <= x <= 99999)
},{
'codeDir': os.path.exists,
'classFileName': str,
Expand Down