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
42d8cbda
Unverified
Commit
42d8cbda
authored
Oct 17, 2018
by
fishyds
Committed by
GitHub
Oct 17, 2018
Browse files
Fix broken issue comes from OpenPAI API upgrade (#227)
Fix paiTrainingService broken issue comes from OpenPAI API upgrade
parent
deaa1873
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
src/nni_manager/training_service/pai/paiData.ts
src/nni_manager/training_service/pai/paiData.ts
+1
-1
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
+1
-1
src/nni_manager/training_service/pai/paiTrainingService.ts
src/nni_manager/training_service/pai/paiTrainingService.ts
+17
-10
No files found.
src/nni_manager/training_service/pai/paiData.ts
View file @
42d8cbda
...
@@ -69,4 +69,4 @@ export const PAI_OUTPUT_DIR_FORMAT: string =
...
@@ -69,4 +69,4 @@ export const PAI_OUTPUT_DIR_FORMAT: string =
`hdfs://{0}:9000/`
;
`hdfs://{0}:9000/`
;
export
const
PAI_LOG_PATH_FORMAT
:
string
=
export
const
PAI_LOG_PATH_FORMAT
:
string
=
`http://{0}
:50070
/explorer.html#{1}`
`http://{0}
/webhdfs
/explorer.html#{1}`
src/nni_manager/training_service/pai/paiJobInfoCollector.ts
View file @
42d8cbda
...
@@ -69,7 +69,7 @@ export class PAIJobInfoCollector {
...
@@ -69,7 +69,7 @@ export class PAIJobInfoCollector {
// Rest call to get PAI job info and update status
// Rest call to get PAI job info and update status
// Refer https://github.com/Microsoft/pai/blob/master/docs/rest-server/API.md for more detail about PAI Rest API
// Refer https://github.com/Microsoft/pai/blob/master/docs/rest-server/API.md for more detail about PAI Rest API
const
getJobInfoRequest
:
request
.
Options
=
{
const
getJobInfoRequest
:
request
.
Options
=
{
uri
:
`http://
${
paiClusterConfig
.
host
}
:9186/api/v1
/jobs/
${
paiTrialJob
.
paiJobName
}
`
,
uri
:
`http://
${
paiClusterConfig
.
host
}
/rest-server/api/v1/user/
${
paiClusterConfig
.
userName
}
/jobs/
${
paiTrialJob
.
paiJobName
}
`
,
method
:
'
GET
'
,
method
:
'
GET
'
,
json
:
true
,
json
:
true
,
headers
:
{
headers
:
{
...
...
src/nni_manager/training_service/pai/paiTrainingService.ts
View file @
42d8cbda
...
@@ -244,7 +244,7 @@ class PAITrainingService implements TrainingService {
...
@@ -244,7 +244,7 @@ class PAITrainingService implements TrainingService {
// Step 3. Submit PAI job via Rest call
// Step 3. Submit PAI job via Rest call
// Refer https://github.com/Microsoft/pai/blob/master/docs/rest-server/API.md for more detail about PAI Rest API
// Refer https://github.com/Microsoft/pai/blob/master/docs/rest-server/API.md for more detail about PAI Rest API
const
submitJobRequest
:
request
.
Options
=
{
const
submitJobRequest
:
request
.
Options
=
{
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
:9186/api/v1
/jobs`
,
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
/rest-server/api/v1/user/
${
this
.
paiClusterConfig
.
userName
}
/jobs`
,
method
:
'
POST
'
,
method
:
'
POST
'
,
json
:
true
,
json
:
true
,
body
:
paiJobConfig
,
body
:
paiJobConfig
,
...
@@ -291,7 +291,7 @@ class PAITrainingService implements TrainingService {
...
@@ -291,7 +291,7 @@ class PAITrainingService implements TrainingService {
}
}
const
stopJobRequest
:
request
.
Options
=
{
const
stopJobRequest
:
request
.
Options
=
{
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
:9186/api/v1
/jobs/
${
trialJobDetail
.
paiJobName
}
/executionType`
,
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
/rest-server/api/v1/user/
${
this
.
paiClusterConfig
.
userName
}
/jobs/
${
trialJobDetail
.
paiJobName
}
/executionType`
,
method
:
'
PUT
'
,
method
:
'
PUT
'
,
json
:
true
,
json
:
true
,
body
:
{
'
value
'
:
'
STOP
'
},
body
:
{
'
value
'
:
'
STOP
'
},
...
@@ -322,13 +322,15 @@ class PAITrainingService implements TrainingService {
...
@@ -322,13 +322,15 @@ class PAITrainingService implements TrainingService {
this
.
hdfsClient
=
WebHDFS
.
createClient
({
this
.
hdfsClient
=
WebHDFS
.
createClient
({
user
:
this
.
paiClusterConfig
.
userName
,
user
:
this
.
paiClusterConfig
.
userName
,
port
:
50070
,
// Refer PAI document for Pylon mapping https://github.com/Microsoft/pai/tree/master/docs/pylon
port
:
80
,
path
:
'
/webhdfs/webhdfs/v1
'
,
host
:
this
.
paiClusterConfig
.
host
host
:
this
.
paiClusterConfig
.
host
});
});
// Get PAI authentication token
// Get PAI authentication token
const
authentication_req
:
request
.
Options
=
{
const
authentication_req
:
request
.
Options
=
{
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
:9186
/api/v1/token`
,
uri
:
`http://
${
this
.
paiClusterConfig
.
host
}
/rest-server
/api/v1/token`
,
method
:
'
POST
'
,
method
:
'
POST
'
,
json
:
true
,
json
:
true
,
body
:
{
body
:
{
...
@@ -393,14 +395,19 @@ class PAITrainingService implements TrainingService {
...
@@ -393,14 +395,19 @@ class PAITrainingService implements TrainingService {
this
.
hdfsBaseDir
=
"
/
"
;
this
.
hdfsBaseDir
=
"
/
"
;
}
}
const
hdfsClient
=
WebHDFS
.
createClient
({
let
dataOutputHdfsClient
;
user
:
this
.
paiClusterConfig
.
userName
,
if
(
this
.
paiClusterConfig
.
host
===
this
.
hdfsOutputHost
&&
this
.
hdfsClient
)
{
port
:
50070
,
dataOutputHdfsClient
=
this
.
hdfsClient
host
:
this
.
hdfsOutputHost
}
else
{
});
dataOutputHdfsClient
=
WebHDFS
.
createClient
({
user
:
this
.
paiClusterConfig
.
userName
,
port
:
50070
,
host
:
this
.
hdfsOutputHost
});
}
try
{
try
{
const
exist
:
boolean
=
await
HDFSClientUtility
.
pathExists
(
"
/
"
,
h
dfsClient
);
const
exist
:
boolean
=
await
HDFSClientUtility
.
pathExists
(
"
/
"
,
dataOutputH
dfsClient
);
if
(
!
exist
)
{
if
(
!
exist
)
{
deferred
.
reject
(
new
Error
(
`Please check hdfsOutputDir host!`
));
deferred
.
reject
(
new
Error
(
`Please check hdfsOutputDir host!`
));
}
}
...
...
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