Skip to content

Add submit job api#26

Merged
typhoonzero merged 2 commits intoPaddlePaddle:developfrom
Yancey0623:submit-job
May 16, 2017
Merged

Add submit job api#26
typhoonzero merged 2 commits intoPaddlePaddle:developfrom
Yancey0623:submit-job

Conversation

@Yancey0623
Copy link
Collaborator

Fixed #19

@Yancey0623 Yancey0623 requested a review from typhoonzero May 16, 2017 08:29
import json

@login_required
def jobs_handler(request):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要使用notebook/views.py中的SampleView作为样板,这样API调用可以使用token认证方式

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return utils.simple_response(500, str(e))
return utils.simple_response(200, "OK")

def list_jobs(request):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list_jobsdelete_job还是展位接口吧?我可以提PR增加功能

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

太好了,感谢🙏

)
try:
ret = client.ExtensionsV1beta1Api().create_namespaced_replica_set(
username,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace并不是直接用username,需要调用下email_escape函数

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

#submit trainer job, it's Kubernetes Job
try:
ret = client.BatchV1Api().create_namespaced_job(
username,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,namespace的问题

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@typhoonzero typhoonzero merged commit a489da6 into PaddlePaddle:develop May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants