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
2f5272c7
"...gpu/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "8fd952965694973c7ac541b9aa42a7ab6979249a"
Unverified
Commit
2f5272c7
authored
Oct 24, 2019
by
SparkSnail
Committed by
GitHub
Oct 24, 2019
Browse files
Merge pull request #208 from microsoft/master
merge master
parents
c785655e
7a20792a
Changes
49
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
50 deletions
+91
-50
src/webui/src/components/trial-detail/Intermediate.tsx
src/webui/src/components/trial-detail/Intermediate.tsx
+7
-7
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+37
-20
src/webui/src/static/img/icon/ques.png
src/webui/src/static/img/icon/ques.png
+0
-0
src/webui/src/static/model/trial.ts
src/webui/src/static/model/trial.ts
+2
-2
src/webui/src/static/style/button.scss
src/webui/src/static/style/button.scss
+1
-1
src/webui/src/static/style/logDrawer.scss
src/webui/src/static/style/logDrawer.scss
+2
-1
src/webui/src/static/style/slideBar.scss
src/webui/src/static/style/slideBar.scss
+6
-1
src/webui/src/static/style/trialsDetail.scss
src/webui/src/static/style/trialsDetail.scss
+2
-0
tools/nni_cmd/command_utils.py
tools/nni_cmd/command_utils.py
+34
-18
No files found.
src/webui/src/components/trial-detail/Intermediate.tsx
View file @
2f5272c7
...
...
@@ -262,16 +262,10 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
<
div
>
{
/* style in para.scss */
}
<
Row
className
=
"meline intermediate"
>
{
/* filter message */
}
<
span
>
Filter
</
span
>
<
Switch
defaultChecked
=
{
false
}
onChange
=
{
this
.
switchTurn
}
/>
{
isFilter
?
<
span
>
<
span
style
=
{
{
marginRight
:
15
}
}
>
<
span
className
=
"filter-x"
>
# Intermediate result
</
span
>
<
input
// placeholder="point"
...
...
@@ -300,6 +294,12 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
:
null
}
{
/* filter message */
}
<
span
>
Filter
</
span
>
<
Switch
defaultChecked
=
{
false
}
onChange
=
{
this
.
switchTurn
}
/>
</
Row
>
<
Row
className
=
"intermediate-graph"
>
<
ReactEcharts
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
2f5272c7
...
...
@@ -251,13 +251,15 @@ class TableList extends React.Component<TableListProps, TableListState> {
const
showColumn
:
Array
<
object
>
=
[];
// parameter as table column
const
trialMess
=
TRIALS
.
getTrial
(
tableSource
[
0
].
id
);
const
trial
=
trialMess
.
description
.
parameters
;
const
parameterColumn
:
Array
<
string
>
=
Object
.
keys
(
trial
);
const
parameterStr
:
Array
<
string
>
=
[];
parameterColumn
.
forEach
(
value
=>
{
parameterStr
.
push
(
`
${
value
}
(search space)`
);
});
if
(
tableSource
.
length
>
0
)
{
const
trialMess
=
TRIALS
.
getTrial
(
tableSource
[
0
].
id
);
const
trial
=
trialMess
.
description
.
parameters
;
const
parameterColumn
:
Array
<
string
>
=
Object
.
keys
(
trial
);
parameterColumn
.
forEach
(
value
=>
{
parameterStr
.
push
(
`
${
value
}
(search space)`
);
});
}
showTitle
=
COLUMNPro
.
concat
(
parameterStr
);
// only succeed trials have final keys
...
...
@@ -330,20 +332,35 @@ class TableList extends React.Component<TableListProps, TableListState> {
<
Icon
type
=
"line-chart"
/>
</
Button
>
{
/* kill job */
}
<
Popconfirm
title
=
"Are you sure to cancel this trial?"
onConfirm
=
{
killJob
.
bind
(
this
,
record
.
key
,
record
.
id
,
record
.
status
)
}
>
<
Button
type
=
"default"
disabled
=
{
flag
}
className
=
"margin-mediate special"
title
=
"kill"
>
<
Icon
type
=
"stop"
/>
</
Button
>
</
Popconfirm
>
{
flag
?
<
Button
type
=
"default"
disabled
=
{
true
}
className
=
"margin-mediate special"
title
=
"kill"
>
<
Icon
type
=
"stop"
/>
</
Button
>
:
<
Popconfirm
title
=
"Are you sure to cancel this trial?"
okText
=
"Yes"
cancelText
=
"No"
onConfirm
=
{
killJob
.
bind
(
this
,
record
.
key
,
record
.
id
,
record
.
status
)
}
>
<
Button
type
=
"default"
disabled
=
{
false
}
className
=
"margin-mediate special"
title
=
"kill"
>
<
Icon
type
=
"stop"
/>
</
Button
>
</
Popconfirm
>
}
</
Row
>
);
},
...
...
src/webui/src/static/img/icon/ques.png
0 → 100644
View file @
2f5272c7
452 Bytes
src/webui/src/static/model/trial.ts
View file @
2f5272c7
...
...
@@ -43,7 +43,7 @@ class Trial implements TableObj {
}
get
sortable
():
boolean
{
return
this
.
finalAcc
!==
undefined
&&
!
isNaN
(
this
.
finalAcc
);
return
this
.
metricsInitialized
&&
this
.
finalAcc
!==
undefined
&&
!
isNaN
(
this
.
finalAcc
);
}
/* table obj start */
...
...
@@ -132,7 +132,7 @@ class Trial implements TableObj {
/* table obj end */
public
initialized
():
boolean
{
return
!!
(
this
.
infoField
&&
this
.
metricsInitialized
);
return
Boolean
(
this
.
infoField
);
}
public
updateMetrics
(
metrics
:
MetricDataRecord
[]):
boolean
{
...
...
src/webui/src/static/style/button.scss
View file @
2f5272c7
...
...
@@ -6,7 +6,7 @@ Button.tableButton{
border-color
:
$btnBgcolor
;
height
:
26px
;
font-size
:
14px
;
margin-top
:
2
px
;
margin-top
:
4
px
;
border-radius
:
0
;
}
...
...
src/webui/src/static/style/logDrawer.scss
View file @
2f5272c7
...
...
@@ -25,8 +25,9 @@
height
:
100%
;
}
/* log drawer download & close button's row */
.buttons
{
margin-top
:
1
1
px
;
margin-top
:
1
6
px
;
.close
{
text-align
:
right
;
}
...
...
src/webui/src/static/style/slideBar.scss
View file @
2f5272c7
...
...
@@ -21,7 +21,7 @@ $drowHoverBgColor: #e2e2e2;
padding-bottom
:
14px
;
.down-icon
{
font-size
:
20px
!
important
;
padding-right
:
2
px
;
padding-right
:
6
px
;
}
}
...
...
@@ -186,6 +186,11 @@ $drowHoverBgColor: #e2e2e2;
width
:
20px
;
margin-right
:
8px
;
}
/* ? icon style */
.question
{
width
:
14px
;
margin-right
:
4px
;
}
.feedback
{
font-size
:
16px
;
margin
:
0
20px
;
...
...
src/webui/src/static/style/trialsDetail.scss
View file @
2f5272c7
...
...
@@ -15,10 +15,12 @@
.ant-tabs-tab-active
{
.panelTitle
{
background-color
:
#999
;
/*
span{
color: #fff;
font-weight: normal;
}
*/
}
}
.panelTitle
{
...
...
tools/nni_cmd/command_utils.py
View file @
2f5272c7
...
...
@@ -3,10 +3,11 @@ import sys
import
os
import
signal
import
psutil
from
.common_utils
import
print_error
,
print_normal
,
print_warning
from
.common_utils
import
print_error
,
print_normal
,
print_warning
def
check_output_command
(
file_path
,
head
=
None
,
tail
=
None
):
'''
call check_output command to read content from a file
'''
"""
call check_output command to read content from a file
"""
if
os
.
path
.
exists
(
file_path
):
if
sys
.
platform
==
'win32'
:
cmds
=
[
'powershell.exe'
,
'type'
,
file_path
]
...
...
@@ -26,8 +27,9 @@ def check_output_command(file_path, head=None, tail=None):
print_error
(
'{0} does not exist!'
.
format
(
file_path
))
exit
(
1
)
def
kill_command
(
pid
):
'''
kill command
'''
"""
kill command
"""
if
sys
.
platform
==
'win32'
:
process
=
psutil
.
Process
(
pid
=
pid
)
process
.
send_signal
(
signal
.
CTRL_BREAK_EVENT
)
...
...
@@ -35,21 +37,35 @@ def kill_command(pid):
cmds
=
[
'kill'
,
str
(
pid
)]
call
(
cmds
)
def
install_package_command
(
package_name
):
'''install python package from pip'''
#TODO refactor python logic
if
sys
.
platform
==
"win32"
:
cmds
=
'python -m pip install --user {0}'
.
format
(
package_name
)
else
:
cmds
=
'python3 -m pip install --user {0}'
.
format
(
package_name
)
call
(
cmds
,
shell
=
True
)
"""
Install python package from pip.
Parameters
----------
package_name: str
The name of package to be installed.
"""
call
(
_get_pip_install
()
+
[
package_name
],
shell
=
False
)
def
install_requirements_command
(
requirements_path
):
'''install requirements.txt'''
cmds
=
'cd '
+
requirements_path
+
' && {0} -m pip install --user -r requirements.txt'
#TODO refactor python logic
if
sys
.
platform
==
"win32"
:
cmds
=
cmds
.
format
(
'python'
)
else
:
cmds
=
cmds
.
format
(
'python3'
)
call
(
cmds
,
shell
=
True
)
"""
Install packages from `requirements.txt` in `requirements_path`.
Parameters
----------
requirements_path: str
Path to the directory that contains `requirements.txt`.
"""
call
(
_get_pip_install
()
+
[
"-r"
,
os
.
path
.
join
(
requirements_path
,
"requirements.txt"
)],
shell
=
False
)
def
_get_pip_install
():
python
=
"python"
if
sys
.
platform
==
"win32"
else
"python3"
ret
=
[
python
,
"-m"
,
"pip"
,
"install"
]
if
"CONDA_DEFAULT_ENV"
not
in
os
.
environ
and
"VIRTUAL_ENV"
not
in
os
.
environ
and
\
(
sys
.
platform
!=
"win32"
and
os
.
getuid
()
!=
0
):
# on unix and not running in root
ret
.
append
(
"--user"
)
# not in virtualenv or conda
return
ret
Prev
1
2
3
Next
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