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
dec91f7e
Unverified
Commit
dec91f7e
authored
Dec 14, 2020
by
J-shang
Committed by
GitHub
Dec 14, 2020
Browse files
remove 'port' when stopped (#3181)
Co-authored-by:
Ning Shang
<
nishang@microsoft.com
>
parent
683c458a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
2 deletions
+12
-2
nni/tools/nnictl/config_utils.py
nni/tools/nnictl/config_utils.py
+4
-1
nni/tools/nnictl/nnictl_utils.py
nni/tools/nnictl/nnictl_utils.py
+1
-0
ts/nni_manager/core/nniExperimentsManager.ts
ts/nni_manager/core/nniExperimentsManager.ts
+6
-1
ts/nni_manager/core/nnimanager.ts
ts/nni_manager/core/nnimanager.ts
+1
-0
No files found.
nni/tools/nnictl/config_utils.py
View file @
dec91f7e
...
@@ -85,7 +85,10 @@ class Experiments:
...
@@ -85,7 +85,10 @@ class Experiments:
self
.
experiments
=
self
.
read_file
()
self
.
experiments
=
self
.
read_file
()
if
expId
not
in
self
.
experiments
:
if
expId
not
in
self
.
experiments
:
return
False
return
False
self
.
experiments
[
expId
][
key
]
=
value
if
value
is
None
:
self
.
experiments
[
expId
].
pop
(
key
,
None
)
else
:
self
.
experiments
[
expId
][
key
]
=
value
self
.
write_file
()
self
.
write_file
()
return
True
return
True
...
...
nni/tools/nnictl/nnictl_utils.py
View file @
dec91f7e
...
@@ -54,6 +54,7 @@ def update_experiment():
...
@@ -54,6 +54,7 @@ def update_experiment():
rest_pid
=
nni_config
.
get_config
(
'restServerPid'
)
rest_pid
=
nni_config
.
get_config
(
'restServerPid'
)
if
not
detect_process
(
rest_pid
):
if
not
detect_process
(
rest_pid
):
experiment_config
.
update_experiment
(
key
,
'status'
,
'STOPPED'
)
experiment_config
.
update_experiment
(
key
,
'status'
,
'STOPPED'
)
experiment_config
.
update_experiment
(
key
,
'port'
,
None
)
continue
continue
def
check_experiment_id
(
args
,
update
=
True
):
def
check_experiment_id
(
args
,
update
=
True
):
...
...
ts/nni_manager/core/nniExperimentsManager.ts
View file @
dec91f7e
...
@@ -77,7 +77,11 @@ class NNIExperimentsManager implements ExperimentManager {
...
@@ -77,7 +77,11 @@ class NNIExperimentsManager implements ExperimentManager {
this
.
withLockSync
(()
=>
{
this
.
withLockSync
(()
=>
{
const
experimentsInformation
=
JSON
.
parse
(
fs
.
readFileSync
(
this
.
experimentsPath
).
toString
());
const
experimentsInformation
=
JSON
.
parse
(
fs
.
readFileSync
(
this
.
experimentsPath
).
toString
());
assert
(
experimentId
in
experimentsInformation
,
`Experiment Manager: Experiment Id
${
experimentId
}
not found, this should not happen`
);
assert
(
experimentId
in
experimentsInformation
,
`Experiment Manager: Experiment Id
${
experimentId
}
not found, this should not happen`
);
experimentsInformation
[
experimentId
][
key
]
=
value
;
if
(
value
!==
undefined
)
{
experimentsInformation
[
experimentId
][
key
]
=
value
;
}
else
{
delete
experimentsInformation
[
experimentId
][
key
];
}
fs
.
writeFileSync
(
this
.
experimentsPath
,
JSON
.
stringify
(
experimentsInformation
,
null
,
4
));
fs
.
writeFileSync
(
this
.
experimentsPath
,
JSON
.
stringify
(
experimentsInformation
,
null
,
4
));
});
});
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -128,6 +132,7 @@ class NNIExperimentsManager implements ExperimentManager {
...
@@ -128,6 +132,7 @@ class NNIExperimentsManager implements ExperimentManager {
updateList
.
forEach
((
expId
:
string
)
=>
{
updateList
.
forEach
((
expId
:
string
)
=>
{
if
(
experimentsInformation
[
expId
])
{
if
(
experimentsInformation
[
expId
])
{
experimentsInformation
[
expId
][
'
status
'
]
=
'
STOPPED
'
;
experimentsInformation
[
expId
][
'
status
'
]
=
'
STOPPED
'
;
delete
experimentsInformation
[
expId
][
'
port
'
];
}
else
{
}
else
{
this
.
log
.
error
(
`Experiment Manager: Experiment Id
${
expId
}
not found, this should not happen`
);
this
.
log
.
error
(
`Experiment Manager: Experiment Id
${
expId
}
not found, this should not happen`
);
}
}
...
...
ts/nni_manager/core/nnimanager.ts
View file @
dec91f7e
...
@@ -480,6 +480,7 @@ class NNIManager implements Manager {
...
@@ -480,6 +480,7 @@ class NNIManager implements Manager {
}
}
await
this
.
storeExperimentProfile
();
await
this
.
storeExperimentProfile
();
this
.
setStatus
(
'
STOPPED
'
);
this
.
setStatus
(
'
STOPPED
'
);
this
.
experimentManager
.
setExperimentInfo
(
this
.
experimentProfile
.
id
,
'
port
'
,
undefined
);
}
}
private
async
periodicallyUpdateExecDuration
():
Promise
<
void
>
{
private
async
periodicallyUpdateExecDuration
():
Promise
<
void
>
{
...
...
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