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
55493edf
Commit
55493edf
authored
Nov 05, 2018
by
Gems Guo
Committed by
goooxu
Nov 09, 2018
Browse files
Fixed the issue that pip install --user doesn't work in docker as root user
parent
53ed465a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
25 deletions
+15
-25
deployment/pypi/Makefile
deployment/pypi/Makefile
+5
-10
src/nni_manager/training_service/local/localTrainingService.ts
...ni_manager/training_service/local/localTrainingService.ts
+7
-7
tools/nni_cmd/launcher.py
tools/nni_cmd/launcher.py
+3
-8
No files found.
deployment/pypi/Makefile
View file @
55493edf
...
...
@@ -9,16 +9,11 @@ build:
tar
xf
$(CWD)
node-linux-x64.tar.xz
-C
node-linux-x64
--strip-components
1
cd
$(CWD)
../../src/nni_manager
&&
yarn
&&
yarn build
cd
$(CWD)
../../src/webui
&&
yarn
&&
yarn build
rm
-rf
$(CWD)
nni_pkg
cp
-r
$(CWD)
../../src/nni_manager/dist
$(CWD)
nni_pkg
cp
-r
$(CWD)
../../src/webui/build
$(CWD)
nni_pkg/static
cp
$(CWD)
../../src/nni_manager/package.json
$(CWD)
nni_pkg
cd
$(CWD)
nni_pkg
&&
yarn
--prod
rm
-rf
$(CWD)
nnicmd
rm
-rf
$(CWD)
nni_annotation
cp
-r
$(CWD)
../../tools/nnicmd
$(CWD)
nnicmd
cp
-r
$(CWD)
../../tools/nni_annotation
$(CWD)
nni_annotation
cp
-r
$(CWD)
../../tools/trial_tool
$(CWD)
trial_tool
rm
-rf
$(CWD)
nni
cp
-r
$(CWD)
../../src/nni_manager/dist
$(CWD)
nni
cp
-r
$(CWD)
../../src/webui/build
$(CWD)
nni/static
cp
$(CWD)
../../src/nni_manager/package.json
$(CWD)
nni
cd
$(CWD)
nni
&&
yarn
--prod
cd
$(CWD)
&&
python3 setup.py bdist_wheel
cd
$(CWD)
../../src/sdk/pynni
&&
python3 setup.py bdist_wheel
cp
-r
$(CWD)
../../src/sdk/pynni/dist/
*
.whl
$(CWD)
dist
...
...
src/nni_manager/training_service/local/localTrainingService.ts
View file @
55493edf
...
...
@@ -283,11 +283,11 @@ class LocalTrainingService implements TrainingService {
public
getClusterMetadata
(
key
:
string
):
Promise
<
string
>
{
switch
(
key
)
{
case
TrialConfigMetadataKey
.
TRIAL_CONFIG
:
let
getResult
:
Promise
<
string
>
;
if
(
!
this
.
localTrailConfig
)
{
let
getResult
:
Promise
<
string
>
;
if
(
!
this
.
localTrailConfig
)
{
getResult
=
Promise
.
reject
(
new
NNIError
(
NNIErrorNames
.
NOT_FOUND
,
`
${
key
}
is never set yet`
));
}
else
{
getResult
=
Promise
.
resolve
(
!
this
.
localTrailConfig
?
''
:
JSON
.
stringify
(
this
.
localTrailConfig
));
getResult
=
Promise
.
resolve
(
!
this
.
localTrailConfig
?
''
:
JSON
.
stringify
(
this
.
localTrailConfig
));
}
return
getResult
;
default
:
...
...
@@ -297,7 +297,7 @@ class LocalTrainingService implements TrainingService {
public
cleanUp
():
Promise
<
void
>
{
this
.
stopping
=
true
;
for
(
const
stream
of
this
.
streams
)
{
for
(
const
stream
of
this
.
streams
)
{
stream
.
destroy
();
}
return
Promise
.
resolve
();
...
...
@@ -359,7 +359,7 @@ class LocalTrainingService implements TrainingService {
await
cpp
.
exec
(
`mkdir -p
${
trialJobDetail
.
workingDirectory
}
`
);
await
cpp
.
exec
(
`mkdir -p
${
path
.
join
(
trialJobDetail
.
workingDirectory
,
'
.nni
'
)}
`
);
await
cpp
.
exec
(
`touch
${
path
.
join
(
trialJobDetail
.
workingDirectory
,
'
.nni
'
,
'
metrics
'
)}
`
);
await
fs
.
promises
.
writeFile
(
path
.
join
(
trialJobDetail
.
workingDirectory
,
'
run.sh
'
),
runScriptLines
.
join
(
'
\n
'
),
{
encoding
:
'
utf8
'
});
await
fs
.
promises
.
writeFile
(
path
.
join
(
trialJobDetail
.
workingDirectory
,
'
run.sh
'
),
runScriptLines
.
join
(
'
\n
'
),
{
encoding
:
'
utf8
'
,
mode
:
0o777
});
await
this
.
writeParameterFile
(
trialJobDetail
.
workingDirectory
,
(
<
TrialJobApplicationForm
>
trialJobDetail
.
form
).
hyperParameters
);
await
this
.
writeSequenceIdFile
(
trialJobId
);
const
process
:
cp
.
ChildProcess
=
cp
.
exec
(
`bash
${
path
.
join
(
trialJobDetail
.
workingDirectory
,
'
run.sh
'
)}
`
);
...
...
tools/nni_cmd/launcher.py
View file @
55493edf
...
...
@@ -35,7 +35,6 @@ from .constants import *
import
time
import
random
import
string
import
site
from
pathlib
import
Path
...
...
@@ -67,12 +66,8 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
exit
(
1
)
print_normal
(
'Starting restful server...'
)
if
os
.
geteuid
()
==
0
:
site_dir
=
site
.
getsitepackages
()[
0
]
else
:
site_dir
=
site
.
getusersitepackages
()
python_dir
=
str
(
Path
(
site_dir
).
parents
[
2
])
cmds
=
[
'node'
,
os
.
path
.
join
(
python_dir
,
'nni'
,
'main.js'
),
'--port'
,
str
(
port
),
'--mode'
,
platform
,
'--start_mode'
,
mode
]
base_dir
=
str
(
Path
(
os
.
path
.
dirname
(
__file__
)).
parents
[
3
])
cmds
=
[
'node'
,
os
.
path
.
join
(
base_dir
,
'nni'
,
'main.js'
),
'--port'
,
str
(
port
),
'--mode'
,
platform
,
'--start_mode'
,
mode
]
if
mode
==
'resume'
:
cmds
+=
[
'--experiment_id'
,
experiment_id
]
stdout_full_path
,
stderr_full_path
=
get_log_path
(
config_file_name
)
...
...
@@ -83,7 +78,7 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
log_header
=
LOG_HEADER
%
str
(
time_now
)
stdout_file
.
write
(
log_header
)
stderr_file
.
write
(
log_header
)
process
=
Popen
(
cmds
,
cwd
=
os
.
path
.
join
(
python
_dir
,
'nni'
),
stdout
=
stdout_file
,
stderr
=
stderr_file
)
process
=
Popen
(
cmds
,
cwd
=
os
.
path
.
join
(
base
_dir
,
'nni'
),
stdout
=
stdout_file
,
stderr
=
stderr_file
)
return
process
,
str
(
time_now
)
def
set_trial_config
(
experiment_config
,
port
,
config_file_name
):
...
...
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