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
521f1917
Unverified
Commit
521f1917
authored
Jun 03, 2021
by
liuzhe-lz
Committed by
GitHub
Jun 03, 2021
Browse files
Fix a logging related bug (#3705)
parent
b7c91e73
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
18 additions
and
18 deletions
+18
-18
ts/nni_manager/training_service/remote_machine/gpuScheduler.ts
...i_manager/training_service/remote_machine/gpuScheduler.ts
+1
-1
ts/nni_manager/training_service/remote_machine/remoteMachineTrainingService.ts
...ng_service/remote_machine/remoteMachineTrainingService.ts
+1
-1
ts/nni_manager/training_service/remote_machine/shellExecutor.ts
..._manager/training_service/remote_machine/shellExecutor.ts
+1
-1
ts/nni_manager/training_service/reusable/channels/webCommandChannel.ts
...r/training_service/reusable/channels/webCommandChannel.ts
+2
-2
ts/nni_manager/training_service/reusable/commandChannel.ts
ts/nni_manager/training_service/reusable/commandChannel.ts
+1
-1
ts/nni_manager/training_service/reusable/environment.ts
ts/nni_manager/training_service/reusable/environment.ts
+2
-2
ts/nni_manager/training_service/reusable/environments/amlEnvironmentService.ts
...ng_service/reusable/environments/amlEnvironmentService.ts
+1
-1
ts/nni_manager/training_service/reusable/environments/localEnvironmentService.ts
..._service/reusable/environments/localEnvironmentService.ts
+1
-1
ts/nni_manager/training_service/reusable/environments/openPaiEnvironmentService.ts
...ervice/reusable/environments/openPaiEnvironmentService.ts
+3
-3
ts/nni_manager/training_service/reusable/environments/remoteEnvironmentService.ts
...service/reusable/environments/remoteEnvironmentService.ts
+1
-1
ts/nni_manager/training_service/reusable/gpuScheduler.ts
ts/nni_manager/training_service/reusable/gpuScheduler.ts
+1
-1
ts/nni_manager/training_service/reusable/shared_storages/azureblobStorageService.ts
...rvice/reusable/shared_storages/azureblobStorageService.ts
+1
-1
ts/nni_manager/training_service/reusable/shared_storages/nfsStorageService.ts
...ing_service/reusable/shared_storages/nfsStorageService.ts
+1
-1
ts/nni_manager/training_service/reusable/storageService.ts
ts/nni_manager/training_service/reusable/storageService.ts
+1
-1
No files found.
ts/nni_manager/training_service/remote_machine/gpuScheduler.ts
View file @
521f1917
...
@@ -18,7 +18,7 @@ type SCHEDULE_POLICY_NAME = 'random' | 'round-robin';
...
@@ -18,7 +18,7 @@ type SCHEDULE_POLICY_NAME = 'random' | 'round-robin';
export
class
GPUScheduler
{
export
class
GPUScheduler
{
private
readonly
machineExecutorMap
:
Map
<
RemoteMachineConfig
,
ExecutorManager
>
;
private
readonly
machineExecutorMap
:
Map
<
RemoteMachineConfig
,
ExecutorManager
>
;
private
readonly
log
:
Logger
=
getLogger
();
private
readonly
log
:
Logger
=
getLogger
(
'
GPUScheduler
'
);
private
readonly
policyName
:
SCHEDULE_POLICY_NAME
=
'
round-robin
'
;
private
readonly
policyName
:
SCHEDULE_POLICY_NAME
=
'
round-robin
'
;
private
roundRobinIndex
:
number
=
0
;
private
roundRobinIndex
:
number
=
0
;
private
configuredRMs
:
RemoteMachineMeta
[]
=
[];
private
configuredRMs
:
RemoteMachineMeta
[]
=
[];
...
...
ts/nni_manager/training_service/remote_machine/remoteMachineTrainingService.ts
View file @
521f1917
...
@@ -67,7 +67,7 @@ class RemoteMachineTrainingService implements TrainingService {
...
@@ -67,7 +67,7 @@ class RemoteMachineTrainingService implements TrainingService {
this
.
sshConnectionPromises
=
[];
this
.
sshConnectionPromises
=
[];
this
.
expRootDir
=
getExperimentRootDir
();
this
.
expRootDir
=
getExperimentRootDir
();
this
.
timer
=
component
.
get
(
ObservableTimer
);
this
.
timer
=
component
.
get
(
ObservableTimer
);
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
RemoteMachineTrainingService
'
);
this
.
log
.
info
(
'
Construct remote machine training service.
'
);
this
.
log
.
info
(
'
Construct remote machine training service.
'
);
this
.
config
=
flattenConfig
(
config
,
'
remote
'
);
this
.
config
=
flattenConfig
(
config
,
'
remote
'
);
...
...
ts/nni_manager/training_service/remote_machine/shellExecutor.ts
View file @
521f1917
...
@@ -36,7 +36,7 @@ class ShellExecutor {
...
@@ -36,7 +36,7 @@ class ShellExecutor {
public
isWindows
:
boolean
=
false
;
public
isWindows
:
boolean
=
false
;
constructor
()
{
constructor
()
{
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
ShellExecutor
'
);
this
.
sshClient
=
new
Client
();
this
.
sshClient
=
new
Client
();
}
}
...
...
ts/nni_manager/training_service/reusable/channels/webCommandChannel.ts
View file @
521f1917
...
@@ -61,7 +61,7 @@ export class WebCommandChannel extends CommandChannel {
...
@@ -61,7 +61,7 @@ export class WebCommandChannel extends CommandChannel {
this
.
webSocketServer
.
on
(
'
connection
'
,
(
client
:
WebSocket
)
=>
{
this
.
webSocketServer
.
on
(
'
connection
'
,
(
client
:
WebSocket
)
=>
{
this
.
log
.
debug
(
`WebCommandChannel: received connection`
);
this
.
log
.
debug
(
`WebCommandChannel: received connection`
);
client
.
onerror
=
(
event
):
void
=>
{
client
.
onerror
=
(
event
):
void
=>
{
this
.
log
.
error
(
`
error on client
${
JSON
.
stringify
(
event
)
}
`
)
;
this
.
log
.
error
(
'
error on client
'
,
event
);
}
}
this
.
clients
.
set
(
client
,
undefined
);
this
.
clients
.
set
(
client
,
undefined
);
...
@@ -109,7 +109,7 @@ export class WebCommandChannel extends CommandChannel {
...
@@ -109,7 +109,7 @@ export class WebCommandChannel extends CommandChannel {
// undefined means it's expecting initializing message.
// undefined means it's expecting initializing message.
const
commands
=
this
.
parseCommands
(
rawCommands
);
const
commands
=
this
.
parseCommands
(
rawCommands
);
let
isValid
=
false
;
let
isValid
=
false
;
this
.
log
.
debug
(
`
WebCommandChannel: received initialize message:
${
JSON
.
stringify
(
rawCommands
)
}
`
)
;
this
.
log
.
debug
(
'
WebCommandChannel: received initialize message:
'
,
rawCommands
);
if
(
commands
.
length
>
0
)
{
if
(
commands
.
length
>
0
)
{
const
commandType
=
commands
[
0
][
0
];
const
commandType
=
commands
[
0
][
0
];
...
...
ts/nni_manager/training_service/reusable/commandChannel.ts
View file @
521f1917
...
@@ -50,7 +50,7 @@ export abstract class CommandChannel {
...
@@ -50,7 +50,7 @@ export abstract class CommandChannel {
private
readonly
commandPattern
:
RegExp
=
/
(?<
type>
[\w]{2})(?<
length>
[\d]{14})(?<
data>.*
)\n?
/gm
;
private
readonly
commandPattern
:
RegExp
=
/
(?<
type>
[\w]{2})(?<
length>
[\d]{14})(?<
data>.*
)\n?
/gm
;
public
constructor
(
commandEmitter
:
EventEmitter
)
{
public
constructor
(
commandEmitter
:
EventEmitter
)
{
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
CommandChannel
'
);
this
.
commandEmitter
=
commandEmitter
;
this
.
commandEmitter
=
commandEmitter
;
}
}
...
...
ts/nni_manager/training_service/reusable/environment.ts
View file @
521f1917
...
@@ -82,7 +82,7 @@ export class EnvironmentInformation {
...
@@ -82,7 +82,7 @@ export class EnvironmentInformation {
public
useSharedStorage
?:
boolean
;
public
useSharedStorage
?:
boolean
;
constructor
(
id
:
string
,
name
:
string
,
envId
?:
string
)
{
constructor
(
id
:
string
,
name
:
string
,
envId
?:
string
)
{
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
EnvironmentInformation
'
);
this
.
id
=
id
;
this
.
id
=
id
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
envId
=
envId
?
envId
:
name
;
this
.
envId
=
envId
?
envId
:
name
;
...
@@ -116,7 +116,7 @@ export class EnvironmentInformation {
...
@@ -116,7 +116,7 @@ export class EnvironmentInformation {
const
gpuSummary
=
this
.
gpuSummaries
.
get
(
this
.
defaultNodeId
);
const
gpuSummary
=
this
.
gpuSummaries
.
get
(
this
.
defaultNodeId
);
if
(
gpuSummary
===
undefined
)
{
if
(
gpuSummary
===
undefined
)
{
if
(
false
===
this
.
isNoGpuWarned
)
{
if
(
false
===
this
.
isNoGpuWarned
)
{
this
.
log
.
warning
(
`EnvironmentInformation:
${
this
.
envId
}
no default gpu found. current gpu info
${
JSON
.
stringify
(
this
.
gpuSummaries
)
}
`
)
;
this
.
log
.
warning
(
`EnvironmentInformation:
${
this
.
envId
}
no default gpu found. current gpu info
`
,
this
.
gpuSummaries
);
this
.
isNoGpuWarned
=
true
;
this
.
isNoGpuWarned
=
true
;
}
}
}
else
{
}
else
{
...
...
ts/nni_manager/training_service/reusable/environments/amlEnvironmentService.ts
View file @
521f1917
...
@@ -24,7 +24,7 @@ interface FlattenAmlConfig extends ExperimentConfig, AmlConfig { }
...
@@ -24,7 +24,7 @@ interface FlattenAmlConfig extends ExperimentConfig, AmlConfig { }
@
component
.
Singleton
@
component
.
Singleton
export
class
AMLEnvironmentService
extends
EnvironmentService
{
export
class
AMLEnvironmentService
extends
EnvironmentService
{
private
readonly
log
:
Logger
=
getLogger
();
private
readonly
log
:
Logger
=
getLogger
(
'
AMLEnvironmentService
'
);
private
experimentId
:
string
;
private
experimentId
:
string
;
private
experimentRootDir
:
string
;
private
experimentRootDir
:
string
;
private
config
:
FlattenAmlConfig
;
private
config
:
FlattenAmlConfig
;
...
...
ts/nni_manager/training_service/reusable/environments/localEnvironmentService.ts
View file @
521f1917
...
@@ -17,7 +17,7 @@ import { SharedStorageService } from '../sharedStorage'
...
@@ -17,7 +17,7 @@ import { SharedStorageService } from '../sharedStorage'
@
component
.
Singleton
@
component
.
Singleton
export
class
LocalEnvironmentService
extends
EnvironmentService
{
export
class
LocalEnvironmentService
extends
EnvironmentService
{
private
readonly
log
:
Logger
=
getLogger
();
private
readonly
log
:
Logger
=
getLogger
(
'
LocalEnvironmentService
'
);
private
experimentRootDir
:
string
;
private
experimentRootDir
:
string
;
private
experimentId
:
string
;
private
experimentId
:
string
;
...
...
ts/nni_manager/training_service/reusable/environments/openPaiEnvironmentService.ts
View file @
521f1917
...
@@ -23,7 +23,7 @@ interface FlattenOpenpaiConfig extends ExperimentConfig, OpenpaiConfig { }
...
@@ -23,7 +23,7 @@ interface FlattenOpenpaiConfig extends ExperimentConfig, OpenpaiConfig { }
@
component
.
Singleton
@
component
.
Singleton
export
class
OpenPaiEnvironmentService
extends
EnvironmentService
{
export
class
OpenPaiEnvironmentService
extends
EnvironmentService
{
private
readonly
log
:
Logger
=
getLogger
();
private
readonly
log
:
Logger
=
getLogger
(
'
OpenPaiEnvironmentService
'
);
private
paiClusterConfig
:
PAIClusterConfig
|
undefined
;
private
paiClusterConfig
:
PAIClusterConfig
|
undefined
;
private
paiTrialConfig
:
NNIPAITrialConfig
|
undefined
;
private
paiTrialConfig
:
NNIPAITrialConfig
|
undefined
;
private
paiToken
:
string
;
private
paiToken
:
string
;
...
@@ -77,7 +77,7 @@ export class OpenPaiEnvironmentService extends EnvironmentService {
...
@@ -77,7 +77,7 @@ export class OpenPaiEnvironmentService extends EnvironmentService {
// Status code 200 for success
// Status code 200 for success
if
((
error
!==
undefined
&&
error
!==
null
)
||
response
.
statusCode
>=
400
)
{
if
((
error
!==
undefined
&&
error
!==
null
)
||
response
.
statusCode
>=
400
)
{
const
errorMessage
:
string
=
(
error
!==
undefined
&&
error
!==
null
)
?
error
.
message
:
const
errorMessage
:
string
=
(
error
!==
undefined
&&
error
!==
null
)
?
error
.
message
:
`OpenPAI: get environment list from PAI Cluster failed!, http code:
${
response
.
statusCode
}
, http body:
${
JSON
.
stringify
(
body
)}
`
;
`OpenPAI: get environment list from PAI Cluster failed!, http code:
${
response
.
statusCode
}
, http body:
'
${
JSON
.
stringify
(
body
)}
`
;
this
.
log
.
error
(
`
${
errorMessage
}
`
);
this
.
log
.
error
(
`
${
errorMessage
}
`
);
deferred
.
reject
(
errorMessage
);
deferred
.
reject
(
errorMessage
);
}
else
{
}
else
{
...
@@ -113,7 +113,7 @@ export class OpenPaiEnvironmentService extends EnvironmentService {
...
@@ -113,7 +113,7 @@ export class OpenPaiEnvironmentService extends EnvironmentService {
this
.
log
.
debug
(
`OpenPAI: job
${
environment
.
envId
}
change status
${
oldEnvironmentStatus
}
to
${
environment
.
status
}
due to job is
${
jobResponse
.
state
}
.`
)
this
.
log
.
debug
(
`OpenPAI: job
${
environment
.
envId
}
change status
${
oldEnvironmentStatus
}
to
${
environment
.
status
}
due to job is
${
jobResponse
.
state
}
.`
)
}
}
}
else
{
}
else
{
this
.
log
.
error
(
`OpenPAI: job
${
environment
.
envId
}
has no state returned. body:
${
JSON
.
stringify
(
jobResponse
)
}
`
)
;
this
.
log
.
error
(
`OpenPAI: job
${
environment
.
envId
}
has no state returned. body:
`
,
jobResponse
);
// some error happens, and mark this environment
// some error happens, and mark this environment
environment
.
status
=
'
FAILED
'
;
environment
.
status
=
'
FAILED
'
;
}
}
...
...
ts/nni_manager/training_service/reusable/environments/remoteEnvironmentService.ts
View file @
521f1917
...
@@ -39,7 +39,7 @@ export class RemoteEnvironmentService extends EnvironmentService {
...
@@ -39,7 +39,7 @@ export class RemoteEnvironmentService extends EnvironmentService {
this
.
machineExecutorManagerMap
=
new
Map
<
RemoteMachineConfig
,
ExecutorManager
>
();
this
.
machineExecutorManagerMap
=
new
Map
<
RemoteMachineConfig
,
ExecutorManager
>
();
this
.
remoteMachineMetaOccupiedMap
=
new
Map
<
RemoteMachineConfig
,
boolean
>
();
this
.
remoteMachineMetaOccupiedMap
=
new
Map
<
RemoteMachineConfig
,
boolean
>
();
this
.
experimentRootDir
=
experimentRootDir
;
this
.
experimentRootDir
=
experimentRootDir
;
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
RemoteEnvironmentService
'
);
this
.
config
=
flattenConfig
(
config
,
'
remote
'
);
this
.
config
=
flattenConfig
(
config
,
'
remote
'
);
// codeDir is not a valid directory, throw Error
// codeDir is not a valid directory, throw Error
...
...
ts/nni_manager/training_service/reusable/gpuScheduler.ts
View file @
521f1917
...
@@ -29,7 +29,7 @@ export type GpuScheduleResult = {
...
@@ -29,7 +29,7 @@ export type GpuScheduleResult = {
export
class
GpuScheduler
{
export
class
GpuScheduler
{
// private readonly machineExecutorMap: Set<TrialDetail>;
// private readonly machineExecutorMap: Set<TrialDetail>;
private
readonly
log
:
Logger
=
getLogger
();
private
readonly
log
:
Logger
=
getLogger
(
'
GpuScheduler
'
);
private
readonly
policyName
:
SCHEDULE_POLICY_NAME
=
'
recently-idle
'
;
private
readonly
policyName
:
SCHEDULE_POLICY_NAME
=
'
recently-idle
'
;
private
defaultSetting
:
GpuSchedulerSetting
;
private
defaultSetting
:
GpuSchedulerSetting
;
private
roundRobinIndex
:
number
=
0
;
private
roundRobinIndex
:
number
=
0
;
...
...
ts/nni_manager/training_service/reusable/shared_storages/azureblobStorageService.ts
View file @
521f1917
...
@@ -66,7 +66,7 @@ export class AzureBlobSharedStorageService extends SharedStorageService {
...
@@ -66,7 +66,7 @@ export class AzureBlobSharedStorageService extends SharedStorageService {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
AzureBlobSharedStorageService
'
);
this
.
internalStorageService
=
new
MountedStorageService
();
this
.
internalStorageService
=
new
MountedStorageService
();
this
.
experimentId
=
getExperimentId
();
this
.
experimentId
=
getExperimentId
();
}
}
...
...
ts/nni_manager/training_service/reusable/shared_storages/nfsStorageService.ts
View file @
521f1917
...
@@ -50,7 +50,7 @@ export class NFSSharedStorageService extends SharedStorageService {
...
@@ -50,7 +50,7 @@ export class NFSSharedStorageService extends SharedStorageService {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
log
=
getLogger
();
this
.
log
=
getLogger
(
'
NFSSharedStorageService
'
);
this
.
internalStorageService
=
new
MountedStorageService
();
this
.
internalStorageService
=
new
MountedStorageService
();
this
.
experimentId
=
getExperimentId
();
this
.
experimentId
=
getExperimentId
();
}
}
...
...
ts/nni_manager/training_service/reusable/storageService.ts
View file @
521f1917
...
@@ -30,7 +30,7 @@ export abstract class StorageService {
...
@@ -30,7 +30,7 @@ export abstract class StorageService {
protected
abstract
internalBasename
(...
paths
:
string
[]):
string
;
protected
abstract
internalBasename
(...
paths
:
string
[]):
string
;
constructor
()
{
constructor
()
{
this
.
logger
=
getLogger
();
this
.
logger
=
getLogger
(
'
StorageService
'
);
}
}
public
initialize
(
localRoot
:
string
,
remoteRoot
:
string
):
void
{
public
initialize
(
localRoot
:
string
,
remoteRoot
:
string
):
void
{
...
...
Prev
1
2
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