Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add paddlectrl client. #483

Merged
merged 9 commits into from
Nov 10, 2017
Merged

Conversation

gongweibao
Copy link
Collaborator

@gongweibao gongweibao commented Nov 9, 2017

It can commit TPR's extension now!.
Fix part of #484

@@ -161,3 +163,8 @@ func (s *TrainingJob) GPU() int {

return int(gpu)
}

func (s *TrainingJob) String() string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Marshal()Serialize()应该更容易理解。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

String()可以支持这样的使用:

fmt.Fprintf(os.Stderr, "can't create TPR extenion TrainningJob: %s\n", job)

Copy link
Collaborator

Choose a reason for hiding this comment

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

明白了。

invalidJobName = "jobname can not contain '.' or '_'"
)

// Config is global config object for paddlecloud commandline
Copy link
Collaborator

Choose a reason for hiding this comment

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

paddlecloud => paddlectl

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。

func putFiles(jobPackage, jobName string) error {
_, pkgerr := os.Stat(jobPackage)
if pkgerr == nil {
// FIXME: upload job package to paddle cloud.
Copy link
Collaborator

Choose a reason for hiding this comment

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

submit不需要上传文件了么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

下一个PR搞

Copy link
Collaborator

Choose a reason for hiding this comment

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

可以先去掉注释的代码,只放一个TODO注释。保持develop中代码规范。

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 nil
}

func (s *Submitter) getKubeConfig() (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

最好可以脱离k8s的配置文件。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

下一个PR搞

@@ -0,0 +1,106 @@
package paddlectl
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个文件叫kube.go有点奇怪,可以放到util目录作为一些公用的函数。

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 Author

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

我把待做的PR放到了这里:#484

func putFiles(jobPackage, jobName string) error {
_, pkgerr := os.Stat(jobPackage)
if pkgerr == nil {
// FIXME: upload job package to paddle cloud.
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以先去掉注释的代码,只放一个TODO注释。保持develop中代码规范。

return &paddlejob.TrainerSpec{
Entrypoint: p.Entry,
// FIXME(gongwb): workspace
//Workspace: p.Workspace,
Copy link
Collaborator

Choose a reason for hiding this comment

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

尽量不要push包含注释掉的代码。

Copy link
Collaborator Author

@gongweibao gongweibao Nov 9, 2017

Choose a reason for hiding this comment

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

Done. Thanks!

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++

@gongweibao gongweibao merged commit bb2bfc6 into PaddlePaddle:develop Nov 10, 2017
@gongweibao gongweibao deleted the movetogo branch November 10, 2017 01:47
@helinwang
Copy link
Collaborator

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants