Skip to content

Commit

Permalink
Fix grammar test (flyteorg#272)
Browse files Browse the repository at this point in the history
* Fix grammar

Signed-off-by: SmritiSatyanV <[email protected]>

* Updated task.go

Signed-off-by: SmritiSatyanV <[email protected]>

* Updated configuration.go

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed build errors-1

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed build errors-2

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed errors-3

Signed-off-by: SmritiSatyanV <[email protected]>

* Updated sandbox_test.go

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed errors-4

Signed-off-by: SmritiSatyanV <[email protected]>

* Minor grammar fix

Changed FlyteCTL to Flytectl
Grammar fixes
Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed errors

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed unit test errors

Signed-off-by: SmritiSatyanV <[email protected]>

* Updates based on comments

Signed-off-by: SmritiSatyanV <[email protected]>

* Rephrased sentence

Signed-off-by: SmritiSatyanV <[email protected]>

* Fixed errors

Error strings shouldn't begin with upper case or end with punctuation or newline.
Signed-off-by: SmritiSatyanV <[email protected]>

* Updated project.go

Signed-off-by: SmritiSatyanV <[email protected]>

* Updated errors.go

Signed-off-by: SmritiSatyanV <[email protected]>

* Updated project_test.go

Signed-off-by: SmritiSatyanV <[email protected]>

* stylistic changes

Signed-off-by: Samhita Alla <[email protected]>

* revert letter case in errors.go

Signed-off-by: Samhita Alla <[email protected]>

* fix lint errors

Signed-off-by: Samhita Alla <[email protected]>

Co-authored-by: Samhita Alla <[email protected]>
  • Loading branch information
2 people authored and austin362667 committed May 7, 2024
1 parent 8804f75 commit 6dca037
Show file tree
Hide file tree
Showing 134 changed files with 932 additions and 853 deletions.
10 changes: 5 additions & 5 deletions flytectl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and accesses [FlyteAdmin](https://github.com/flyteorg/flyteadmin/), the control

## 🚀 Quick Start

1. Install FlyteCTL with bash or shell script
1. Install Flytectl with bash or shell script.

* Bash
```bash
Expand All @@ -41,22 +41,22 @@ and accesses [FlyteAdmin](https://github.com/flyteorg/flyteadmin/), the control
```bash
$ curl -sL https://ctl.flyte.org/install | bash
```
2. (Optional) `flytectl upgrade` provides a general interface to upgrading FlyteCTL; run the command in the output
2. (Optional) `flytectl upgrade` provides a general interface to upgrading Flytectl; run the command in the output.

3. Start sandbox using FlyteCTL
3. Start Sandbox using Flytectl.
```bash
$ flytectl sandbox start
```

4. Register examples
4. Register examples.
```bash
# Register core workflows
$ flytectl register examples -d development -p flytesnacks
```

<html>
<h2 id="contribution-guide">
📖 How to Contribute to FlyteCTL
📖 How to Contribute to Flytectl
</h2>
</html>

Expand Down
28 changes: 14 additions & 14 deletions flytectl/clierrors/errors.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package clierrors

var (
ErrInvalidStateUpdate = "Invalid state passed. Specify either activate or archive\n"
ErrInvalidStateUpdate = "invalid state passed. Specify either activate or archive\n"

ErrProjectNotPassed = "Project id not passed\n" // #nosec
ErrProjectNameNotPassed = "project name is required flag"
ErrFailedProjectUpdate = "Project %v failed to get updated due to %v\n"
ErrProjectNotPassed = "project id wasn't passed\n" // #nosec
ErrProjectNameNotPassed = "project name is a required flag"
ErrFailedProjectUpdate = "Project %v failed to update due to %v\n"

ErrLPNotPassed = "Launch plan name not passed\n"
ErrLPVersionNotPassed = "Launch plan version not passed\n" //nolint
ErrFailedLPUpdate = "Launch plan %v failed to get updated due to %v\n"
ErrLPNotPassed = "launch plan name wasn't passed\n"
ErrLPVersionNotPassed = "launch plan version wasn't passed\n" //nolint
ErrFailedLPUpdate = "launch plan %v failed to update due to %v\n"

ErrExecutionNotPassed = "Execution name not passed\n"
ErrFailedExecutionUpdate = "Execution %v failed to get updated due to %v\n"
ErrExecutionNotPassed = "execution name wasn't passed\n"
ErrFailedExecutionUpdate = "execution %v failed to update due to %v\n"

ErrWorkflowNotPassed = "Workflow name not passed\n"
ErrFailedWorkflowUpdate = "Workflow %v failed to get updated to due to %v\n"
ErrWorkflowNotPassed = "workflow name wasn't passed\n"
ErrFailedWorkflowUpdate = "workflow %v failed to update to due to %v\n"

ErrTaskNotPassed = "Task name not passed\n" // #nosec
ErrFailedTaskUpdate = "Task %v failed to get updated to due to %v\n"
ErrTaskNotPassed = "task name wasn't passed\n" // #nosec
ErrFailedTaskUpdate = "task %v failed to update to due to %v\n"

ErrSandboxExists = "Sandbox Exist\n"
ErrSandboxExists = "sandbox already exists!\n"
)
70 changes: 45 additions & 25 deletions flytectl/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,65 @@ import (
// completionCmd represents the completion command
var completionCmd = &cobra.Command{
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generate completion script",
Long: `To load completions:
Short: "Generates completion script.",
Long: `To load completion, run the following commands in accordance with the shell you are using:
Bash:
- Bash
::
$ source <(flytectl completion bash)
$ source <(flytectl completion bash)
# To load completions for each session, execute once:
# Linux:
$ flytectl completion bash > /etc/bash_completion.d/flytectl
# macOS:
$ flytectl completion bash > /usr/local/etc/bash_completion.d/flytectl
To load completions for each session:
Zsh:
- Linux
::
# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:
$ flytectl completion bash > /etc/bash_completion.d/flytectl
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
- macOS
::
# To load completions for each session, execute once:
$ flytectl completion zsh > "${fpath[1]}/_flytectl"
$ flytectl completion bash > /usr/local/etc/bash_completion.d/flytectl
# You will need to start a new shell for this setup to take effect.
- Zsh
If shell completion is not already enabled in your environment, enable it:
fish:
::
$ flytectl completion fish | source
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
# To load completions for each session, execute once:
$ flytectl completion fish > ~/.config/fish/completions/flytectl.fish
Once enabled, execute once:
PowerShell:
::
PS> flytectl completion powershell | Out-String | Invoke-Expression
$ flytectl completion zsh > "${fpath[1]}/_flytectl"
# To load completions for every new session, run:
PS> flytectl completion powershell > flytectl.ps1
# and source this file from your PowerShell profile.
.. note::
Start a new shell for this setup to take effect.
- fish
::
$ flytectl completion fish | source
To load completions for each session, run:
::
$ flytectl completion fish > ~/.config/fish/completions/flytectl.fish
- PowerShell
::
PS> flytectl completion powershell | Out-String | Invoke-Expression
To load completions for each session, run:
::
PS> flytectl completion powershell > flytectl.ps1
and source this file from your PowerShell profile.
`,
DisableFlagsInUseLine: true,
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
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: "FlyteCTL CLI tool",
Use: "FlyteCTL",
Long: "Flytectl is a CLI tool written in Go to interact with the FlyteAdmin service",
Short: "Flytectl CLI tool",
Use: "flytectl",
DisableAutoGenTag: true,
}

Expand Down
10 changes: 5 additions & 5 deletions flytectl/cmd/config/subcommand/sandbox/sandbox_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ var (
type Config struct {
Source string `json:"source" pflag:",Path of your source code"`

// Flytectl sandbox only supports flyte version available in Github release https://github.com/flyteorg/flyte/tags
// Flytectl sandbox will only work for v0.10.0+
// Default value dind represents the latest release
// Flytectl sandbox only supports Flyte version available in Github release https://github.com/flyteorg/flyte/tags.
// Flytectl sandbox will only work for v0.10.0+.
// Default value dind represents the latest release.
Version string `json:"version" pflag:",Version of flyte. Only supports flyte releases greater than v0.10.0"`

// Optionally it is possible to specify a specific fqn for the docker image with the tag. This should be
// Flyte compliant sandbox image. Usually useful, if you want to push the image to your own registry and relaunch
// from there.
Image string `json:"image" pflag:",Optional. Provide a fully qualified path to a Flyte compliant docker image."`

// Default value false represents that flytectl will not use latest pre release if exist
// Default value false represents that Flytectl will not use the latest pre-release if it exists.
Prerelease bool `json:"pre" pflag:",Optional. Pre release Version of flyte will be used for sandbox."`

// Optionally it is possible to pass in environment variables to sandbox container.
Env []string `json:"env" pflag:",Optional. Provide Env variable in key=value format which can be passed to sandbox container."`

// Optionally it is possible to use local sandbox image
// If local flag pass then flytectl will not pull image from registry. Usually useful, if you want to test your local images without pushing them to a registry
// Flytectl will not pull the image from the registry if the local flag passes. It is usually useful while testing your local images without pushing them to a registry.
ImagePullPolicy ImagePullPolicy `json:"imagePullPolicy" pflag:",Optional. Defines the image pull behavior [Always/IfNotPresent/Never]"`
}
19 changes: 12 additions & 7 deletions flytectl/cmd/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,33 @@ import (

// 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 a Flytectl config file in the user's home directory.`
initCmdLong = `Creates a Flytectl config file in Flyte directory i.e ~/.flyte.
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
Generate Sandbox config:
::
flytectl config init
Generates remote cluster config, By default connection is secure. Read more about the remote deployment https://docs.flyte.org/en/latest/deployment/index.html
Flyte Sandbox is a fully standalone minimal environment for running Flyte.
Read more about the Sandbox deployment :ref:` + "`here <deploy-sandbox-local>`" + `.
Generate remote cluster config:
::
flytectl config init --host=flyte.myexample.com
Generates remote cluster config with insecure connection
By default, the connection is secure.
Read more about remote deployment :ref:` + "`here <Deployment>`" + `.
Generate remote cluster config with insecure connection:
::
flytectl config init --host=flyte.myexample.com --insecure
Generates FlyteCTL config with a storage provider
Generate Flytectl config with a storage provider:
::
flytectl config init --host=flyte.myexample.com --storage
Expand Down
2 changes: 1 addition & 1 deletion flytectl/cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Long descriptions are whitespace sensitive when generating docs using Sphinx.
const (
createCmdShort = `Create various Flyte resources including tasks/workflows/launchplans/executions/project.`
createCmdShort = `Creates various Flyte resources such as tasks, workflows, launch plans, executions, and projects.`
createCmdLong = `
Create Flyte resource; if a project:
::
Expand Down
4 changes: 2 additions & 2 deletions 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, "Create various Flyte resources including tasks/workflows/launchplans/executions/project.")
assert.Equal(t, createCommand.Short, "Creates various Flyte resources such as tasks, workflows, launch plans, executions, and projects.")
assert.Equal(t, len(createCommand.Commands()), 2)
cmdNouns := createCommand.Commands()
// Sort by Use value.
Expand All @@ -39,5 +39,5 @@ func TestCreateCommand(t *testing.T) {
assert.Equal(t, cmdNouns[0].Short, executionShort)
assert.Equal(t, cmdNouns[1].Use, "project")
assert.Equal(t, cmdNouns[1].Aliases, []string{"projects"})
assert.Equal(t, cmdNouns[1].Short, "Create project resources")
assert.Equal(t, cmdNouns[1].Short, "Creates project resources.")
}
Loading

0 comments on commit 6dca037

Please sign in to comment.