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
6d9f545a
Unverified
Commit
6d9f545a
authored
Dec 18, 2019
by
chicm-ms
Committed by
GitHub
Dec 18, 2019
Browse files
Fix local system as remote machine issue #1852 (#1856)
* Fix local system as remote machine issue #1852
parent
fb6fae94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
src/nni_manager/training_service/remote_machine/remoteMachineTrainingService.ts
...ng_service/remote_machine/remoteMachineTrainingService.ts
+1
-1
src/nni_manager/training_service/remote_machine/sshClientUtility.ts
...nager/training_service/remote_machine/sshClientUtility.ts
+3
-7
No files found.
src/nni_manager/training_service/remote_machine/remoteMachineTrainingService.ts
View file @
6d9f545a
...
@@ -442,7 +442,7 @@ class RemoteMachineTrainingService implements TrainingService {
...
@@ -442,7 +442,7 @@ class RemoteMachineTrainingService implements TrainingService {
async
(
tick
:
number
)
=>
{
async
(
tick
:
number
)
=>
{
const
cmdresult
:
RemoteCommandResult
=
await
SSHClientUtility
.
remoteExeCommand
(
const
cmdresult
:
RemoteCommandResult
=
await
SSHClientUtility
.
remoteExeCommand
(
`tail -n 1
${
unixPathJoin
(
remoteGpuScriptCollectorDir
,
'
gpu_metrics
'
)}
`
,
conn
);
`tail -n 1
${
unixPathJoin
(
remoteGpuScriptCollectorDir
,
'
gpu_metrics
'
)}
`
,
conn
);
if
(
cmdresult
!==
undefined
&&
cmdresult
.
stdout
!==
undefined
)
{
if
(
cmdresult
!==
undefined
&&
cmdresult
.
stdout
!==
undefined
&&
cmdresult
.
stdout
.
length
>
0
)
{
rmMeta
.
gpuSummary
=
<
GPUSummary
>
JSON
.
parse
(
cmdresult
.
stdout
);
rmMeta
.
gpuSummary
=
<
GPUSummary
>
JSON
.
parse
(
cmdresult
.
stdout
);
if
(
rmMeta
.
gpuSummary
.
gpuCount
===
0
)
{
if
(
rmMeta
.
gpuSummary
.
gpuCount
===
0
)
{
this
.
log
.
warning
(
`No GPU found on remote machine
${
rmMeta
.
ip
}
`
);
this
.
log
.
warning
(
`No GPU found on remote machine
${
rmMeta
.
ip
}
`
);
...
...
src/nni_manager/training_service/remote_machine/sshClientUtility.ts
View file @
6d9f545a
...
@@ -101,10 +101,9 @@ export namespace SSHClientUtility {
...
@@ -101,10 +101,9 @@ export namespace SSHClientUtility {
* @param sshClient SSH client
* @param sshClient SSH client
*/
*/
export
async
function
copyDirectoryToRemote
(
localDirectory
:
string
,
remoteDirectory
:
string
,
sshClient
:
Client
,
remoteOS
:
string
):
Promise
<
void
>
{
export
async
function
copyDirectoryToRemote
(
localDirectory
:
string
,
remoteDirectory
:
string
,
sshClient
:
Client
,
remoteOS
:
string
):
Promise
<
void
>
{
const
deferred
:
Deferred
<
void
>
=
new
Deferred
<
void
>
();
const
tmpSuffix
:
string
=
uniqueString
(
5
);
const
tmpTarName
:
string
=
`
${
uniqueString
(
10
)}
.tar.gz`
;
const
localTarPath
:
string
=
path
.
join
(
os
.
tmpdir
(),
`nni_tmp_local_
${
tmpSuffix
}
.tar.gz`
);
const
localTarPath
:
string
=
path
.
join
(
os
.
tmpdir
(),
tmpTarName
);
const
remoteTarPath
:
string
=
unixPathJoin
(
getRemoteTmpDir
(
remoteOS
),
`nni_tmp_remote_
${
tmpSuffix
}
.tar.gz`
);
const
remoteTarPath
:
string
=
unixPathJoin
(
getRemoteTmpDir
(
remoteOS
),
tmpTarName
);
// Compress files in local directory to experiment root directory
// Compress files in local directory to experiment root directory
await
tarAdd
(
localTarPath
,
localDirectory
);
await
tarAdd
(
localTarPath
,
localDirectory
);
...
@@ -114,9 +113,6 @@ export namespace SSHClientUtility {
...
@@ -114,9 +113,6 @@ export namespace SSHClientUtility {
// Decompress the remote compressed file in and delete it
// Decompress the remote compressed file in and delete it
await
remoteExeCommand
(
`tar -oxzf
${
remoteTarPath
}
-C
${
remoteDirectory
}
`
,
sshClient
);
await
remoteExeCommand
(
`tar -oxzf
${
remoteTarPath
}
-C
${
remoteDirectory
}
`
,
sshClient
);
await
remoteExeCommand
(
`rm
${
remoteTarPath
}
`
,
sshClient
);
await
remoteExeCommand
(
`rm
${
remoteTarPath
}
`
,
sshClient
);
deferred
.
resolve
();
return
deferred
.
promise
;
}
}
export
function
getRemoteFileContent
(
filePath
:
string
,
sshClient
:
Client
):
Promise
<
string
>
{
export
function
getRemoteFileContent
(
filePath
:
string
,
sshClient
:
Client
):
Promise
<
string
>
{
...
...
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