Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
214a8e18
"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "fe02b8085bbf4243e7d5c2f8247f0be46ec67f18"
Unverified
Commit
214a8e18
authored
Aug 07, 2020
by
Lijiaoa
Committed by
GitHub
Aug 07, 2020
Browse files
delete multiphase in webui (#2760)
parent
109d9a32
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
89 deletions
+8
-89
src/webui/src/components/Modals/Killjob.tsx
src/webui/src/components/Modals/Killjob.tsx
+1
-1
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+3
-7
src/webui/src/static/interface.ts
src/webui/src/static/interface.ts
+0
-6
src/webui/src/static/model/trial.ts
src/webui/src/static/model/trial.ts
+0
-2
src/webui/src/static/model/trialmanager.ts
src/webui/src/static/model/trialmanager.ts
+4
-73
No files found.
src/webui/src/components/Modals/Killjob.tsx
View file @
214a8e18
...
@@ -77,7 +77,7 @@ class KillJob extends React.Component<KillJobProps, KillJobState> {
...
@@ -77,7 +77,7 @@ class KillJob extends React.Component<KillJobProps, KillJobState> {
onKill
=
():
void
=>
{
onKill
=
():
void
=>
{
this
.
setState
({
isCalloutVisible
:
false
},
()
=>
{
this
.
setState
({
isCalloutVisible
:
false
},
()
=>
{
const
{
trial
}
=
this
.
props
;
const
{
trial
}
=
this
.
props
;
killJob
(
trial
.
key
,
trial
.
jobI
d
,
trial
.
status
);
killJob
(
trial
.
key
,
trial
.
i
d
,
trial
.
status
);
});
});
}
}
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
214a8e18
...
@@ -269,7 +269,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -269,7 +269,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
showIntermediateModal
=
async
(
record
:
TrialJobInfo
,
event
:
React
.
SyntheticEvent
<
EventTarget
>
):
Promise
<
void
>
=>
{
showIntermediateModal
=
async
(
record
:
TrialJobInfo
,
event
:
React
.
SyntheticEvent
<
EventTarget
>
):
Promise
<
void
>
=>
{
event
.
preventDefault
();
event
.
preventDefault
();
event
.
stopPropagation
();
event
.
stopPropagation
();
const
res
=
await
axios
.
get
(
`
${
MANAGER_IP
}
/metric-data/
${
record
.
jobI
d
}
`
);
const
res
=
await
axios
.
get
(
`
${
MANAGER_IP
}
/metric-data/
${
record
.
i
d
}
`
);
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
const
intermediateArr
:
number
[]
=
[];
const
intermediateArr
:
number
[]
=
[];
// support intermediate result is dict because the last intermediate result is
// support intermediate result is dict because the last intermediate result is
...
@@ -277,14 +277,10 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -277,14 +277,10 @@ class TableList extends React.Component<TableListProps, TableListState> {
// get intermediate result dict keys array
// get intermediate result dict keys array
const
{
intermediateKey
}
=
this
.
state
;
const
{
intermediateKey
}
=
this
.
state
;
const
otherkeys
:
string
[]
=
[];
const
otherkeys
:
string
[]
=
[];
// One trial job may contains multiple parameter id
const
metricDatas
=
res
.
data
;
// only show current trial's metric data
const
metricDatas
=
res
.
data
.
filter
(
item
=>
{
return
item
.
parameterId
==
record
.
parameterId
;
});
if
(
metricDatas
.
length
!==
0
)
{
if
(
metricDatas
.
length
!==
0
)
{
// just add type=number keys
// just add type=number keys
const
intermediateMetrics
=
parseMetrics
(
res
.
d
ata
[
0
].
data
);
const
intermediateMetrics
=
parseMetrics
(
metricD
ata
s
[
0
].
data
);
for
(
const
key
in
intermediateMetrics
)
{
for
(
const
key
in
intermediateMetrics
)
{
if
(
typeof
intermediateMetrics
[
key
]
===
'
number
'
)
{
if
(
typeof
intermediateMetrics
[
key
]
===
'
number
'
)
{
otherkeys
.
push
(
key
);
otherkeys
.
push
(
key
);
...
...
src/webui/src/static/interface.ts
View file @
214a8e18
...
@@ -43,8 +43,6 @@ interface TableRecord {
...
@@ -43,8 +43,6 @@ interface TableRecord {
startTime
:
number
;
startTime
:
number
;
endTime
?:
number
;
endTime
?:
number
;
id
:
string
;
id
:
string
;
jobId
:
string
;
parameterId
:
string
;
duration
:
number
;
duration
:
number
;
status
:
string
;
status
:
string
;
intermediateCount
:
number
;
intermediateCount
:
number
;
...
@@ -126,8 +124,6 @@ interface Intermedia {
...
@@ -126,8 +124,6 @@ interface Intermedia {
interface
MetricDataRecord
{
interface
MetricDataRecord
{
timestamp
:
number
;
timestamp
:
number
;
trialJobId
:
string
;
trialJobId
:
string
;
trialId
:
string
;
parameterId
:
string
;
type
:
string
;
type
:
string
;
sequence
:
number
;
sequence
:
number
;
data
:
string
;
data
:
string
;
...
@@ -135,8 +131,6 @@ interface MetricDataRecord {
...
@@ -135,8 +131,6 @@ interface MetricDataRecord {
interface
TrialJobInfo
{
interface
TrialJobInfo
{
id
:
string
;
id
:
string
;
jobId
:
string
;
parameterId
:
string
;
sequenceId
:
number
;
sequenceId
:
number
;
status
:
string
;
status
:
string
;
startTime
?:
number
;
startTime
?:
number
;
...
...
src/webui/src/static/model/trial.ts
View file @
214a8e18
...
@@ -115,8 +115,6 @@ class Trial implements TableObj {
...
@@ -115,8 +115,6 @@ class Trial implements TableObj {
key
:
this
.
info
.
id
,
key
:
this
.
info
.
id
,
sequenceId
:
this
.
info
.
sequenceId
,
sequenceId
:
this
.
info
.
sequenceId
,
id
:
this
.
info
.
id
,
id
:
this
.
info
.
id
,
jobId
:
this
.
info
.
jobId
,
parameterId
:
this
.
info
.
parameterId
,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
startTime
:
this
.
info
.
startTime
!
,
startTime
:
this
.
info
.
startTime
!
,
endTime
:
this
.
info
.
endTime
,
endTime
:
this
.
info
.
endTime
,
...
...
src/webui/src/static/model/trialmanager.ts
View file @
214a8e18
...
@@ -7,29 +7,13 @@ import { requestAxios } from '../function';
...
@@ -7,29 +7,13 @@ import { requestAxios } from '../function';
function
groupMetricsByTrial
(
metrics
:
MetricDataRecord
[]):
Map
<
string
,
MetricDataRecord
[]
>
{
function
groupMetricsByTrial
(
metrics
:
MetricDataRecord
[]):
Map
<
string
,
MetricDataRecord
[]
>
{
const
ret
=
new
Map
<
string
,
MetricDataRecord
[]
>
();
const
ret
=
new
Map
<
string
,
MetricDataRecord
[]
>
();
for
(
const
metric
of
metrics
)
{
for
(
const
metric
of
metrics
)
{
const
trialId
=
`
${
metric
.
trialJobId
}
-
${
metric
.
parameterId
}
`
;
if
(
ret
.
has
(
metric
.
trialJobId
))
{
metric
.
trialId
=
trialId
;
if
(
ret
.
has
(
trialId
))
{
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
ret
.
get
(
trialId
)
!
.
push
(
metric
);
ret
.
get
(
metric
.
trial
Job
Id
)
!
.
push
(
metric
);
}
else
{
}
else
{
ret
.
set
(
trialId
,
[
metric
]);
ret
.
set
(
metric
.
trial
Job
Id
,
[
metric
]);
}
}
}
}
// to compatiable with multi-trial in same job, fix offset of sequence
ret
.
forEach
((
trialMetrics
)
=>
{
let
minSequenceNumber
=
Number
.
POSITIVE_INFINITY
;
trialMetrics
.
map
((
item
)
=>
{
if
(
item
.
sequence
<
minSequenceNumber
&&
item
.
type
!==
"
FINAL
"
)
{
minSequenceNumber
=
item
.
sequence
;
}
});
trialMetrics
.
map
((
item
)
=>
{
if
(
item
.
type
!==
"
FINAL
"
)
{
item
.
sequence
-=
minSequenceNumber
;
}
});
});
return
ret
;
return
ret
;
}
}
...
@@ -145,57 +129,6 @@ class TrialManager {
...
@@ -145,57 +129,6 @@ class TrialManager {
return
new
MetricSpace
([...
this
.
trials
.
values
()]);
return
new
MetricSpace
([...
this
.
trials
.
values
()]);
}
}
public
static
expandJobsToTrials
(
jobs
:
TrialJobInfo
[]):
TrialJobInfo
[]
{
const
trials
:
TrialJobInfo
[]
=
[];
for
(
const
jobInfo
of
jobs
as
TrialJobInfo
[])
{
if
(
jobInfo
.
hyperParameters
)
{
let
trial
:
TrialJobInfo
|
undefined
;
let
lastTrial
:
TrialJobInfo
|
undefined
;
for
(
let
i
=
0
;
i
<
jobInfo
.
hyperParameters
.
length
;
i
++
)
{
const
hyperParameters
=
jobInfo
.
hyperParameters
[
i
]
const
hpObject
=
JSON
.
parse
(
hyperParameters
);
const
parameterId
=
hpObject
[
"
parameter_id
"
];
trial
=
{
id
:
`
${
jobInfo
.
id
}
-
${
parameterId
}
`
,
jobId
:
jobInfo
.
id
,
parameterId
:
parameterId
,
sequenceId
:
parameterId
,
status
:
"
SUCCEEDED
"
,
startTime
:
jobInfo
.
startTime
,
endTime
:
jobInfo
.
startTime
,
hyperParameters
:
[
hyperParameters
],
logPath
:
jobInfo
.
logPath
,
stderrPath
:
jobInfo
.
stderrPath
,
};
if
(
jobInfo
.
finalMetricData
)
{
for
(
const
metricData
of
jobInfo
.
finalMetricData
)
{
if
(
metricData
.
parameterId
==
parameterId
)
{
trial
.
finalMetricData
=
[
metricData
];
trial
.
endTime
=
metricData
.
timestamp
;
break
;
}
}
}
if
(
lastTrial
)
{
trial
.
startTime
=
lastTrial
.
endTime
;
}
else
{
trial
.
startTime
=
jobInfo
.
startTime
;
}
lastTrial
=
trial
;
trials
.
push
(
trial
);
}
if
(
lastTrial
!==
undefined
)
{
lastTrial
.
status
=
jobInfo
.
status
;
lastTrial
.
endTime
=
jobInfo
.
endTime
;
}
}
else
{
trials
.
push
(
jobInfo
);
}
}
return
trials
;
}
// if this.jobListError = true, show trial error message [/trial-jobs]
// if this.jobListError = true, show trial error message [/trial-jobs]
public
jobListError
():
boolean
{
public
jobListError
():
boolean
{
return
this
.
isJobListError
;
return
this
.
isJobListError
;
...
@@ -239,9 +172,7 @@ class TrialManager {
...
@@ -239,9 +172,7 @@ class TrialManager {
let
updated
=
false
;
let
updated
=
false
;
requestAxios
(
`
${
MANAGER_IP
}
/trial-jobs`
)
requestAxios
(
`
${
MANAGER_IP
}
/trial-jobs`
)
.
then
(
data
=>
{
.
then
(
data
=>
{
const
newTrials
=
TrialManager
.
expandJobsToTrials
(
data
as
any
);
for
(
const
trialInfo
of
data
as
TrialJobInfo
[])
{
this
.
trialJobList
=
newTrials
;
for
(
const
trialInfo
of
newTrials
as
TrialJobInfo
[])
{
if
(
this
.
trials
.
has
(
trialInfo
.
id
))
{
if
(
this
.
trials
.
has
(
trialInfo
.
id
))
{
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
updated
=
this
.
trials
.
get
(
trialInfo
.
id
)
!
.
updateTrialJobInfo
(
trialInfo
)
||
updated
;
updated
=
this
.
trials
.
get
(
trialInfo
.
id
)
!
.
updateTrialJobInfo
(
trialInfo
)
||
updated
;
...
...
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