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
e640ad6f
Unverified
Commit
e640ad6f
authored
May 25, 2020
by
SparkSnail
Committed by
GitHub
May 25, 2020
Browse files
Fix storage logic (#2488)
parent
8d8fcd28
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
19 deletions
+15
-19
src/nni_manager/training_service/kubernetes/kubernetesData.ts
...nni_manager/training_service/kubernetes/kubernetesData.ts
+4
-4
src/nni_manager/training_service/local/localTrainingService.ts
...ni_manager/training_service/local/localTrainingService.ts
+2
-4
src/nni_manager/training_service/pai/paiK8S/paiK8SData.ts
src/nni_manager/training_service/pai/paiK8S/paiK8SData.ts
+2
-2
src/nni_manager/training_service/pai/paiK8S/paiK8STrainingService.ts
...ager/training_service/pai/paiK8S/paiK8STrainingService.ts
+0
-2
src/nni_manager/training_service/remote_machine/extends/linuxCommands.ts
.../training_service/remote_machine/extends/linuxCommands.ts
+4
-4
src/nni_manager/training_service/remote_machine/extends/windowsCommands.ts
...raining_service/remote_machine/extends/windowsCommands.ts
+3
-3
No files found.
src/nni_manager/training_service/kubernetes/kubernetesData.ts
View file @
e640ad6f
...
...
@@ -47,10 +47,10 @@ export NNI_EXP_ID={4}
export NNI_CODE_DIR={5}
export NNI_TRIAL_SEQ_ID={6}
{7}
mkdir -p $NNI_SYS_DIR
mkdir -p $NNI_SYS_DIR
/code
mkdir -p $NNI_OUTPUT_DIR
cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR
cd
$NNI_SYS_DIR
sh install_nni.sh
cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR
/code
sh
$NNI_SYS_DIR
/install_nni.sh
cd $NNI_SYS_DIR/code
python3 -m nni_trial_tool.trial_keeper --trial_command '{8}' --nnimanager_ip {9} --nnimanager_port {10} \
--nni_manager_version '{11}' --log_collection '{12}' 1>$NNI_OUTPUT_DIR/trialkeeper_stdout 2>$NNI_OUTPUT_DIR/trialkeeper_stderr`
;
src/nni_manager/training_service/local/localTrainingService.ts
View file @
e640ad6f
...
...
@@ -477,16 +477,14 @@ class LocalTrainingService implements TrainingService {
private
getScript
(
localTrialConfig
:
TrialConfig
,
workingDirectory
:
string
):
string
[]
{
const
script
:
string
[]
=
[];
if
(
process
.
platform
===
'
win32
'
)
{
script
.
push
(
`Copy-Item $env:NNI_CODE_DIR\\* -Destination $env:NNI_SYS_DIR -Recurse`
);
script
.
push
(
`cd $env:NNI_SYS_DIR`
);
script
.
push
(
`cd $env:NNI_CODE_DIR`
);
script
.
push
(
`cmd.exe /c
${
localTrialConfig
.
command
}
2>"
${
path
.
join
(
workingDirectory
,
'
stderr
'
)}
"`
,
`$NOW_DATE = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds`
,
`$NOW_DATE = "$NOW_DATE" + (Get-Date -Format fff).ToString()`
,
`Write $LASTEXITCODE " " $NOW_DATE | Out-File "
${
path
.
join
(
workingDirectory
,
'
.nni
'
,
'
state
'
)}
" -NoNewline -encoding utf8`
);
}
else
{
script
.
push
(
`cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR`
);
script
.
push
(
`cd $NNI_SYS_DIR`
);
script
.
push
(
`cd $NNI_CODE_DIR`
);
script
.
push
(
`eval
${
localTrialConfig
.
command
}
2>"
${
path
.
join
(
workingDirectory
,
'
stderr
'
)}
"`
);
if
(
process
.
platform
===
'
darwin
'
)
{
// https://superuser.com/questions/599072/how-to-get-bash-execution-time-in-milliseconds-under-mac-os-x
...
...
src/nni_manager/training_service/pai/paiK8S/paiK8SData.ts
View file @
e640ad6f
...
...
@@ -31,6 +31,6 @@ fi`;
export
const
PAI_K8S_TRIAL_COMMAND_FORMAT
:
string
=
`export NNI_PLATFORM=pai NNI_SYS_DIR={0} NNI_OUTPUT_DIR={1} NNI_TRIAL_JOB_ID={2} NNI_EXP_ID={3} NNI_TRIAL_SEQ_ID={4} MULTI_PHASE={5} \
&& NNI_CODE_DIR={6} && cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR &&
cd
$NNI_SYS_DIR
&& sh
install_nni.sh \
&& python3 -m nni_trial_tool.trial_keeper --trial_command '{7}' --nnimanager_ip '{8}' --nnimanager_port '{9}' \
&& NNI_CODE_DIR={6} &&
mkdir -p $NNI_SYS_DIR/code &&
cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR
/code
&&
sh
$NNI_SYS_DIR
/
install_nni.sh \
&& cd $NNI_SYS_DIR/code
&& python3 -m nni_trial_tool.trial_keeper --trial_command '{7}' --nnimanager_ip '{8}' --nnimanager_port '{9}' \
--nni_manager_version '{10}' --log_collection '{11}'`
;
src/nni_manager/training_service/pai/paiK8S/paiK8STrainingService.ts
View file @
e640ad6f
...
...
@@ -290,8 +290,6 @@ class PAIK8STrainingService extends PAITrainingService {
await
this
.
writeParameterFile
(
trialJobDetail
.
logPath
,
trialJobDetail
.
form
.
hyperParameters
);
}
//Copy codeDir files to local working folder
await
execCopydir
(
this
.
paiTrialConfig
.
codeDir
,
trialJobDetail
.
logPath
);
//Generate Job Configuration in yaml format
const
paiJobConfig
=
this
.
generateJobConfigInYamlFormat
(
trialJobDetail
);
this
.
log
.
debug
(
paiJobConfig
);
...
...
src/nni_manager/training_service/remote_machine/extends/linuxCommands.ts
View file @
e640ad6f
...
...
@@ -22,10 +22,10 @@ class LinuxCommands extends OsCommands {
export NNI_PLATFORM=remote NNI_SYS_DIR=
${
workingDirectory
}
NNI_OUTPUT_DIR=
${
workingDirectory
}
NNI_TRIAL_JOB_ID=
${
trialJobId
}
\
NNI_EXP_ID=
${
experimentId
}
NNI_TRIAL_SEQ_ID=
${
trialSequenceId
}
NNI_CODE_DIR=
${
codeDir
}
export MULTI_PHASE=
${
isMultiPhase
}
cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR
cd
$NNI_SYS_DIR
sh install_nni.sh
mkdir -p $NNI_SYS_DIR/code
cp -r $NNI_CODE_DIR/. $NNI_SYS_DIR
/code
sh
$NNI_SYS_DIR
/install_nni.sh
cd $NNI_SYS_DIR/code
python3 -m nni_trial_tool.trial_keeper --trial_command '
${
cudaVisibleSetting
}
${
command
}
' --nnimanager_ip '
${
nniManagerAddress
}
' \
--nnimanager_port '
${
nniManagerPort
}
' --nni_manager_version '
${
nniManagerVersion
}
' \
--job_id_file
${
jobIdFileName
}
\
...
...
src/nni_manager/training_service/remote_machine/extends/windowsCommands.ts
View file @
e640ad6f
...
...
@@ -28,9 +28,9 @@ class WindowsCommands extends OsCommands {
set MULTI_PHASE=
${
isMultiPhase
}
set NNI_CODE_DIR=
${
codeDir
}
${
cudaVisibleSetting
!==
""
?
"
set
"
+
cudaVisibleSetting
:
""
}
robocopy /s %NNI_CODE_DIR%/. %NNI_SYS_DIR%
cd %NNI_SYS_DIR%
md %NNI_SYS_DIR%/code
robocopy /s %NNI_CODE_DIR%/. %NNI_SYS_DIR%
/code
cd %NNI_SYS_DIR%
/code
python -c "import nni" 2>nul
if not %ERRORLEVEL% EQU 0 (
echo installing NNI as exit code of "import nni" is %ERRORLEVEL%
...
...
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