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

feat: Add ability to submit CronWorkflow from CLI #2003

Merged
merged 19 commits into from
Feb 7, 2020

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Jan 16, 2020

…. Closes #1963

Examples:

$ argo submit --from "CronWorkflow/hello-world"
Name:                hello-world-f6g7v
Namespace:           argo
ServiceAccount:      default
Status:              Pending
Created:             Thu Jan 16 12:03:45 -0800 (now)

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I have written unit and/or e2e tests for my change. PRs without these are unlike to be merged.
  • Optional. I've added My organization is added to the README.
  • I've signed the CLA and required builds are green.

@simster7 simster7 requested a review from alexec January 16, 2020 20:06
@codecov
Copy link

codecov bot commented Jan 16, 2020

Codecov Report

Merging #2003 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2003   +/-   ##
======================================
  Coverage    11.7%   11.7%           
======================================
  Files          52      52           
  Lines       26313   26313           
======================================
  Hits         3081    3081           
  Misses      22837   22837           
  Partials      395     395

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebeeac6...7a4236f. Read the comment docs.

cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
@alexec
Copy link
Contributor

alexec commented Jan 16, 2020

I'd like to review this, but it is not on the project board, so it has not been prioritized :(

@simster7
Copy link
Member Author

@alexec Added to the review board

@simster7 simster7 requested a review from alexec January 16, 2020 23:16
@alexec
Copy link
Contributor

alexec commented Jan 16, 2020

@jessesuen is this high priority?

@simster7
Copy link
Member Author

I think it should certainly be included with the next release

cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
test/e2e/cli_test.go Outdated Show resolved Hide resolved
workflow/common/util.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
test/e2e/fixtures/when.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
test/e2e/fixtures/when.go Outdated Show resolved Hide resolved
@simster7
Copy link
Member Author

Waiting on #2048 and #2007 before continuing -- possibly merging only CronWorkflow submission and then opening a separate PR once #2007 is done.

@simster7 simster7 changed the title feat: Add ability to submit CronWorkflow and WorflowTemplate from CLI… feat: Add ability to submit CronWorkflow from CLI Feb 3, 2020
@simster7
Copy link
Member Author

simster7 commented Feb 3, 2020

Have scaled back this PR to only allow submission from CronWorkflow. Submission from WorkflowTemplate will be added in #2007. v1.Interface use will be introduced with #2114.

Ready for another review @alexec

@simster7 simster7 requested a review from alexec February 3, 2020 18:00
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
test/e2e/cli_test.go Outdated Show resolved Hide resolved
@alexec alexec added this to the v2.6 milestone Feb 5, 2020
@alexec alexec modified the milestones: v2.6, v2.5 Feb 6, 2020
alexec
alexec previously requested changes Feb 7, 2020
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

Changes requested, including two moderately sized one.

You'll need to git merge master before you can merge.

cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
test/e2e/cli_test.go Outdated Show resolved Hide resolved
workflow/common/convert.go Show resolved Hide resolved
cmd/argo/commands/submit.go Show resolved Hide resolved
test/e2e/cli_test.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
cmd/argo/commands/submit.go Outdated Show resolved Hide resolved
@@ -61,6 +78,7 @@ func NewSubmitCommand() *cobra.Command {
command.Flags().Int32Var(&priority, "priority", 0, "workflow priority")
command.Flags().StringVarP(&submitOpts.ParameterFile, "parameter-file", "f", "", "pass a file containing all input parameters")
command.Flags().StringVarP(&submitOpts.Labels, "labels", "l", "", "Comma separated labels to apply to the workflow. Will override previous values.")
command.Flags().StringVar(&from, "from", "", "Submit from an existing `kind/name` E.g., --from=cronwf/hello-world-cwf")
Copy link
Contributor

Choose a reason for hiding this comment

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

used of back ticks makes for nice help:

submit a workflow

Usage:
  argo submit [FILE... | --from `kind/name] [flags]

Examples:
# Submit multiple workflows from files:

  argo submit my-wf.yaml

# Submit a single workflow from an existing resource

  argo submit --from cronwf/my-cron-wf


Flags:
      --dry-run                 modify the workflow on the client-side without creating it
      --entrypoint string       override entrypoint
      --from kind/name          Submit from an existing kind/name E.g., --from=cronwf/hello-world-cwf
      --generate-name string    override metadata.generateName
  -h, --help                    help for submit
      --instanceid string       submit with a specific controller's instance id label
  -l, --labels string           Comma separated labels to apply to the workflow. Will override previous values.
      --name string             override metadata.name
  -o, --output string           Output format. One of: name|json|yaml|wide
  -p, --parameter stringArray   pass an input parameter
  -f, --parameter-file string   pass a file containing all input parameters
      --priority int32          workflow priority
      --server-dry-run          send request to server with dry-run flag which will modify the workflow without creating it
      --serviceaccount string   run all pods in the workflow using specified serviceaccount
      --strict                  perform strict workflow validation (default true)
  -w, --wait                    wait for the workflow to complete
      --watch                   watch the workflow until it completes

@simster7 simster7 merged commit b024c46 into argoproj:master Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI command to run a CronWorkflow on demand
3 participants