tektoncd / cli Goto Github PK
View Code? Open in Web Editor NEWA CLI for interacting with Tekton!
License: Apache License 2.0
A CLI for interacting with Tekton!
License: Apache License 2.0
It woudl be nice to have a COPR RPM repo for our user to quickly try tkn on
their rpm based desktop systems.
more info: https://copr.fedorainfracloud.org/
The command name is inconsistent for a pipelinerun
instance. It should be in singular form.
pipeline Manage pipelines
pipelinerun Manage pipelineruns
pipeline Manage pipelines
pipelineruns Manage pipelineruns
Brew is a popular installer on OSX, provide a way to installs tekton-cli with it.
Add a feature/flag to display PipelineRuns/TaskRuns logs for a specified pipeline in real-time.
Inputs (Required): PipelineRuns/TaskRuns name to respective logs commands
Output: show logs from the PipelineRuns/TaskRuns to follow logs in real-time
tkn logs pr <pipelinerun-name> -f
tkn logs tr <taskrun-name> -f
This maybe a far fetched idea but let's try, it would be nice if tkn logs
can
go over the logs messages and higlight some patterns. For example if we have a regexp like this :
(^\d+\) .+)|(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)
it would match a java error and color match the right fields.
It would be nice if that include :
tkn
Document how to download an use the CLI, commands, etc
We currently have the brews in https://github.com/chmouel/homebrew-tektoncd-cli/
and we should have it to something more official :
Suggestions :
Formula
folder in tektoncd/cli
(is it possible ?)tektoncd
organisation as tektoncd/homebrew-tektoncd-cli/
/kind question
The tkn pr describe
command does not include any details when a pipeline run fails:
$ tkn pr describe build-pipelinerun-4cp85
Name: build-pipelinerun-4cp85
Namespace: pipelines-tutorial
Pipeline Ref: build-pipeline
Service Account: pipeline
Status
STARTED DURATION STATUS
41 seconds ago 0 seconds Failed(PipelineInvalidGraph)
Resources
NAME RESOURCE REF
app-git petclinic-git
app-image petclinic-image
Params
No params
Taskruns
No taskrun
While this info is available on the status:
$ kubectl describe pipelinerun build-pipelinerun-4cp85
...
Status:
Completion Time: 2019-06-05T13:20:32Z
Conditions:
Last Transition Time: 2019-06-05T13:20:32Z
Message: PipelineRun pipelines-tutorial/build-pipelinerun-4cp85's Pipeline DAG is invalid: couldn't add link between deploy and build-image: Task deploy depends on build-image but build-image wasn't present in Pipeline
Reason: PipelineInvalidGraph
Status: False
Type: Succeeded
Start Time: 2019-06-05T13:20:32Z
Events: <none>
Add command to list PipelineResources
.
Expected Output:
Name Type
....
....
Input (Required): task-run name
Output: Cancel the running task-run
The pipelinerun details shows the taskrun names but not the task names which which makes it difficult to use the -t
flag with tkn pr logs
to limit the logs displayed:
Taskruns
NAME STARTED DURATION STATUS
petclinic-deploy-pipelinerun-lkq7d-build-hwm58 15 minutes ago 3 minutes Succeeded
petclinic-deploy-pipelinerun-lkq7d-deploy-z7z9w 12 minutes ago 14 seconds Succeeded
A column should be added to show the task name as well.
The use-case is for a user to be able to run the following
tkn pr describe my-pipelinerun-lkq7d
Find out the task names and then run
tkn pr logs my-pipelinerun-lkq7d -t task-name
When a pipelinerun is just created and no logs are available, the tkn pipelinerun logs
returns silently:
$ tkn pipelinerun logs mapit-build-pipelinerun-1 -f
$
It should print out a message instead to say no logs are available yet or something similar.
It woudl be nice to have a Ubuntu PPA APT repo for our users to quickly try tkn on
their debs based desktop systems.
more info: https://launchpad.net/ubuntu/+ppas
Add zsh shell
support for tkn completion SHELL
command.
tkn completion SHELL zsh
At this moment tkn completion SHELL
supports bash shell
.
Input (Required): task-run name
Output: show logs from all the steps in the task-run
Follow mode to show and follow logs in real time
Similar to #5
Installing Tekton Pipelines on a cluster can be simplified using the CLI:
tkn install
The command would configure the cluster (minikube, GCP, OpenShift, etc) and installs Tekton Pipelines.
Input (Required): pipeline-run name
Output: cancel the running pipeline-run
When a subcommand is invalid but have a flag (here -n
) it should still fail, but it currently does not.
$ tkn pipeline foo -n pipeline-demo
# […]
$ echo $?
1
$ tkn pipeline foo -n pipeline-demo
$ echo $?
0
Add a command to display the details of a pipeline
Input: pipeline name
Output: pipeline details and list of last 10 pipeline-runs
The pipeline details include:
For each pipeline-run the following details should be printed:
tkn completion -h
should display help message like
$ tkn completion -h
This command prints shell completion code which must be evaluated to provide interactive completion
Supported Shells:
- bash
Usage:
tkn completion SHELL [flags]
Examples:
# generate completion code for bash
tkn completion bash > bash_completion.sh
source bash_completion.sh
Flags:
-h, --help help for completion
It shows output somewhat like following
$ tkn completion -h
This command prints shell completion code which must be evaluated to provide interactive completion
Supported Shells:
- bash
Usage:
tkn completion SHELL [flags]
Examples:
# generate completion code for bash
tkn completion bash > bash_completion.sh
source bash_completion.sh
Flags:
-h, --help help for completion
The list of TaskRun
present in the pipelinerun describe
command are appearing in random order. I think they should always appear in the same order.
$ tkn pr desc cli-release-pipeline-run2gjrn
Name: cli-release-pipeline-run2gjrn
Namespace: default
Pipeline Ref: cli-release-pipeline
# […]
Taskruns
NAME STARTED DURATION STATUS
cli-release-pipeline-run2gjrn-build-n66sl 19 hours ago 50 seconds Succeeded
cli-release-pipeline-run2gjrn-lint-twqdk 19 hours ago 22 seconds Succeeded
cli-release-pipeline-run2gjrn-release-8z6l5 19 hours ago 3 minutes Succeeded
cli-release-pipeline-run2gjrn-unit-tests-flcth 19 hours ago 1 minute Succeeded
$ tkn pr desc cli-release-pipeline-run2gjrn
Name: cli-release-pipeline-run2gjrn
Namespace: default
Pipeline Ref: cli-release-pipeline
# […]
Taskruns
NAME STARTED DURATION STATUS
cli-release-pipeline-run2gjrn-lint-twqdk 19 hours ago 22 seconds Succeeded
cli-release-pipeline-run2gjrn-release-8z6l5 19 hours ago 3 minutes Succeeded
cli-release-pipeline-run2gjrn-unit-tests-flcth 19 hours ago 1 minute Succeeded
cli-release-pipeline-run2gjrn-build-n66sl 19 hours ago 50 seconds Succeeded
Krew is the plugin manager for kubectl
. Tekton CLI should be added to the Krew plugin index to make it easy to discover and install it:
https://github.com/kubernetes-sigs/krew-index
kubectl krew install tkn
Add a command to list tasks
pipelinerun
(taskrun
) doc should have the link for logs
and describe
subcommands
pipelinerun
(taskrun
) doc dont have any links for the above subcommands
Add a command to list pipelines. For each pipeline, the following details should be displayed in addition to the pipeline details:
Replace step sorter (pods container iteration) with taskrun status
#Ref
Extract the log_reader
and log_writter
to respective packages like taskun
, pipelinerun
Use better dep for color logs printing
If that's even possible with goreleaser output :
% brew audit --strict tektoncd-cli
[...]
chmouel/tektoncd-cli/tektoncd-cli:
* C: 3: col 9: Description shouldn't start with an indefinite article, i.e. "A"
* C: 17: col 1: Trailing whitespace detected.
* C: 20: col 1: Trailing whitespace detected.
* C: 23: col 1: Trailing whitespace detected.
* Use `system "#{bin}/tkn", "--version"` instead of `system "#{bin}/tkn --version"`
/kind bug
Currently, tkn pipelinerun describe my-run
display the TaskRun attached to the PipelineRun.
This means:
I think we should show the Pipeline Task for the PipelineRun, either merged with the TaskRun part (aka, listing the Task and attaching the TaskRun status to it) or in a separate table
/kind question
cc @siamaksade
tkn
should provide the same feature as kubectl get … --watch
, aka watching changes for list.
-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded
if no object name is provided.
This applies to the runtime field
taskrun
pipelinerun
/kind enhancement
Input (Required): name of the pipeline-run
Output: pipeline-run details and relevant logs
If the pipeline has fail, the reason for failure should be displayed
make
than go build ./...
make check
which does all the checks we want withoutmake release
all centralised and not just in @vdemeesterThe tkn version
command currently returns dev
instead of the cli version:
$ tkn version
Client version: dev
% tkn pipelinerun describe [TAB]
pipelinerun1 pipelinerun2e ....
completion system don't offer anything else than completion for arguments and keywords, not objects (as which pipelineruns)
mattmoor/kontext is a useful way to package a local directory up and store it in a container registry.
This is useful for when a user would like to upload a directory without requiring access to a new data plane (e.g., GCP's Cloud Storage).
/cc @mattmoor
In the spririt of kubectl --template
or even like docker's cli :
--format string Pretty-print containers using a Go template
We need a way to output machine readable so that well machine (like the shell
completion for example) can consume it easily.
kubectl --template
?kubectl --template
with only the minimal featuredocker --format
do which look simple enough for our use case,If no ServiceAccount are attached to the PipelineRun, we should hide the information (or display <none>
.
Currently it displays :
Name: cli-release-pipeline-run2gjrn
Namespace: default
Pipeline Ref: cli-release-pipeline
Service Account:
Status
STARTED DURATION STATUS
19 hours ago 5 minutes Succeeded
clientcmd
from k8s and cli-runtime
hold some useful helpers to define common flags and create clients from them easily.
An example would be to use clientcmd.NewNonInteractiveDeferredLoadingClientConfig
. The main goal for this is to make sure we get the current context and thus the correct default namespace.
We currently show the task name in blue on the left :
[build-skaffold-app : step-build-and-push] --cache Use cache when building image
which is nice and all but sometime you want to copy and paste nicely the output of the task and have only whatever logs output not something change,
let's have an option like --porcelain (like git porcelain https://stackoverflow.com/questions/6976473/what-does-the-term-porcelain-mean-in-git) to output only the logs and nothing else.
In the pipeline describe and pipeline run describe, we are defining constants and using them later for the table header and body while printing the output.
cli/pkg/cmd/pipeline/describe.go
Line 31 in 8ef40b2
cli/pkg/cmd/pipelinerun/describe.go
Line 30 in 8ef40b2
we can use https://golang.org/pkg/text/template/ for templatizing the output
Input (Required): pipeline name
Input: pipeline resources (infer values when possible e.g. git from current dir)
Input: pipeline parameters
Output: create a pipeline-run and the resources and print the name of the pipeline-run
Ideally, it should be possible to run a minimal command like tkn trigger foo-pipeline
in order to trigger a pipeline with resources being populated automatically
Add a command to display pipeline runs for a specified pipeline.
Inputs (Required): pipeline-run name
Input (Optional): task name
Output: show logs from the pipeline-run. If the task name is specified, then only logs from that specific task are displayed
It should also be possible to follow logs in real time
It would be nice when asking for multiple choices unless overriden by a CLI switch to have an interactive prompt like the for example the way jenkinx-x/jx
is doing.
This is the library used here :
https://github.com/AlecAivazis/survey
An example of multiple choices :
In practice this could look like this, when for example we do :
tkn pipelineruns logs
with no options
ask for a namespace (default to current)
ask for a pipelinerun from an interactive multiple choices (default to the only one if there is only one)
if -t is specified with no argument and with a task :
ask for a task from a list of arguments
When possible, if there are no verbs specified for a command then it should default to list
if it is relevant for that command.
For example the following should show the list of pipelines.
tkn pipeline
Currently it defaults to the -h
and prints the help docs.
Quite often a user would want to look at the latest pipelinerun of a certain pipeline. The current flow requires two steps:
tkn pipeline describe
or tkn pr ls
tkn pr logs [pipelinerun-name]
command.It would be helpful to simplify that by providing a shortcut command that shows the logs for the latest pipelinerun that is started for a given pipeline:
tkn pipeline logs [pipeline-name]
There could also be flags to allow choosing pipelineruns prior to the latest
Input (Required): pipeline name
Output: list of pipeline-runs for the given pipeline. For each pipeline-run the following details should be printed:
At present, the tests for list pipelinerun command are hard to understand. Also, it should to use the new packages and some tets utils in order to bring consistency with other list commands.
The pipelinerun list is current sorted on pipelinerun names:
$ tkn pr ls
NAME STARTED DURATION STATUS
build-pipelinerun-6pj44 2 hours ago 5 minutes Failed
build-pipelinerun-86crw 2 hours ago 1 minute Failed
build-pipelinerun-djx29 1 minute ago --- Running
build-pipelinerun-gmldx 1 hour ago 5 minutes Failed
build-pipelinerun-xsl42 1 hour ago 5 minutes Failed
It should be sorted based on time started instead with latest showing up at the top.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.