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

Cobra cli #69

Merged
merged 5 commits into from
Apr 24, 2018
Merged

Cobra cli #69

merged 5 commits into from
Apr 24, 2018

Conversation

YujiOshima
Copy link
Contributor

Introduce spf13/cobra to katib-cli.
CLI schema is drastically changed.

katib-cli [subcomand] [resource name] [options]
  • [subcommand]
  • create
  • get
  • stop
  • push
  • [resource name]
  • study
  • model

/assign @gaocegege

Signed-off-by: YujiOshima <[email protected]>
Signed-off-by: YujiOshima <[email protected]>
@YujiOshima
Copy link
Contributor Author

Fix #54

Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

It is too late in Shanghai, China (23:30) and I just look through the code. Generally LGTM but I prefer to review it tomorrow if it does not block you.

"github.com/spf13/cobra"
)

//NewCommandGet generate run cmd
Copy link
Member

Choose a reason for hiding this comment

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

The function name is NewCommandCreate. Maybe there is a typo

cmd/cli/push.go Outdated
"github.com/spf13/cobra"
)

//NewCommandGet generate run cmd
Copy link
Member

Choose a reason for hiding this comment

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

Same problem above.

@YujiOshima
Copy link
Contributor Author

@gaocegege Thank you!
Of course, tomorrow is fine. No problem!
I will fix test fails tomorrow.

var sInfo []*api.StudyInfo
for _, si := range r.StudyInfos {
if len(opt.args) > 0 {
if utf8.RuneCountInString(opt.args[0]) >= 7 {
Copy link
Member

Choose a reason for hiding this comment

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

Could we add some comments here? I can not understand the code well.

cmd/cli/get.go Outdated
cmd.AddCommand(NewCommandGetStudies())
cmd.AddCommand(NewCommandGetStudy())
// cmd.AddCommand(NewCommandGetTrials())
// cmd.AddCommand(NewCommandGetTrial())
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if we could enable the two command. WDYT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, we don't have the get trial API in katib-manager.
I will refactor API and add low-level APIs (related #66 ). Then I will enable these commands.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM, I misunderstand the comments.

fmt.Println(err)
os.Exit(1)
}

Copy link
Member

Choose a reason for hiding this comment

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

Please remove the line here.

args []string
}

//NewCommandGetStudy generate run cmd
Copy link
Member

Choose a reason for hiding this comment

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

Please update or remove the comment here.

Signed-off-by: YujiOshima <[email protected]>
Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

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

/lgtm

cmd/cli/get.go Outdated
cmd.AddCommand(NewCommandGetStudies())
cmd.AddCommand(NewCommandGetStudy())
// cmd.AddCommand(NewCommandGetTrials())
// cmd.AddCommand(NewCommandGetTrial())
Copy link
Member

Choose a reason for hiding this comment

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

SGTM, I misunderstand the comments.

Signed-off-by: YujiOshima <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 24, 2018
Signed-off-by: YujiOshima <[email protected]>
@YujiOshima
Copy link
Contributor Author

@gaocegege At last, it passed the CI!

@gaocegege
Copy link
Member

/lgtm

🎉

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaocegege

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 71a2bd3 into kubeflow:master Apr 24, 2018
@YujiOshima YujiOshima deleted the cobra-cli branch April 24, 2018 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants