"src/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "5d91adcf3832a76c501e2ded878841b6234f42d5"
Unverified Commit 683c458a authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

Multiple Experiments Management UX (#3127)



* first update

* add click event

* add manager exp nav

* first demo, fix some comments

* use api to dev

* refactor code

* fix lint

* fix test met issue and adjust column width

* add /experiments-info  error status

* no declare platform list, get this from api result filter

* fix compare tooltip issue

* fix tooltip location

* fix some comments

* delete datestring

* fix clickable style and clickable column ID rather than name
Co-authored-by: default avatarLijiao <Lijiaoa@outlook.com>
parent af198888
...@@ -4,27 +4,29 @@ import App from './App'; ...@@ -4,27 +4,29 @@ import App from './App';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
const Overview = lazy(() => import('./components/Overview')); const Overview = lazy(() => import('./components/Overview'));
const TrialsDetail = lazy(() => import('./components/TrialsDetail')); const TrialsDetail = lazy(() => import('./components/TrialsDetail'));
const Experiment = lazy(() => import('./components/managementExp/ExperimentManager'));
import './index.css'; import './index.css';
import './static/style/loading.scss'; import './static/style/loading.scss';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
ReactDOM.render( ReactDOM.render(
<Router> <Router>
<App> <Suspense
fallback={
<div className='loading'>
<img src={require('./static/img/loading.gif')} />
</div>
}
>
<Route path='/experiment' component={Experiment} exact />
<Switch> <Switch>
<Suspense <App>
fallback={
<div className='loading'>
<img src={require('./static/img/loading.gif')} />
</div>
}
>
<Route path='/' component={Overview} exact /> <Route path='/' component={Overview} exact />
<Route path='/oview' component={Overview} /> <Route path='/oview' component={Overview} />
<Route path='/detail' component={TrialsDetail} /> <Route path='/detail' component={TrialsDetail} />
</Suspense> </App>
</Switch> </Switch>
</App> </Suspense>
</Router>, </Router>,
document.getElementById('root') document.getElementById('root')
......
...@@ -15,6 +15,16 @@ const trialJobStatus = [ ...@@ -15,6 +15,16 @@ const trialJobStatus = [
'SYS_CANCELED', 'SYS_CANCELED',
'EARLY_STOPPED' 'EARLY_STOPPED'
]; ];
const EXPERIMENTSTATUS = [
'INITIALIZED',
'RUNNING',
'ERROR',
'STOPPING',
'STOPPED',
'DONE',
'NO_MORE_TRIAL',
'TUNER_NO_MORE_TRIAL'
];
const CONTROLTYPE = ['MAX_EXEC_DURATION', 'MAX_TRIAL_NUM', 'TRIAL_CONCURRENCY', 'SEARCH_SPACE']; const CONTROLTYPE = ['MAX_EXEC_DURATION', 'MAX_TRIAL_NUM', 'TRIAL_CONCURRENCY', 'SEARCH_SPACE'];
const MONACO = { const MONACO = {
readOnly: true, readOnly: true,
...@@ -64,6 +74,7 @@ export { ...@@ -64,6 +74,7 @@ export {
MANAGER_IP, MANAGER_IP,
DOWNLOAD_IP, DOWNLOAD_IP,
trialJobStatus, trialJobStatus,
EXPERIMENTSTATUS,
COLUMNPro, COLUMNPro,
WEBUIDOC, WEBUIDOC,
CONTROLTYPE, CONTROLTYPE,
......
...@@ -236,6 +236,14 @@ function formatTimestamp(timestamp?: number, placeholder?: string): string { ...@@ -236,6 +236,14 @@ function formatTimestamp(timestamp?: number, placeholder?: string): string {
return timestamp ? new Date(timestamp).toLocaleString('en-US') : placeholder; return timestamp ? new Date(timestamp).toLocaleString('en-US') : placeholder;
} }
function expformatTimestamp(timestamp: number | string): string {
if (typeof timestamp === 'number') {
return new Date(timestamp).toLocaleString('en-US');
} else {
return 'N/A';
}
}
function metricAccuracy(metric: MetricDataRecord): number { function metricAccuracy(metric: MetricDataRecord): number {
const data = parseMetrics(metric.data); const data = parseMetrics(metric.data);
// return typeof data === 'number' ? data : NaN; // return typeof data === 'number' ? data : NaN;
...@@ -262,6 +270,10 @@ function formatComplexTypeValue(value: any): string | number { ...@@ -262,6 +270,10 @@ function formatComplexTypeValue(value: any): string | number {
} }
} }
function isManagerExperimentPage(): boolean {
return location.pathname.indexOf('experiment') === -1 ? false : true;
}
function caclMonacoEditorHeight(height): number { function caclMonacoEditorHeight(height): number {
// [Search space 56px] + [marginBottom 18px] + // [Search space 56px] + [marginBottom 18px] +
// button[height: 32px, marginTop: 45px, marginBottom: 7px] // button[height: 32px, marginTop: 45px, marginBottom: 7px]
...@@ -306,12 +318,14 @@ export { ...@@ -306,12 +318,14 @@ export {
filterDuration, filterDuration,
formatAccuracy, formatAccuracy,
formatTimestamp, formatTimestamp,
expformatTimestamp,
metricAccuracy, metricAccuracy,
parseMetrics, parseMetrics,
isArrayType, isArrayType,
requestAxios, requestAxios,
isNaNorInfinity, isNaNorInfinity,
formatComplexTypeValue, formatComplexTypeValue,
isManagerExperimentPage,
caclMonacoEditorHeight, caclMonacoEditorHeight,
copyAndSort copyAndSort
}; };
...@@ -120,6 +120,7 @@ interface Intermedia { ...@@ -120,6 +120,7 @@ interface Intermedia {
type: string; type: string;
data: Array<number | object>; // intermediate data data: Array<number | object>; // intermediate data
hyperPara: object; // each trial hyperpara value hyperPara: object; // each trial hyperpara value
trialNum: number;
} }
interface MetricDataRecord { interface MetricDataRecord {
...@@ -218,6 +219,19 @@ interface SortInfo { ...@@ -218,6 +219,19 @@ interface SortInfo {
isDescend?: boolean; isDescend?: boolean;
} }
interface AllExperimentList {
id: string;
experimentName: string;
port: number;
status: string;
platform: string;
startTime: number;
endTime: number;
tag: string[];
pid: number;
webuiUrl: string[];
logDir: string[];
}
export { export {
TableObj, TableObj,
TableRecord, TableRecord,
...@@ -240,5 +254,6 @@ export { ...@@ -240,5 +254,6 @@ export {
EventMap, EventMap,
SingleAxis, SingleAxis,
MultipleAxes, MultipleAxes,
SortInfo SortInfo,
AllExperimentList
}; };
import { MANAGER_IP } from '../const';
import { AllExperimentList } from '../interface';
import { requestAxios } from '../function';
class ExperimentsManager {
private experimentList: AllExperimentList[] = [];
private platform: string[] = [];
private errorMessage: string = '';
public getExperimentList(): AllExperimentList[] {
return this.experimentList;
}
public getPlatformList(): string[] {
return this.platform;
}
public getExpErrorMessage(): string {
return this.errorMessage;
}
public async init(): Promise<void> {
await requestAxios(`${MANAGER_IP}/experiments-info`)
.then(data => {
const platforms: Set<string> = new Set();
for (const item of data) {
if (item.port !== undefined) {
if (typeof item.port === 'string') {
item.port = JSON.parse(item.port);
}
}
platforms.add(item.platform);
}
this.experimentList = data;
this.platform = Array.from(platforms);
})
.catch(error => {
this.errorMessage = error.message;
});
}
}
export { ExperimentsManager };
.cursor{ .ellipsis {
&:hover, & i:hover{ overflow: hidden;
cursor: pointer; white-space: nowrap;
} text-overflow: ellipsis;
} }
\ No newline at end of file
.link {
outline: none;
color: #333 !important;
text-decoration: none;
&:hover {
color: #0071bc !important;
text-decoration: underline;
}
&:active,
&:visited {
color: #0071bc;
}
}
.cursor {
&:hover,
& i:hover {
cursor: pointer;
}
}
.expBackground {
background: #f2f2f2;
height: 100%;
.content {
background: #fff;
}
}
.experimentList {
padding: 42px;
.box {
.search {
width: 90%;
&-input {
width: 330px;
}
}
.filter {
width: 10%;
text-align: right;
&-button-open {
background: #f3f2f1;
}
}
}
.filter-condition {
margin-top: 26px;
.reset {
width: 80px;
position: relative;
top: 29px;
}
&-status {
width: 194px;
}
&-platform {
width: 150px;
}
}
.hidden {
display: none;
}
.margin {
margin-left: 10px;
}
.tagContainer {
width: 100%;
.tag {
font-weight: 500;
background: #f2f2f2;
margin: 0 4px;
padding: 0 6px;
}
}
}
$barHeight: 56px; $barHeight: 56px;
.navOptions { .navOptions {
.ms-Button-icon { .ms-Button-icon {
color: #fff; color: #fff;
&:hover { &:hover {
color: #fff; color: #fff;
} }
} }
.ms-Button--commandBar { .ms-Button--commandBar {
background-color: #0071bc; background-color: #0071bc;
user-select: none; user-select: none;
&:hover, &:hover,
&:active { &:active {
color: #fff; color: #fff;
.ms-Button-icon { .ms-Button-icon {
color: #fff; color: #fff;
} }
} }
.ms-Button-textContainer { .ms-Button-textContainer {
color: #fff; color: #fff;
} }
.ms-Button-menuIcon { .ms-Button-menuIcon {
color: #fff; color: #fff;
background-color: transparent; background-color: transparent;
} }
} }
.experiment {
position: relative;
top: 3px;
text-decoration: none;
}
} }
.nav { .nav {
height: $barHeight; width: 100%;
line-height: $barHeight; min-width: 1200px;
height: $barHeight;
/* desktop mode useful */ line-height: $barHeight;
.desktop-logo {
position: relative; /* desktop mode useful */
top: 6px; .desktop-logo {
} position: relative;
top: 6px;
&-refresh { }
position: relative;
display: flex; .logoTitle {
} font-size: 18px;
color: #fff;
&-refresh-num { }
position: absolute;
top: -13px; &-refresh {
left: 17px; position: relative;
color: #fff; display: flex;
font-size: 12px; }
}
&-refresh-num {
position: absolute;
top: -13px;
left: 17px;
color: #fff;
font-size: 12px;
}
} }
/* overview and detail tabs common style */ /* overview and detail tabs common style */
a.common-tabs { a.common-tabs {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 16px; font-size: 16px;
color: #b8c7ce; color: #b8c7ce;
text-decoration: none; text-decoration: none;
} }
.common-tabs:visited, .common-tabs:visited,
.selected:hover { .selected:hover {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
} }
.common-tabs:hover, .common-tabs:hover,
.selected { .selected {
color: #fff; color: #fff;
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
} }
.left-right-margin { .left-right-margin {
margin-left: 20px; margin-left: 20px;
margin-right: 20px; margin-right: 20px;
}
.expNavTitle {
span {
color: #fff;
text-decoration: none;
position: relative;
top: -4px;
}
i {
color: #fff;
font-size: 12px;
position: relative;
top: -3px;
padding-left: 4px;
}
} }
.status {
color: #0573bc;
font-size: 20px;
font-weight: 600;
.status-text {
display: inline-block;
}
.color {
color: #333;
}
}
.inputBox {
height: 32px;
margin-top: 5px;
}
/* office-fabric-ui progressIndicator */
.ms-ProgressIndicator-itemProgress {
padding: 0;
}
...@@ -58,6 +58,7 @@ $margin: 24px; ...@@ -58,6 +58,7 @@ $margin: 24px;
.concurrency { .concurrency {
.editparam { .editparam {
margin-top: 5px; margin-top: 5px;
position: relative;
} }
} }
.editparam { .editparam {
...@@ -124,5 +125,6 @@ $margin: 24px; ...@@ -124,5 +125,6 @@ $margin: 24px;
.info { .info {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
left: 0; left: -50%;
width: 270%;
} }
...@@ -61,30 +61,24 @@ $boxGapPadding: 10px; ...@@ -61,30 +61,24 @@ $boxGapPadding: 10px;
} }
.basic { .basic {
line-height: 21px; line-height: 21px;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
p { p {
color: #8f8f8f; font-size: 14px;
font-size: 14px; color: #8f8f8f;
font-weight: normal;
span {
span { color: #484848;
color: #484848; }
} }
}
div {
div { font-size: 16px;
font-size: 16px; font-weight: 500;
font-weight: 500; color: #484848;
color: #484848; }
}
.nowrap {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.overviewBestMetric { .overviewBestMetric {
......
.status {
color: #0573bc;
font-size: 20px;
font-weight: 600;
.status-text {
display: inline-block;
}
.color {
color: #333;
}
}
.probar {
width: 100%;
height: 34px;
margin-top: 15px;
.showProgress {
width: 300px;
height: 30px;
}
.name {
width: 178px;
box-sizing: border-box;
line-height: 30px;
text-align: center;
color: #fff;
background-color: #999;
border: 2px solid #e6e6e6;
border-top-left-radius: 12px;
border-bottom-left-radius: 12px;
}
.boundary {
width: 100%;
line-height: 24px;
font-size: 12px;
color: #212121;
.right {
text-align: right;
}
}
.description {
line-height: 34px;
margin-left: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.inputBox {
height: 32px;
margin-top: 5px;
}
/* office-fabric-ui progressIndicator */
.ms-ProgressIndicator-itemProgress {
padding: 0;
}
...@@ -13,12 +13,6 @@ ...@@ -13,12 +13,6 @@
} }
} }
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#succeTable, #succeTable,
#tableList { #tableList {
.commonTableStyle .leftTitle div { .commonTableStyle .leftTitle div {
......
This diff is collapsed.
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