diff --git a/.gitignore b/.gitignore index 45fb7d0746a..2abd4bf111a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ # Project specific ignore files *.swp bin +/katib-cli # Go ignore files ## Binaries for programs and plugins diff --git a/README.md b/README.md index a233d24dff0..2d75a905ea1 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,13 @@ Katib provides a Web UI based on ModelDB(https://github.com/mitdbg/modeldb). The ![katib-demo](https://user-images.githubusercontent.com/10014831/38241910-64fb0646-376e-11e8-8b98-c26e577f3935.gif) +## CLI Documentation + +Please refer to [katib-cli.md](./docs/CLI/katib-cli.md). + ## CONTRIBUTING -Please feel free to test the system! [developer-guide.md](./docs/developer-guide.md) is a good starting point for developers. +Please feel free to test the system! [developer-guide.md](./docs/developer-guide.md) is a good starting point for developers. ## TODOs diff --git a/cmd/cli/create-study.go b/cmd/cli/command/create-study.go similarity index 70% rename from cmd/cli/create-study.go rename to cmd/cli/command/create-study.go index 242f20d162e..bcbbc34cd75 100644 --- a/cmd/cli/create-study.go +++ b/cmd/cli/command/create-study.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -6,10 +20,11 @@ import ( "io/ioutil" "log" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" yaml "gopkg.in/yaml.v2" + + "github.com/kubeflow/katib/pkg/api" ) type createStudyOpt struct { diff --git a/cmd/cli/command/create.go b/cmd/cli/command/create.go new file mode 100644 index 00000000000..696d28a158e --- /dev/null +++ b/cmd/cli/command/create.go @@ -0,0 +1,32 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/spf13/cobra" +) + +//NewCommandCreate generate create cmd +func NewCommandCreate() *cobra.Command { + cmd := &cobra.Command{ + Use: "create", + Short: "Create a resource from a file", + Long: `YAML formats are accepted.`, + } + + cmd.AddCommand(NewCommandCreateStudy()) + + return cmd +} diff --git a/cmd/cli/get-model.go b/cmd/cli/command/get-model.go similarity index 82% rename from cmd/cli/get-model.go rename to cmd/cli/command/get-model.go index 8911d3dcd10..20db61516ea 100644 --- a/cmd/cli/get-model.go +++ b/cmd/cli/command/get-model.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -9,9 +23,10 @@ import ( "text/tabwriter" "unicode/utf8" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" + + "github.com/kubeflow/katib/pkg/api" ) type getModelOpt struct { diff --git a/cmd/cli/get-study.go b/cmd/cli/command/get-study.go similarity index 73% rename from cmd/cli/get-study.go rename to cmd/cli/command/get-study.go index b4e7b3e3481..4c05a61893d 100644 --- a/cmd/cli/get-study.go +++ b/cmd/cli/command/get-study.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -9,9 +23,10 @@ import ( "text/tabwriter" "unicode/utf8" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" + + "github.com/kubeflow/katib/pkg/api" ) //NewCommandGetStudy generate get studies cmd diff --git a/cmd/cli/command/get.go b/cmd/cli/command/get.go new file mode 100644 index 00000000000..0765836f211 --- /dev/null +++ b/cmd/cli/command/get.go @@ -0,0 +1,37 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/spf13/cobra" +) + +//NewCommandGet generate get cmd +func NewCommandGet() *cobra.Command { + cmd := &cobra.Command{ + Use: "get", + Short: "Display one or many resources", + Long: `list of resorces comannd can display includes: studies, study, trials, trial, models, model`, + } + + //set local flag + + //add subcommand + cmd.AddCommand(NewCommandGetStudy()) + // cmd.AddCommand(NewCommandGetTrial()) + cmd.AddCommand(NewCommandGetModel()) + + return cmd +} diff --git a/cmd/cli/pull-study.go b/cmd/cli/command/pull-study.go similarity index 79% rename from cmd/cli/pull-study.go rename to cmd/cli/command/pull-study.go index 0b70505863d..cebacd8cb80 100644 --- a/cmd/cli/pull-study.go +++ b/cmd/cli/command/pull-study.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -9,10 +23,11 @@ import ( "strings" "unicode/utf8" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" yaml "gopkg.in/yaml.v2" + + "github.com/kubeflow/katib/pkg/api" ) type pullStudyOpt struct { diff --git a/cmd/cli/command/pull.go b/cmd/cli/command/pull.go new file mode 100644 index 00000000000..1ec4486a150 --- /dev/null +++ b/cmd/cli/command/pull.go @@ -0,0 +1,33 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/spf13/cobra" +) + +//NewCommandPull generate run cmd +func NewCommandPull() *cobra.Command { + cmd := &cobra.Command{ + Use: "pull", + Short: "Pull a resource from a file or from stdin.", + Long: `YAML or JSON formats are accepted.`, + } + + cmd.AddCommand(NewCommandPullStudy()) + // cmd.AddCommand(NewCommandPullModel()) + + return cmd +} diff --git a/cmd/cli/push-model.go b/cmd/cli/command/push-model.go similarity index 74% rename from cmd/cli/push-model.go rename to cmd/cli/command/push-model.go index 31c0d570d1e..6e4ae96784c 100644 --- a/cmd/cli/push-model.go +++ b/cmd/cli/command/push-model.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -7,10 +21,11 @@ import ( "io/ioutil" "log" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" yaml "gopkg.in/yaml.v2" + + "github.com/kubeflow/katib/pkg/api" ) type pushModelOpt struct { diff --git a/cmd/cli/push-study.go b/cmd/cli/command/push-study.go similarity index 78% rename from cmd/cli/push-study.go rename to cmd/cli/command/push-study.go index 7229d325154..cac6b51ccc3 100644 --- a/cmd/cli/push-study.go +++ b/cmd/cli/command/push-study.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -7,10 +21,11 @@ import ( "io/ioutil" "log" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" yaml "gopkg.in/yaml.v2" + + "github.com/kubeflow/katib/pkg/api" ) type pushStudyOpt struct { diff --git a/cmd/cli/command/push.go b/cmd/cli/command/push.go new file mode 100644 index 00000000000..d1a95d5ab63 --- /dev/null +++ b/cmd/cli/command/push.go @@ -0,0 +1,32 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/spf13/cobra" +) + +//NewCommandPush generate run cmd +func NewCommandPush() *cobra.Command { + cmd := &cobra.Command{ + Use: "push", + Short: "Push a resource from a file or from stdin.", + Long: `YAML or JSON formats are accepted.`, + } + + cmd.AddCommand(NewCommandPushStudy()) + + return cmd +} diff --git a/cmd/cli/root.go b/cmd/cli/command/root.go similarity index 71% rename from cmd/cli/root.go rename to cmd/cli/command/root.go index eeb704f0b72..21fe52b068d 100644 --- a/cmd/cli/root.go +++ b/cmd/cli/command/root.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "errors" diff --git a/cmd/cli/stop-study.go b/cmd/cli/command/stop-study.go similarity index 71% rename from cmd/cli/stop-study.go rename to cmd/cli/command/stop-study.go index cf639f87a48..3f295e4aac8 100644 --- a/cmd/cli/stop-study.go +++ b/cmd/cli/command/stop-study.go @@ -1,4 +1,18 @@ -package main +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command import ( "context" @@ -7,9 +21,10 @@ import ( "strings" "unicode/utf8" - "github.com/kubeflow/katib/pkg/api" "github.com/spf13/cobra" "google.golang.org/grpc" + + "github.com/kubeflow/katib/pkg/api" ) //NewCommandStopStudy generate stop study cmd diff --git a/cmd/cli/command/stop.go b/cmd/cli/command/stop.go new file mode 100644 index 00000000000..dad6da615ab --- /dev/null +++ b/cmd/cli/command/stop.go @@ -0,0 +1,32 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/spf13/cobra" +) + +//NewCommandStop genereate stop cmd +func NewCommandStop() *cobra.Command { + cmd := &cobra.Command{ + Use: "stop", + Short: "Stop a resource", + Long: `Specify resource ID or Name.`, + } + + cmd.AddCommand(NewCommandStopStudy()) + + return cmd +} diff --git a/cmd/cli/command/type.go b/cmd/cli/command/type.go new file mode 100644 index 00000000000..e55c7523a33 --- /dev/null +++ b/cmd/cli/command/type.go @@ -0,0 +1,24 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package command + +import ( + "github.com/kubeflow/katib/pkg/api" +) + +type StudyData struct { + StudyConf *api.StudyConfig + Models []*api.ModelInfo +} diff --git a/cmd/cli/create.go b/cmd/cli/create.go deleted file mode 100644 index 41357a60cde..00000000000 --- a/cmd/cli/create.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -//NewCommandCreate generate create cmd -func NewCommandCreate() *cobra.Command { - cmd := &cobra.Command{ - Use: "create", - Short: "Create a resource from a file", - Long: `YAML formats are accepted.`, - } - - cmd.AddCommand(NewCommandCreateStudy()) - - return cmd -} diff --git a/cmd/cli/get.go b/cmd/cli/get.go deleted file mode 100644 index a7cdb0e2edc..00000000000 --- a/cmd/cli/get.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -//NewCommandGet generate get cmd -func NewCommandGet() *cobra.Command { - cmd := &cobra.Command{ - Use: "get", - Short: "Display one or many resources", - Long: `list of resorces comannd can display includes: studies, study, trials, trial, models, model`, - } - - //set local flag - - //add subcommand - cmd.AddCommand(NewCommandGetStudy()) - // cmd.AddCommand(NewCommandGetTrial()) - cmd.AddCommand(NewCommandGetModel()) - - return cmd -} diff --git a/cmd/cli/katibctl.go b/cmd/cli/katibctl.go index 4f46120f50d..59217822d05 100644 --- a/cmd/cli/katibctl.go +++ b/cmd/cli/katibctl.go @@ -3,12 +3,14 @@ package main import ( "fmt" "os" + + "github.com/kubeflow/katib/cmd/cli/command" ) //Entry point func main() { //init command - katibctl := NewRootCommand() + katibctl := command.NewRootCommand() if err := katibctl.Execute(); err != nil { fmt.Println(err) os.Exit(1) diff --git a/cmd/cli/pull.go b/cmd/cli/pull.go deleted file mode 100644 index bc561760a6b..00000000000 --- a/cmd/cli/pull.go +++ /dev/null @@ -1,19 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -//NewCommandPull generate run cmd -func NewCommandPull() *cobra.Command { - cmd := &cobra.Command{ - Use: "pull", - Short: "Pull a resource from a file or from stdin.", - Long: `YAML or JSON formats are accepted.`, - } - - cmd.AddCommand(NewCommandPullStudy()) - // cmd.AddCommand(NewCommandPullModel()) - - return cmd -} diff --git a/cmd/cli/push.go b/cmd/cli/push.go deleted file mode 100644 index 13eda3990f4..00000000000 --- a/cmd/cli/push.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -//NewCommandPush generate run cmd -func NewCommandPush() *cobra.Command { - cmd := &cobra.Command{ - Use: "push", - Short: "Push a resource from a file or from stdin.", - Long: `YAML or JSON formats are accepted.`, - } - - cmd.AddCommand(NewCommandPushStudy()) - - return cmd -} diff --git a/cmd/cli/stop.go b/cmd/cli/stop.go deleted file mode 100644 index f7b41dddef9..00000000000 --- a/cmd/cli/stop.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -//NewCommandStop genereate stop cmd -func NewCommandStop() *cobra.Command { - cmd := &cobra.Command{ - Use: "stop", - Short: "Stop a resource", - Long: `Specify resource ID or Name.`, - } - - cmd.AddCommand(NewCommandStopStudy()) - - return cmd -} diff --git a/cmd/cli/type.go b/cmd/cli/type.go deleted file mode 100644 index b2290f1b47f..00000000000 --- a/cmd/cli/type.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "github.com/kubeflow/katib/pkg/api" -) - -type StudyData struct { - StudyConf *api.StudyConfig - Models []*api.ModelInfo -} diff --git a/docs/CLI.md b/docs/CLI.md deleted file mode 100644 index 8688458b2e7..00000000000 --- a/docs/CLI.md +++ /dev/null @@ -1,73 +0,0 @@ -## CLI Guide - -### katib-cli - -#### Usage - -``` -./katib-cli [options] [arguments] -This is katib cli client using cobra framework - -Usage: - katib-cli [command] - -Available Commands: - create Create a resource from a file - get Display one or many resources - help Help about any command - pull Pull a resource from a file or from stdin. - push Push a resource from a file or from stdin. - stop Stop a resource - -Flags: - -h, --help help for katib-cli - -s, --server string katib manager API endpoint (default "localhost:6789") - -Use "katib-cli [command] --help" for more information about a command. -``` - -#### SubCommands -- `get` -``` -list of resorces comannd can display includes: study, model - -Available Commands: - model Display Model Info - study Display Study Info -``` - -- `create` -``` -Create new resouce. YAML formats resource config are accepted. - -Available Commands: - study Create a study from a file - -Usage: - katibcli create study [flags] -Flags: - -f, --config string File path of study config(required) -``` - -- `stop` -``` -Specify resource ID or Name. - -Available Commands: - study Stop a study -Usage: - katibcli stop study [StudyID or StudyName] -``` - -- `push` -``` -YAML or JSON formats are accepted. - -Available Commands: - model Push a model Info from a file or from stdin - study Push a study Info from a file or from option - -Usage: -push study -n [StudyName] -o [OwnerName] -d [StudyDescription] -push model -f [Path to model config] -``` diff --git a/docs/CLI/katib-cli.md b/docs/CLI/katib-cli.md new file mode 100644 index 00000000000..cff4c9814e5 --- /dev/null +++ b/docs/CLI/katib-cli.md @@ -0,0 +1,24 @@ +## katib-cli + +katib cli + +### Synopsis + +This is katib cli client using cobra framework + +### Options + +``` + -h, --help help for katib-cli + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli create](katib-cli_create.md) - Create a resource from a file +* [katib-cli get](katib-cli_get.md) - Display one or many resources +* [katib-cli pull](katib-cli_pull.md) - Pull a resource from a file or from stdin. +* [katib-cli push](katib-cli_push.md) - Push a resource from a file or from stdin. +* [katib-cli stop](katib-cli_stop.md) - Stop a resource + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_create.md b/docs/CLI/katib-cli_create.md new file mode 100644 index 00000000000..8b32391f00f --- /dev/null +++ b/docs/CLI/katib-cli_create.md @@ -0,0 +1,26 @@ +## katib-cli create + +Create a resource from a file + +### Synopsis + +YAML formats are accepted. + +### Options + +``` + -h, --help help for create +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli](katib-cli.md) - katib cli +* [katib-cli create study](katib-cli_create_study.md) - Create a study from a file + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_create_study.md b/docs/CLI/katib-cli_create_study.md new file mode 100644 index 00000000000..b08a39e47da --- /dev/null +++ b/docs/CLI/katib-cli_create_study.md @@ -0,0 +1,30 @@ +## katib-cli create study + +Create a study from a file + +### Synopsis + +YAML formats are accepted. + +``` +katib-cli create study [flags] +``` + +### Options + +``` + -f, --config string File path of study config(required) + -h, --help help for study +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli create](katib-cli_create.md) - Create a resource from a file + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_get.md b/docs/CLI/katib-cli_get.md new file mode 100644 index 00000000000..71e7c19b182 --- /dev/null +++ b/docs/CLI/katib-cli_get.md @@ -0,0 +1,27 @@ +## katib-cli get + +Display one or many resources + +### Synopsis + +list of resorces comannd can display includes: studies, study, trials, trial, models, model + +### Options + +``` + -h, --help help for get +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli](katib-cli.md) - katib cli +* [katib-cli get model](katib-cli_get_model.md) - Display Model Info +* [katib-cli get studies](katib-cli_get_studies.md) - Display Study lnfo + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_get_model.md b/docs/CLI/katib-cli_get_model.md new file mode 100644 index 00000000000..07e040dc336 --- /dev/null +++ b/docs/CLI/katib-cli_get_model.md @@ -0,0 +1,30 @@ +## katib-cli get model + +Display Model Info + +### Synopsis + +Display Information of saved model + +``` +katib-cli get model [flags] +``` + +### Options + +``` + -d, --detail Display detail information of Model + -h, --help help for model +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli get](katib-cli_get.md) - Display one or many resources + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_get_studies.md b/docs/CLI/katib-cli_get_studies.md new file mode 100644 index 00000000000..2093cff1e8a --- /dev/null +++ b/docs/CLI/katib-cli_get_studies.md @@ -0,0 +1,29 @@ +## katib-cli get studies + +Display Study lnfo + +### Synopsis + +Display Information of a studies + +``` +katib-cli get studies [flags] +``` + +### Options + +``` + -h, --help help for studies +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli get](katib-cli_get.md) - Display one or many resources + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_pull.md b/docs/CLI/katib-cli_pull.md new file mode 100644 index 00000000000..a2102702482 --- /dev/null +++ b/docs/CLI/katib-cli_pull.md @@ -0,0 +1,26 @@ +## katib-cli pull + +Pull a resource from a file or from stdin. + +### Synopsis + +YAML or JSON formats are accepted. + +### Options + +``` + -h, --help help for pull +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli](katib-cli.md) - katib cli +* [katib-cli pull studies](katib-cli_pull_studies.md) - Export a Study and its Models lnfo + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_pull_studies.md b/docs/CLI/katib-cli_pull_studies.md new file mode 100644 index 00000000000..173855c3dd3 --- /dev/null +++ b/docs/CLI/katib-cli_pull_studies.md @@ -0,0 +1,30 @@ +## katib-cli pull studies + +Export a Study and its Models lnfo + +### Synopsis + +Export Information of a Study and its Models to yaml format + +``` +katib-cli pull studies [flags] +``` + +### Options + +``` + -h, --help help for studies + -o, --output string File path to export +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli pull](katib-cli_pull.md) - Pull a resource from a file or from stdin. + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_push.md b/docs/CLI/katib-cli_push.md new file mode 100644 index 00000000000..f40a420a3c1 --- /dev/null +++ b/docs/CLI/katib-cli_push.md @@ -0,0 +1,26 @@ +## katib-cli push + +Push a resource from a file or from stdin. + +### Synopsis + +YAML or JSON formats are accepted. + +### Options + +``` + -h, --help help for push +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli](katib-cli.md) - katib cli +* [katib-cli push study](katib-cli_push_study.md) - Push a Study Info and its Models from a file or from stdin + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_push_study.md b/docs/CLI/katib-cli_push_study.md new file mode 100644 index 00000000000..ea5de776d01 --- /dev/null +++ b/docs/CLI/katib-cli_push_study.md @@ -0,0 +1,31 @@ +## katib-cli push study + +Push a Study Info and its Models from a file or from stdin + +### Synopsis + +Push a Study Info and its Models from a file or from stdin +YAML formats are accepted. + +``` +katib-cli push study [flags] +``` + +### Options + +``` + -f, --file string File path of model config file + -h, --help help for study +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli push](katib-cli_push.md) - Push a resource from a file or from stdin. + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_stop.md b/docs/CLI/katib-cli_stop.md new file mode 100644 index 00000000000..7bbb2d103bc --- /dev/null +++ b/docs/CLI/katib-cli_stop.md @@ -0,0 +1,26 @@ +## katib-cli stop + +Stop a resource + +### Synopsis + +Specify resource ID or Name. + +### Options + +``` + -h, --help help for stop +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli](katib-cli.md) - katib cli +* [katib-cli stop study](katib-cli_stop_study.md) - Stop a study + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/docs/CLI/katib-cli_stop_study.md b/docs/CLI/katib-cli_stop_study.md new file mode 100644 index 00000000000..e1a178fffdb --- /dev/null +++ b/docs/CLI/katib-cli_stop_study.md @@ -0,0 +1,29 @@ +## katib-cli stop study + +Stop a study + +### Synopsis + +Stop study with study ID or study name + +``` +katib-cli stop study [flags] +``` + +### Options + +``` + -h, --help help for study +``` + +### Options inherited from parent commands + +``` + -s, --server string katib manager API endpoint (default "localhost:6789") +``` + +### SEE ALSO + +* [katib-cli stop](katib-cli_stop.md) - Stop a resource + +###### Auto generated by spf13/cobra on 5-Jun-2018 diff --git a/hack/docgen.go b/hack/docgen.go new file mode 100644 index 00000000000..4c53588697c --- /dev/null +++ b/hack/docgen.go @@ -0,0 +1,16 @@ +package main + +import ( + "log" + + "github.com/kubeflow/katib/cmd/cli/command" + "github.com/spf13/cobra/doc" +) + +func main() { + katibCLI := command.NewRootCommand() + err := doc.GenMarkdownTree(katibCLI, "./docs/CLI") + if err != nil { + log.Fatal(err) + } +} diff --git a/hack/gen-doc.sh b/hack/gen-doc.sh new file mode 100755 index 00000000000..71e23d0be14 --- /dev/null +++ b/hack/gen-doc.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Copyright 2018 The Kubeflow Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +PREFIX="katib" +CMD_PREFIX="cmd" + +SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. + +cd ${SCRIPT_ROOT} +echo "Generating CLI documentation..." +go run hack/docgen.go +cd - > /dev/null