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

Add different timeout flags for Pipeline start cmd #1642

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

vinamra28
Copy link
Member

@vinamra28 vinamra28 commented Jul 11, 2022

Changes

With Pipelines release v0.36.0, Timeouts was moved out of feature flags
and existing Timeout was deprecated.

This PR updates the timeouts flags of tkn pipeline start to allow user
to pass the different timeouts for Pipeline, PipelineTask and
FinallyTask before starting a Pipeline using CLI.

closes #1561

Signed-off-by: vinamra28 [email protected]

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Add flags `--pipeline-timeout`, `--tasks-timeout` and `--finally-timeout` before starting the Pipeline using tkn CLI. Also deprecating the existing `--timeout` flag

@tekton-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 11, 2022
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 11, 2022
@vinamra28 vinamra28 force-pushed the pipeline-timeouts branch from c5d5c77 to 5ab346b Compare July 13, 2022 07:50
@vinamra28
Copy link
Member Author

@pradeepitm12 @piyush-garg @vdemeester @chmouel

% ./tkn p start decision-pipeline --timeout 60m
Flag --timeout has been deprecated, please use --pipeline-timeout flag instead
? Value for param `input` of type `string`? taskB
PipelineRun started: decision-pipeline-run-6cf82

In order to track the PipelineRun progress run:
tkn pipelinerun logs decision-pipeline-run-6cf82 -f -n default

and the help command is now

% ./tkn p start --help
Start Pipelines

Usage:
tkn pipeline start [flags]

Examples:
  Start Pipeline foo by creating a PipelineRun named "foo-run-xyz123" from namespace 'bar':

    tkn pipeline start foo -s ServiceAccountName -n bar

For params value, if you want to provide multiple values, provide them comma separated
like cat,foo,bar

For passing the workspaces via flags:

- In case of emptyDir, you can pass it like -w name=my-empty-dir,emptyDir=
- In case of configMap, you can pass it like -w name=my-config,config=rpg,item=ultimav=1
- In case of secrets, you can pass it like -w name=my-secret,secret=secret-name
- In case of pvc, you can pass it like -w name=my-pvc,claimName=pvc1
- In case of volumeClaimTemplate, you can pass it like -w name=my-volume-claim-template,volumeClaimTemplateFile=workspace-template.yaml
  but before you need to create a workspace-template.yaml file. Sample contents of the file are as follows:
  spec:
   accessModes:
     - ReadWriteOnce
   resources:
     requests:
       storage: 1Gi


Available Plugins:
  results

Flags:
      --dry-run                       preview PipelineRun without running it
  -f, --filename string               local or remote file name containing a Pipeline definition to start a PipelineRun
      --finally-timeout string        timeout for Finally Tasks
  -h, --help                          help for start
  -l, --labels strings                pass labels as label=value.
  -L, --last                          re-run the Pipeline using last PipelineRun values
  -o, --output string                 format of PipelineRun (yaml, json or name)
  -p, --param stringArray             pass the param as key=value for string type, or key=value1,value2,... for array type
      --pipeline-timeout string       timeout for Pipeline
      --pod-template string           local or remote file containing a PodTemplate definition
      --prefix-name string            specify a prefix for the PipelineRun name (must be lowercase alphanumeric characters)
  -r, --resource strings              pass the resource name and ref as name=ref
  -s, --serviceaccount string         pass the serviceaccount name
      --showlog                       show logs right after starting the Pipeline
      --skip-optional-workspace       skips the prompt for optional workspaces
      --task-serviceaccount strings   pass the service account corresponding to the task
      --tasks-timeout string          timeout for Pipeline Tasks
      --use-param-defaults            use default parameter values without prompting for input
      --use-pipelinerun string        use this pipelinerun values to re-run the pipeline. 
  -w, --workspace stringArray         pass one or more workspaces to map to the corresponding physical volumes

Global Flags:
  -c, --context string      name of the kubeconfig context to use (default: kubectl config current-context)
  -k, --kubeconfig string   kubectl config file (default: $HOME/.kube/config)
  -n, --namespace string    namespace to use (default: from $KUBECONFIG)
  -C, --no-color            disable coloring (default: false)

do let me know if this looks good to you

@vinamra28 vinamra28 force-pushed the pipeline-timeouts branch from 5ab346b to 7ab6dcd Compare July 13, 2022 08:39
@vinamra28 vinamra28 marked this pull request as ready for review July 13, 2022 08:39
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2022
@tekton-robot tekton-robot requested review from hrishin and sthaha July 13, 2022 08:40
@vinamra28 vinamra28 force-pushed the pipeline-timeouts branch from 7ab6dcd to 8521a77 Compare July 13, 2022 08:54
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 13, 2022
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2022
@vinamra28 vinamra28 force-pushed the pipeline-timeouts branch from ac63404 to f2b413b Compare July 13, 2022 13:58
@vinamra28
Copy link
Member Author

/retest

With Pipelines release v0.36.0, Timeouts was moved out of feature flags
and existing Timeout was deprecated.

This PR updates the timeouts flags of `tkn pipeline start` to allow user
to pass the different timeouts for `Pipeline`, `PipelineTask` and
`FinallyTask` before starting a `Pipeline` using CLI.

Signed-off-by: vinamra28 <[email protected]>
@vinamra28 vinamra28 force-pushed the pipeline-timeouts branch from f2b413b to f03df98 Compare July 13, 2022 16:57
@vinamra28 vinamra28 requested a review from piyush-garg July 14, 2022 04:04
@piyush-garg
Copy link
Contributor

/approve

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: piyush-garg, vdemeester

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:
  • OWNERS [piyush-garg,vdemeester]

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

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2022
@chmouel
Copy link
Member

chmouel commented Jul 20, 2022

/lgtm

@vinamra28
Copy link
Member Author

/retest

2 similar comments
@piyush-garg
Copy link
Contributor

/retest

@vinamra28
Copy link
Member Author

/retest

@tekton-robot tekton-robot merged commit d8f4428 into tektoncd:main Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for PipelineRun Timeouts
5 participants