Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
d33220f7
Commit
d33220f7
authored
Nov 30, 2018
by
Lijiao
Committed by
fishyds
Nov 30, 2018
Browse files
Support to show 2 logPath, add hdfsLogPath (#420)
* Support to show 2 logPath * fix lint * Update trial status color
parent
02e9fcfc
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
56 deletions
+107
-56
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
+1
-1
src/webui/src/components/Overview.tsx
src/webui/src/components/Overview.tsx
+0
-4
src/webui/src/components/TrialsDetail.tsx
src/webui/src/components/TrialsDetail.tsx
+1
-6
src/webui/src/components/logPath/LogPath.tsx
src/webui/src/components/logPath/LogPath.tsx
+48
-0
src/webui/src/components/logPath/LogPathChild.tsx
src/webui/src/components/logPath/LogPathChild.tsx
+39
-0
src/webui/src/components/overview/SuccessTable.tsx
src/webui/src/components/overview/SuccessTable.tsx
+7
-18
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+7
-18
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+0
-2
src/webui/src/static/style/tableStatus.css
src/webui/src/static/style/tableStatus.css
+4
-7
No files found.
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
View file @
d33220f7
...
@@ -124,7 +124,7 @@ export class PAIJobInfoCollector {
...
@@ -124,7 +124,7 @@ export class PAIJobInfoCollector {
}
}
// Set pai trial job's url to WebHDFS output path
// Set pai trial job's url to WebHDFS output path
if
(
paiTrialJob
.
hdfsLogPath
)
{
if
(
paiTrialJob
.
hdfsLogPath
)
{
paiTrialJob
.
url
=
paiTrialJob
.
hdfsLogPath
;
paiTrialJob
.
url
+
=
`,
${
paiTrialJob
.
hdfsLogPath
}
`
;
}
}
}
}
}
}
...
...
src/webui/src/components/Overview.tsx
View file @
d33220f7
...
@@ -225,10 +225,6 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -225,10 +225,6 @@ class Overview extends React.Component<{}, OverviewState> {
}
}
if
(
tableData
[
item
].
logPath
!==
undefined
)
{
if
(
tableData
[
item
].
logPath
!==
undefined
)
{
desJobDetail
.
logPath
=
tableData
[
item
].
logPath
;
desJobDetail
.
logPath
=
tableData
[
item
].
logPath
;
const
isSessionLink
=
/^http/gi
.
test
(
tableData
[
item
].
logPath
);
if
(
isSessionLink
)
{
desJobDetail
.
isLink
=
true
;
}
}
}
topTableData
.
push
({
topTableData
.
push
({
key
:
topTableData
.
length
,
key
:
topTableData
.
length
,
...
...
src/webui/src/components/TrialsDetail.tsx
View file @
d33220f7
...
@@ -129,8 +129,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -129,8 +129,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
Object
.
keys
(
trialJobs
).
map
(
item
=>
{
Object
.
keys
(
trialJobs
).
map
(
item
=>
{
// only succeeded trials have finalMetricData
// only succeeded trials have finalMetricData
let
desc
:
Parameters
=
{
let
desc
:
Parameters
=
{
parameters
:
{},
parameters
:
{}
intermediate
:
[]
};
};
let
duration
=
0
;
let
duration
=
0
;
const
id
=
trialJobs
[
item
].
id
!==
undefined
const
id
=
trialJobs
[
item
].
id
!==
undefined
...
@@ -155,10 +154,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -155,10 +154,6 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
}
}
if
(
trialJobs
[
item
].
logPath
!==
undefined
)
{
if
(
trialJobs
[
item
].
logPath
!==
undefined
)
{
desc
.
logPath
=
trialJobs
[
item
].
logPath
;
desc
.
logPath
=
trialJobs
[
item
].
logPath
;
const
isHyperLink
=
/^http/gi
.
test
(
trialJobs
[
item
].
logPath
);
if
(
isHyperLink
)
{
desc
.
isLink
=
true
;
}
}
}
const
acc
=
getFinalResult
(
trialJobs
[
item
].
finalMetricData
);
const
acc
=
getFinalResult
(
trialJobs
[
item
].
finalMetricData
);
trialTable
.
push
({
trialTable
.
push
({
...
...
src/webui/src/components/logPath/LogPath.tsx
0 → 100644
View file @
d33220f7
import
*
as
React
from
'
react
'
;
import
LogPathChild
from
'
./LogPathChild
'
;
interface
LogpathProps
{
logStr
:
string
;
}
class
LogPath
extends
React
.
Component
<
LogpathProps
,
{}
>
{
constructor
(
props
:
LogpathProps
)
{
super
(
props
);
}
render
()
{
const
{
logStr
}
=
this
.
props
;
const
isTwopath
=
logStr
.
indexOf
(
'
,
'
)
!==
-
1
?
true
:
false
;
return
(
<
div
>
{
isTwopath
?
<
div
>
<
LogPathChild
eachLogpath
=
{
logStr
.
split
(
'
,
'
)[
0
]
}
logName
=
"LogPath:"
/>
<
LogPathChild
eachLogpath
=
{
logStr
.
split
(
'
,
'
)[
1
]
}
logName
=
"hdfsLogPath:"
/>
</
div
>
:
<
LogPathChild
eachLogpath
=
{
logStr
}
logName
=
"LogPath:"
/>
}
</
div
>
);
}
}
export
default
LogPath
;
\ No newline at end of file
src/webui/src/components/logPath/LogPathChild.tsx
0 → 100644
View file @
d33220f7
import
*
as
React
from
'
react
'
;
interface
LogpathChildProps
{
eachLogpath
:
string
;
logName
:
string
;
}
class
LogPathChild
extends
React
.
Component
<
LogpathChildProps
,
{}
>
{
constructor
(
props
:
LogpathChildProps
)
{
super
(
props
);
}
render
()
{
const
{
eachLogpath
,
logName
}
=
this
.
props
;
const
isLink
=
/^http/gi
.
test
(
eachLogpath
);
return
(
<
div
>
{
isLink
?
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
{
logName
}
</
span
>
<
a
className
=
"logContent logHref"
href
=
{
eachLogpath
}
target
=
"_blank"
>
{
eachLogpath
}
</
a
>
</
div
>
:
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
{
logName
}
</
span
>
<
span
className
=
"logContent"
>
{
eachLogpath
}
</
span
>
</
div
>
}
</
div
>
);
}
}
export
default
LogPathChild
;
src/webui/src/components/overview/SuccessTable.tsx
View file @
d33220f7
...
@@ -4,6 +4,7 @@ import { Table } from 'antd';
...
@@ -4,6 +4,7 @@ import { Table } from 'antd';
import
{
TableObj
}
from
'
../../static/interface
'
;
import
{
TableObj
}
from
'
../../static/interface
'
;
import
{
convertDuration
}
from
'
../../static/function
'
;
import
{
convertDuration
}
from
'
../../static/function
'
;
import
'
../../static/style/tableStatus.css
'
;
import
'
../../static/style/tableStatus.css
'
;
import
LogPath
from
'
../logPath/LogPath
'
;
interface
SuccessTableProps
{
interface
SuccessTableProps
{
tableSource
:
Array
<
TableObj
>
;
tableSource
:
Array
<
TableObj
>
;
...
@@ -106,11 +107,11 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
...
@@ -106,11 +107,11 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
const
openRowDataSource
=
{
const
openRowDataSource
=
{
parameters
:
record
.
description
.
parameters
parameters
:
record
.
description
.
parameters
};
};
let
isLogLink
:
boolean
=
false
;
const
logPathRow
=
record
.
description
.
logPath
!==
undefined
const
logPathRow
=
record
.
description
.
logPath
;
?
if
(
record
.
description
.
isLink
!==
undefined
)
{
record
.
description
.
logPath
isLogLink
=
true
;
:
}
'
This trial
\'
s logPath are not available.
'
;
return
(
return
(
<
pre
id
=
"description"
className
=
"hyperpar"
>
<
pre
id
=
"description"
className
=
"hyperpar"
>
{
{
...
@@ -128,19 +129,7 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
...
@@ -128,19 +129,7 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
</
div
>
</
div
>
}
}
{
<
LogPath
logStr
=
{
logPathRow
}
/>
isLogLink
?
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
logPath:
</
span
>
<
a
className
=
"logContent logHref"
href
=
{
logPathRow
}
target
=
"_blank"
>
{
logPathRow
}
</
a
>
</
div
>
:
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
logPath:
</
span
>
<
span
className
=
"logContent"
>
{
logPathRow
}
</
span
>
</
div
>
}
</
pre
>
</
pre
>
);
);
};
};
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
d33220f7
...
@@ -6,6 +6,7 @@ import { Row, Table, Button, Popconfirm, Modal, message } from 'antd';
...
@@ -6,6 +6,7 @@ import { Row, Table, Button, Popconfirm, Modal, message } from 'antd';
import
{
MANAGER_IP
,
trialJobStatus
}
from
'
../../static/const
'
;
import
{
MANAGER_IP
,
trialJobStatus
}
from
'
../../static/const
'
;
import
{
convertDuration
}
from
'
../../static/function
'
;
import
{
convertDuration
}
from
'
../../static/function
'
;
import
{
TableObj
,
TrialJob
}
from
'
../../static/interface
'
;
import
{
TableObj
,
TrialJob
}
from
'
../../static/interface
'
;
import
LogPath
from
'
../logPath/LogPath
'
;
require
(
'
../../static/style/tableStatus.css
'
);
require
(
'
../../static/style/tableStatus.css
'
);
require
(
'
../../static/style/logPath.scss
'
);
require
(
'
../../static/style/logPath.scss
'
);
require
(
'
../../static/style/search.scss
'
);
require
(
'
../../static/style/search.scss
'
);
...
@@ -305,11 +306,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -305,11 +306,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
const
parametersRow
=
{
const
parametersRow
=
{
parameters
:
record
.
description
.
parameters
parameters
:
record
.
description
.
parameters
};
};
let
isLogLink
:
boolean
=
false
;
const
logPathRow
=
record
.
description
.
logPath
!==
undefined
const
logPathRow
=
record
.
description
.
logPath
;
?
if
(
record
.
description
.
isLink
!==
undefined
)
{
record
.
description
.
logPath
isLogLink
=
true
;
:
}
'
This trial
\'
s logPath are not available.
'
;
return
(
return
(
<
pre
id
=
"allList"
className
=
"hyperpar"
>
<
pre
id
=
"allList"
className
=
"hyperpar"
>
{
{
...
@@ -327,19 +328,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -327,19 +328,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
</
div
>
</
div
>
}
}
{
<
LogPath
logStr
=
{
logPathRow
}
/>
isLogLink
?
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
logPath:
</
span
>
<
a
className
=
"logContent logHref"
href
=
{
logPathRow
}
target
=
"_blank"
>
{
logPathRow
}
</
a
>
</
div
>
:
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
logPath:
</
span
>
<
span
className
=
"logContent"
>
{
logPathRow
}
</
span
>
</
div
>
}
</
pre
>
</
pre
>
);
);
};
};
...
...
src/webui/src/static/interface.ts
View file @
d33220f7
...
@@ -14,8 +14,6 @@ interface ErrorParameter {
...
@@ -14,8 +14,6 @@ interface ErrorParameter {
interface
Parameters
{
interface
Parameters
{
parameters
:
ErrorParameter
;
parameters
:
ErrorParameter
;
logPath
?:
string
;
logPath
?:
string
;
isLink
?:
boolean
;
intermediate
?:
Array
<
string
>
;
}
}
interface
Experiment
{
interface
Experiment
{
...
...
src/webui/src/static/style/tableStatus.css
View file @
d33220f7
.RUNNING
{
.RUNNING
,
.USER_CANCELED
{
color
:
#
3c8dbc
;
color
:
#
0071BC
;
}
}
.FAILED
{
.FAILED
{
color
:
#dd4b39
;
color
:
#dd4b39
;
}
}
.USER_CANCELED
{
color
:
#FF4500
;
}
.SUCCEEDED
{
.SUCCEEDED
{
color
:
#00
92
45
;
color
:
#00
A4
45
;
}
}
.UNKNOWN
{
.UNKNOWN
{
color
:
#FF8C00
;
color
:
#FF8C00
;
}
}
.SYS_CANCELED
{
.SYS_CANCELED
{
color
:
red
;
color
:
#EB0716
;
}
}
.WAITING
{
.WAITING
{
color
:
#008B8B
;
color
:
#008B8B
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment