-
Notifications
You must be signed in to change notification settings - Fork 78
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
Conversation
@@ -161,3 +163,8 @@ func (s *TrainingJob) GPU() int { | |||
|
|||
return int(gpu) | |||
} | |||
|
|||
func (s *TrainingJob) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marshal()
或Serialize()
应该更容易理解。
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白了。
go/paddlectl/submit.go
Outdated
invalidJobName = "jobname can not contain '.' or '_'" | ||
) | ||
|
||
// Config is global config object for paddlecloud commandline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddlecloud => paddlectl
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submit不需要上传文件了么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下一个PR搞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以先去掉注释的代码,只放一个TODO注释。保持develop中代码规范。
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好可以脱离k8s的配置文件。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下一个PR搞
go/paddlectl/kube.go
Outdated
@@ -0,0 +1,106 @@ | |||
package paddlectl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件叫kube.go
有点奇怪,可以放到util目录作为一些公用的函数。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done。
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以先去掉注释的代码,只放一个TODO注释。保持develop中代码规范。
go/paddlectl/submit.go
Outdated
return &paddlejob.TrainerSpec{ | ||
Entrypoint: p.Entry, | ||
// FIXME(gongwb): workspace | ||
//Workspace: p.Workspace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
尽量不要push包含注释掉的代码。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++
Awesome! |
It can commit TPR's extension now!.
Fix part of #484