Skip to content

Commit

Permalink
Created separate rst files for every resource (noun) (flyteorg#230)
Browse files Browse the repository at this point in the history
* Update nouns.rst

* removed html links

 Created separate rst file for each noun and referenced it in the nouns.rst file.

* Update verbs.rst

* Deleted newly added rst files

error with codecov, so deleted the newly added rst files.

* Delete verbs.rst

* Created separate rst files for every resource

* Changes to files in cmd folder

* Update create_test.go

* cmd folders

* Update cmd/create/execution.go

Co-authored-by: Samhita Alla <[email protected]>

* Added verbs.rst

* changes to cmd folder files

/bin removed,

* Update based on review

* Update cmd/create/project.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/create/create.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/create/create_test.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/delete/delete.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/delete/matchable_cluster_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/delete/matchable_task_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Changes to delete - matchable_plugin_override

* Changes to .go files in cmd

* Changed flytesnack to Flytesnack

* Creates to create

* Update cmd/get/launch_plan.go

Co-authored-by: Samhita Alla <[email protected]>

* Changed 'launchplan' to 'launch plan'

* Update cmd/register/examples.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/register/examples.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/register/examples.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/register/files.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/register/register.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/register/register_test.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/sandbox/sandbox.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/sandbox/start.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/sandbox/start.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/sandbox/status.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_cluster_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_cluster_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_execution_cluster_label.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_execution_queue_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_plugin_override.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_task_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_workflow_execution_config.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_workflow_execution_config.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/update.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/upgrade/upgrade.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/upgrade/upgrade.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/version/version.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/matchable_task_resource_attribute.go

Co-authored-by: Samhita Alla <[email protected]>

* Update cmd/update/update.go

Co-authored-by: Samhita Alla <[email protected]>

* Resolved changes

* Changed 'delte' to 'delete'

* Updated rst files

Created rst files for every noun, and linked the associated verbs with it

* Trial

* Removed the extra whitespace

* Changed 'delte' to 'delete'

Co-authored-by: Samhita Alla <[email protected]>
  • Loading branch information
2 people authored and austin362667 committed May 7, 2024
1 parent 4cd8882 commit 678428e
Show file tree
Hide file tree
Showing 126 changed files with 1,225 additions and 1,127 deletions.
2 changes: 1 addition & 1 deletion flytectl/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Bash:
Zsh:
# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:
# you will need to enable it. You can execute the following once:
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
Expand Down
6 changes: 3 additions & 3 deletions flytectl/cmd/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

func TestCompletionCmdIntegration(t *testing.T) {
rootCmd := &cobra.Command{
Long: "flytectl is CLI tool written in go to interact with flyteadmin service",
Short: "flyetcl CLI tool",
Use: "flytectl",
Long: "FlyteCTL is CLI tool written in go to interact with Flyteadmin service",
Short: "FlyteCTL CLI tool",
Use: "FlyteCTL",
DisableAutoGenTag: true,
}

Expand Down
18 changes: 9 additions & 9 deletions flytectl/cmd/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ import (
"github.com/spf13/cobra"
)

// Long descriptions are whitespace sensitive when generating docs using sphinx.
// Long descriptions are whitespace sensitive when generating docs using Sphinx.
const (
initCmdShort = `Generates flytectl config file in the user's home directory.`
initCmdLong = `Creates a flytectl config file in flyte directory i.e ~/.flyte
initCmdShort = `Generates FlyteCTL config file in the user's home directory.`
initCmdLong = `Creates a FlyteCTL config file in Flyte directory i.e ~/.flyte
Generate sandbox config. Flyte Sandbox is a fully standalone minimal environment for running Flyte. Read more about sandbox https://docs.flyte.org/en/latest/deployment/sandbox.html
Generates sandbox config. Flyte Sandbox is a fully standalone minimal environment for running Flyte. Read more about sandbox https://docs.flyte.org/en/latest/deployment/sandbox.html
::
bin/flytectl configuration config
flytectl configuration config
Generate remote cluster config. Read more about the remote deployment https://docs.flyte.org/en/latest/deployment/index.html
Generates remote cluster config. Read more about the remote deployment https://docs.flyte.org/en/latest/deployment/index.html
::
bin/flytectl configuration config --host=flyte.myexample.com
flytectl configuration config --host=flyte.myexample.com
Generate flytectl config with a storage provider
Generates FlyteCTL config with a storage provider
::
bin/flytectl configuration config --host=flyte.myexample.com --storage
flytectl configuration config --host=flyte.myexample.com --storage
`
)

Expand Down
10 changes: 5 additions & 5 deletions flytectl/cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import (
"github.com/spf13/cobra"
)

// Long descriptions are whitespace sensitive when generating docs using sphinx.
// Long descriptions are whitespace sensitive when generating docs using Sphinx.
const (
createCmdShort = `Used for creating various flyte resources including tasks/workflows/launchplans/executions/project.`
createCmdShort = `Create various Flyte resources including tasks/workflows/launchplans/executions/project.`
createCmdLong = `
Example create.
Create Flyte resource; if a project:
::
bin/flytectl create project --file project.yaml
flytectl create project --file project.yaml
`
)

// RemoteCreateCommand will return create flyte resource commands
// RemoteCreateCommand will return create Flyte resource commands
func RemoteCreateCommand() *cobra.Command {
createCmd := &cobra.Command{
Use: "create",
Expand Down
2 changes: 1 addition & 1 deletion flytectl/cmd/create/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var tearDownAndVerify = testutils.TearDownAndVerify
func TestCreateCommand(t *testing.T) {
createCommand := RemoteCreateCommand()
assert.Equal(t, createCommand.Use, "create")
assert.Equal(t, createCommand.Short, "Used for creating various flyte resources including tasks/workflows/launchplans/executions/project.")
assert.Equal(t, createCommand.Short, "Create various Flyte resources including tasks/workflows/launchplans/executions/project.")
assert.Equal(t, len(createCommand.Commands()), 2)
cmdNouns := createCommand.Commands()
// Sort by Use value.
Expand Down
26 changes: 13 additions & 13 deletions flytectl/cmd/create/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ import (
const (
executionShort = "Create execution resources"
executionLong = `
Create the executions for given workflow/task in a project and domain.
Creates executions for a given workflow/task in a project and domain.
There are three steps in generating an execution.
There are three steps in generating an execution:
- Generate the execution spec file using the get command.
- Update the inputs for the execution if needed.
- Run the execution by passing in the generated yaml file.
The spec file should be generated first and then run the execution using the spec file.
You can reference the flytectl get task for more details
The spec file should be generated first and then, the execution should be run using the spec file.
You can reference the FlyteCTL get task for more details.
::
flytectl get tasks -d development -p flytectldemo core.advanced.run_merge_sort.merge --version v2 --execFile execution_spec.yaml
The generated file would look similar to this
The generated file would look similar to this:
.. code-block:: yaml
Expand Down Expand Up @@ -65,35 +65,35 @@ The generated file can be modified to change the input values.
task: core.advanced.run_merge_sort.merge
version: "v2"
And then can be passed through the command line.
Notice the source and target domain/projects can be different.
The root project and domain flags of -p and -d should point to task/launch plans project/domain.
It can then be passed through the command line.
Notice that the source and target domain/projects can be different.
The root project and domain flags of -p and -d should point to the task/launch plans project/domain.
::
flytectl create execution --execFile execution_spec.yaml -p flytectldemo -d development --targetProject flytesnacks
Also an execution can be relaunched by passing in current execution id.
Also, an execution can be relaunched by passing in the current execution id.
::
flytectl create execution --relaunch ffb31066a0f8b4d52b77 -p flytectldemo -d development
An execution can be recovered, that is recreated from the last known failure point for a previously-run workflow execution.
An execution can be recovered, i.e., recreated from the last known failure point for previously-run workflow execution.
See :ref:` + "`ref_flyteidl.admin.ExecutionRecoverRequest`" + ` for more details.
::
flytectl create execution --recover ffb31066a0f8b4d52b77 -p flytectldemo -d development
Generic data types are also supported for execution in similar way.Following is sample of how the inputs need to be specified while creating the execution.
As usual the spec file should be generated first and then run the execution using the spec file.
Generic data types are also supported for execution in a similar manner. Following is a sample of how the inputs need to be specified while creating the execution.
The spec file should be generated first and then, the execution should be run using the spec file.
::
flytectl get task -d development -p flytectldemo core.type_system.custom_objects.add --execFile adddatanum.yaml
The generated file would look similar to this. Here you can see empty values dumped for generic data type x and y.
The generated file would look similar to this. Here, empty values have been dumped for generic data type x and y.
::
Expand Down
8 changes: 4 additions & 4 deletions flytectl/cmd/create/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import (
const (
projectShort = "Create project resources"
projectLong = `
Create the projects.(project,projects can be used interchangeably in these commands)
Create projects.(project/projects can be used interchangeably in these commands)
::
bin/flytectl create project --name flytesnacks --id flytesnacks --description "flytesnacks description" --labels app=flyte
flytectl create project --name flytesnacks --id flytesnacks --description "flytesnacks description" --labels app=flyte
Create Project by definition file. Note: The name shouldn't contain any whitespace characters'
Create a project by definition file. Note: The name shouldn't contain any whitespace characters.
::
bin/flytectl create project --file project.yaml
flytectl create project --file project.yaml
.. code-block:: yaml
Expand Down
8 changes: 4 additions & 4 deletions flytectl/cmd/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"github.com/spf13/cobra"
)

// Long descriptions are whitespace sensitive when generating docs using sphinx.
// Long descriptions are whitespace sensitive when generating docs using Sphinx.
const (
deleteCmdShort = `Used for terminating/deleting various flyte resources including tasks/workflows/launchplans/executions/project.`
deleteCmdShort = `Terminate/delete various Flyte resources including tasks/workflows/launchplans/executions/project.`
deleteCmdLong = `
Example Delete executions.
Delete a resource; if an execution:
::
bin/flytectl delete execution kxd1i72850 -d development -p flytesnacks
flytectl delete execution kxd1i72850 -d development -p flytesnacks
`
)

Expand Down
21 changes: 10 additions & 11 deletions flytectl/cmd/delete/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,41 @@ import (
"github.com/flyteorg/flytestdlib/logger"
)

// Long descriptions are whitespace sensitive when generating docs using sphinx.
// Long descriptions are whitespace sensitive when generating docs using Sphinx.
const (
execCmdShort = `Terminate/Delete execution resources.`
execCmdLong = `
Terminate executions.(execution,executions can be used interchangeably in these commands)
Task executions can be aborted only if they are in non-terminal state i.e if they are FAILED,ABORTED or SUCCEEDED then
calling terminate on them has no effect.
Task executions can be aborted only if they are in non-terminal state. If they are FAILED, ABORTED or SUCCEEDED, calling terminate on them has no effect.
Terminate a single execution with its name
Terminate a single execution with its name:
::
bin/flytectl delete execution c6a51x2l9e -d development -p flytesnacks
flytectl delete execution c6a51x2l9e -d development -p flytesnacks
You can get executions to check its state.
Get executions to check its state:
::
bin/flytectl get execution -d development -p flytesnacks
flytectl get execution -d development -p flytesnacks
------------ ------------------------------------------------------------------------- ---------- ----------- -------------------------------- ---------------
| NAME (7) | WORKFLOW NAME | TYPE | PHASE | STARTED | ELAPSED TIME |
------------ ------------------------------------------------------------------------- ---------- ----------- -------------------------------- ---------------
| c6a51x2l9e | recipes.core.basic.lp.go_greet | WORKFLOW | ABORTED | 2021-02-17T08:13:04.680476300Z | 15.540361300s |
------------ ------------------------------------------------------------------------- ---------- ----------- -------------------------------- ---------------
Terminate multiple executions with there names
Terminate multiple executions with their names:
::
bin/flytectl delete execution eeam9s8sny p4wv4hwgc4 -d development -p flytesnacks
flytectl delete execution eeam9s8sny p4wv4hwgc4 -d development -p flytesnacks
Similarly you can get executions to find the state of previously terminated executions.
Get executions to find the state of previously terminated executions:
::
bin/flytectl get execution -d development -p flytesnacks
flytectl get execution -d development -p flytesnacks
------------ ------------------------------------------------------------------------- ---------- ----------- -------------------------------- ---------------
| NAME (7) | WORKFLOW NAME | TYPE | PHASE | STARTED | ELAPSED TIME |
------------ ------------------------------------------------------------------------- ---------- ----------- -------------------------------- ---------------
Expand Down
19 changes: 9 additions & 10 deletions flytectl/cmd/delete/matchable_cluster_resource_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ import (
)

const (
clusterResourceAttributesShort = "Deletes matchable resources of cluster attributes"
clusterResourceAttributesShort = "Delete matchable resources of cluster attributes"
clusterResourceAttributesLong = `
Deletes cluster resource attributes for given project and domain combination or additionally with workflow name.
Deletes cluster resource attributes for the given project and domain combination or additionally with workflow name.
Deletes cluster resource attribute for project and domain
Here the command delete cluster resource attributes for project flytectldemo and development domain.
For project flytectldemo and development domain, it is:
::
flytectl delete cluster-resource-attribute -p flytectldemo -d development
Deletes cluster resource attribute using config file which was used for creating it.
Here the command deletes cluster resource attributes from the config file cra.yaml
Attributes are optional in the file as they are unread during the delete command but can be kept as the same file can be used for get, update or delete
eg: content of cra.yaml which will use the project domain and workflow name for deleting the resource
Deletes cluster resource attribute using config file which was used to create it.
Here, the config file is written to cra.yaml.
Attributes are optional in the file as they are unread during the delete command but can be kept since the same file can be used for get, update or delete commands.
e.g., content of cra.yaml:
::
Expand All @@ -40,8 +39,8 @@ eg: content of cra.yaml which will use the project domain and workflow name for
foo: "bar"
buzz: "lightyear"
Deletes cluster resource attribute for a workflow
Here the command deletes cluster resource attributes for a workflow core.control_flow.run_merge_sort.merge_sort
Deletes cluster resource attribute for a workflow.
For the workflow 'core.control_flow.run_merge_sort.merge_sort', it is:
::
Expand Down
15 changes: 7 additions & 8 deletions flytectl/cmd/delete/matchable_execution_cluster_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ import (
)

const (
executionClusterLabelShort = "Deletes matchable resources of execution cluster label"
executionClusterLabelShort = "Delete matchable resources of execution cluster label"
executionClusterLabelLong = `
Deletes execution cluster label for given project and domain combination or additionally with workflow name.
Deletes execution cluster label for project and domain
Here the command delete execution cluster label for project flytectldemo and development domain.
For project flytectldemo and development domain, it is:
::
flytectl delete execution-cluster-label -p flytectldemo -d development
Deletes execution cluster label using config file which was used for creating it.
Here the command deletes execution cluster label from the config file ecl.yaml
Value is optional in the file as its unread during the delete command but can be kept as the same file can be used for get, update or delete
eg: content of ecl.yaml which will use the project domain and workflow name for deleting the resource
Here, the config file is written to ecl.yaml.
Value is optional in the file as it is unread during the delete command but it can be kept since the same file can be used for get, update or delete commands.
e.g., content of ecl.yaml:
::
Expand All @@ -38,8 +37,8 @@ eg: content of ecl.yaml which will use the project domain and workflow name for
project: flytectldemo
value: foo
Deletes execution cluster label for a workflow
Here the command deletes execution cluster label for a workflow core.control_flow.run_merge_sort.merge_sort
Deletes execution cluster label for a workflow.
For the workflow 'core.control_flow.run_merge_sort.merge_sort', it is:
::
Expand Down
4 changes: 2 additions & 2 deletions flytectl/cmd/delete/matchable_execution_cluster_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func TestDeleteExecutionClusterLabels(t *testing.T) {
deleteExecutionClusterLabelSetup()
// No args implying project domain attribute deletion
u.DeleterExt.OnDeleteProjectDomainAttributesMatch(mock.Anything, mock.Anything, mock.Anything,
mock.Anything).Return(fmt.Errorf("failed to delte project domain attributes"))
mock.Anything).Return(fmt.Errorf("failed to delete project domain attributes"))
err = deleteExecutionClusterLabel(ctx, args, cmdCtx)
assert.NotNil(t, err)
assert.Equal(t, fmt.Errorf("failed to delte project domain attributes"), err)
assert.Equal(t, fmt.Errorf("failed to delete project domain attributes"), err)
u.DeleterExt.AssertCalled(t, "DeleteProjectDomainAttributes",
ctx, config.GetConfig().Project, config.GetConfig().Domain, admin.MatchableResource_EXECUTION_CLUSTER_LABEL)
})
Expand Down
17 changes: 8 additions & 9 deletions flytectl/cmd/delete/matchable_execution_queue_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ import (
)

const (
executionQueueAttributesShort = "Deletes matchable resources of execution queue attributes"
executionQueueAttributesShort = "Delete matchable resources of execution queue attributes"
executionQueueAttributesLong = `
Deletes execution queue attributes for given project and domain combination or additionally with workflow name.
Deletes execution queue attributes for the given project and domain combination or additionally with workflow name.
Deletes execution queue attribute for project and domain
Here the command delete execution queue attributes for project flytectldemo and development domain.
For project flytectldemo and development domain, it is:
::
flytectl delete execution-queue-attribute -p flytectldemo -d development
Deletes execution queue attribute using config file which was used for creating it.
Here the command deletes execution queue attributes from the config file era.yaml
Tags are optional in the file as they are unread during the delete command but can be kept as the same file can be used for get, update or delete
eg: content of era.yaml which will use the project domain and workflow name for deleting the resource
Here, the config file is written to era.yaml.
Value is optional in the file as it is unread during the delete command but it can be kept since the same file can be used for get, update or delete commands.
e.g., content of era.yaml:
::
Expand All @@ -42,8 +41,8 @@ eg: content of era.yaml which will use the project domain and workflow name for
- buzz
- lightyear
Deletes execution queue attribute for a workflow
Here the command deletes the execution queue attributes for a workflow core.control_flow.run_merge_sort.merge_sort
Deletes execution queue attribute for a workflow.
For the workflow 'core.control_flow.run_merge_sort.merge_sort', it is:
::
Expand Down
Loading

0 comments on commit 678428e

Please sign in to comment.