-
Notifications
You must be signed in to change notification settings - Fork 1.8k
RHDEVDOCS 6414 new Results CLI #95134
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,4 +170,6 @@ $ oc get pipelinerun <cr_name> -o yaml | |
|
||
You can access every result and record by its name. You can also use Common Expression Language (CEL) queries to search for results and records by the information they contain, including the YAML manifest. | ||
|
||
You can also configure {tekton-results} to facilitate forwarding the logging information of all the tools that ran as a part of a pipeline or task to LokiStack. You can then query {tekton-results} for logging information of the task run associated with a {tekton-results} record. | ||
You can configure {tekton-results} to facilitate forwarding the logging information of all the tools that ran as a part of a pipeline or task to LokiStack. You can then query {tekton-results} for logging information of the task run associated with a {tekton-results} record. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe out of scope, but consider:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of scope and would require SME discussion |
||
|
||
You can also query results and logs by the names of pipeline runs and task runs. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// This module is included in the following assembly: | ||
// | ||
// * records/using-tekton-results-for-openshift-pipelines-observability.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="results-opc-config_{context}"] | ||
= Configuring the opc utility for querying results by pipeline run and task run names | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be clear: is this "for querying" or "to query"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "for querying" because I don't want a misreading that it has to be done every time one runs such a query - it's a one off on a machine/user account |
||
|
||
[role="_abstract"] | ||
Before you can query results from {tekton-results} by pipeline run and task run names, you must configure the `opc` utility. | ||
|
||
.Prerequisites | ||
|
||
* You installed the `opc` utility. | ||
* You logged on to the {OCP} cluster by using the {oc-first}. | ||
|
||
.Procedure | ||
|
||
. Create an authentication token for the {tekton-results} API by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc create token <service_account> | ||
---- | ||
+ | ||
Replace `<service_account>` with the name of an {OCP} service account that has read access to the namespaces where {pipelines-shortname} ran the pipeline runs and task runs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good place for a DL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DLs are not used elsewhere in this particular docset (Pipelines), so this would break consistency |
||
+ | ||
Save the string that this command outputs. | ||
|
||
. Complete one of the following steps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do I know which step to pick? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pure personal preference as the result is exactly the same. I am not sure I can add any clarification here that would not just be a duplication. |
||
|
||
** Configure the `opc` utility interactively by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results config set | ||
---- | ||
+ | ||
Reply to the prompts that the utility displays. For `Token`, enter the authentication token that you created. | ||
|
||
** Configure the `opc` utility from a command by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results config set --host="https://tekton-results.example.com" --token="<token>" | ||
---- | ||
+ | ||
Replace the host name with the fully qualified domain name of your {tekton-results} route. Replace `<token>` with the authentication token that you generated. | ||
|
||
.Verification | ||
|
||
* You can view the configuration that you set for the `opc` utility by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results config view | ||
---- | ||
+ | ||
.Example output | ||
[source,terminal] | ||
---- | ||
api-path: "" | ||
apiVersion: results.tekton.dev/v1alpha2 | ||
host: https://tekton-results.openshiftapps.com | ||
insecure-skip-tls-verify: "true" | ||
kind: Client | ||
token: sha256~xyz | ||
---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// This module is included in the following assembly: | ||
// | ||
// * records/using-tekton-results-for-openshift-pipelines-observability.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="results-opc-pipelinerunlist_{context}"] | ||
= Viewing a list of pipeline run names and identifiers | ||
|
||
[role="_abstract"] | ||
You can use the `opc` utility to view a list of names and identifiers of pipeline runs in a namespace. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check for repeated line breaks across PR. |
||
.Prerequisites | ||
|
||
* You installed the `opc` utility. | ||
* You configured the `opc` utility to query results from {tekton-results} by pipeline run and task run names. | ||
|
||
.Procedure | ||
|
||
* Use any of the following commands to view pipeline runs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which should I pick and why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That information is already present in each of the unnumbered substeps. One is "To view all pipeline runs in a specified namespace" and the other is "To view pipeline runs related to specified named pipelines" |
||
|
||
** To view all pipeline runs in a specified namespace, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun list -n <namespace_name> | ||
---- | ||
+ | ||
Optionally, specify the `--limit` command line option, for example, `--limit=10`. With this setting, the `opc` command displays the specified number of lines containing pipeline run names and then exits. If you add the `--single-page=false` command line option, the command displays the specified number of lines and then prompts you to continue or quit. | ||
+ | ||
Optionally, specify the `--labels` command line option, for example, `--labels="app.kubernetes.io/name=test-app, app.kubernetes.io/component=database`. With this setting, the list includes only the pipeline runs that have the specified labels or annotations. | ||
+ | ||
.Example output of the `opc results pipelinerun list` command | ||
+ | ||
[source,terminal] | ||
---- | ||
NAME UID STARTED DURATION STATUS | ||
openshift-pipelines-main-release-tests-zscq8 78515e3a-8e20-43e8-a064-d2442c2ae845 1 week ago 5s Failed(CouldntGetPipeline) | ||
openshift-pipelines-main-release-tests-zrgv6 14226144-2d08-440d-a600-d602ca46cdf6 1 week ago 26m13s Failed | ||
openshift-pipelines-main-release-tests-jdc24 e34daea2-66fb-4c7d-9d4b-d9d82a07b6cd 1 week ago 5s Failed(CouldntGetPipeline) | ||
openshift-pipelines-main-release-tests-6zj7f 9b3e5d68-70ab-4c23-8872-e7ad7121e60b 1 week ago 5s Failed(CouldntGetPipeline) | ||
openshift-pipelines-main-release-tests-kkk9t 2fd28c48-388b-4e6a-9ec3-2bcd9dedebc3 1 week ago 5s Failed(CouldntGetPipeline) | ||
---- | ||
|
||
** To view pipeline runs related to specified named pipelines, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun list <pipeline_name> -n <namespace_name> | ||
---- | ||
+ | ||
The command lists all pipeline runs for pipelines that have names containing `<pipeline_name>`. For example, if you specify `build`, the command displays all pipeline runs related to pipelines named `build`, `build_123`, or `enhancedbuild`. | ||
+ | ||
Optionally, specify the `--limit` command line option, for example, `--limit=10`. With this setting, the `opc` command displays the specified number of lines containing pipeline run names and then exits. If you add the `--single-page=false` command line option, the command displays the specified number of lines and then prompts you to continue or quit. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// This module is included in the following assembly: | ||
// | ||
// * records/using-tekton-results-for-openshift-pipelines-observability.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="results-opc-pipelinerunresults_{context}"] | ||
= Viewing result information for a pipeline run | ||
|
||
[role="_abstract"] | ||
You can use the `opc` utility to view a description of when and how a pipeline run completed, a full manifest for the pipeline run, and any logs that the pipeline run produced. | ||
|
||
.Prerequisites | ||
|
||
* You installed the `opc` utility. | ||
* You configured the `opc` utility to query results from {tekton-results} by pipeline run and task run names. | ||
* You have the name or UUID of the pipeline run. You can use the `ocp results list pipelineruns` commands to view names and UUIDs of pipeline runs for which results are available. | ||
|
||
.Procedure | ||
|
||
* Use any of the following commands to view the result information for a pipeline run: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which and why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here - each substep explains its use case |
||
** To view a description of when and how the pipeline run completed, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun describe -n <namespace_name> <pipelinerun_name> | ||
---- | ||
+ | ||
Alternatively, you can use the pipeline run UUID instead of the name: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun describe -n <namespace_name> --uid <pipelinerun_uuid> | ||
---- | ||
Comment on lines
+28
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nice to include, but I worry over whether the expansiveness threatens conciseness. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes many names are VERY similar and easy to mix up, so in those cases people prefer UUIDs |
||
+ | ||
.Example output of the `opc results pipelinerun describe` command | ||
[source,terminal] | ||
---- | ||
Name: operator-main-index-4-18-on-pull-request-7kssl | ||
Namespace: tekton-ecosystem-tenant | ||
Service Account: appstudio-pipeline | ||
Labels: | ||
app.kubernetes.io/managed-by=pipelinesascode.tekton.dev | ||
app.kubernetes.io/version=v0.33.0 | ||
Annotations: | ||
appstudio.openshift.io/snapshot=openshift-pipelines-main-b7jj6 | ||
build.appstudio.openshift.io/repo=https://github.com/openshift-pipelines/operator?rev=ba5e62e51af0c88bc6c3fd4201e789bdfc093daa | ||
|
||
📌 Status | ||
STARTED DURATION STATUS | ||
27d ago 9m54s Succeeded | ||
|
||
⏱ Timeouts | ||
Pipeline: 2h0m0s | ||
|
||
⚓ Params | ||
NAME VALUE | ||
• git-url https://github.com/pramodbindal/operator | ||
• revision ba5e62e51af0c88bc6c3fd4201e789bdfc093daa | ||
|
||
🗂 Workspaces | ||
NAME SUB PATH WORKSPACE BINDING | ||
• workspace --- VolumeClaimTemplate | ||
• git-auth --- Secret (secret=pac-gitauth-ceqzjt) | ||
|
||
📦 Taskruns | ||
NAME TASK NAME | ||
• operator-main-index-4-18-on-pull-request-7kssl-init init | ||
• operator-main-index-4-18-on-pull-request-7kssl-clone-repository clone-repository | ||
---- | ||
|
||
* To view the full YAML manifest of the pipeline run, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun describe -n <namespace_name> --output yaml <pipelinerun_name> | ||
---- | ||
+ | ||
Alternatively, you can use the pipeline run UUID instead of the name: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same answer |
||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun describe -n <namespace_name> --output yaml --uid <pipelinerun_uuid> | ||
---- | ||
|
||
* To view the logs associated with the pipeline run, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun logs -n <namespace_name> <pipelinerun_name> | ||
---- | ||
+ | ||
Alternatively, you can use the pipeline run UUID instead of the name: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results pipelinerun logs -n <namespace_name> --uid <pipelinerun_uuid> | ||
---- | ||
|
||
[IMPORTANT] | ||
==== | ||
Logs that the `opc results pipelinerun logs` displays do not include logs of task runs that completed within this pipeline run. To view these logs, find the names of the task runs in this pipeline run using the `opc results taskrun list --pipelinerun` command and specify the name of the pipeline run. Then use the `opc results taskrun log` command to view the logs for the task runs. | ||
==== |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This module is included in the following assembly: | ||
// | ||
// * records/using-tekton-results-for-openshift-pipelines-observability.adoc | ||
|
||
:_mod-docs-content-type: REFERENCE | ||
[id="results-opc-shortnames_{context}"] | ||
= Short names for command-line arguments | ||
|
||
When using the `opc` utility to query results from {tekton-results} by pipeline run and task run names, you can replace long command-line arguments with short versions of their names. | ||
|
||
.Short names for command-line parameters | ||
[cols="1,1",options="header"] | ||
|=== | ||
| Full parameter name | Short parameter name | ||
|
||
| `pipelinerun` | `pr` | ||
| `taskrun` | `tr` | ||
| `describe` | `desc` | ||
|
||
|=== |
mramendi marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// This module is included in the following assembly: | ||
// | ||
// * records/using-tekton-results-for-openshift-pipelines-observability.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="results-opc-taskrunlist_{context}"] | ||
= Viewing a list of task run names and identifiers | ||
|
||
[role="_abstract"] | ||
You can use the `opc` utility to view a lists of names and identifiers of task runs in a namespace or of task runs associated with a pipeline dun. | ||
|
||
.Prerequisites | ||
|
||
* You installed the `opc` utility. | ||
* You configured the `opc` utility to query results from {tekton-results} by pipeline run and task run names. | ||
|
||
.Procedure | ||
|
||
* To view a list of all task runs in a namespace, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results taskrun list -n <namespace_name> | ||
---- | ||
+ | ||
Optionally, specify the `--limit` command line option, for example, `--limit=10`. With this setting, the `opc` command displays the specified number of lines containing pipeline run names and then exits. If you add the `--single-page=false` command line option, the command displays the specified number of lines and then prompts you to continue or quit. | ||
+ | ||
Optionally, specify the `--labels` parameter, for example, `--labels="app.kubernetes.io/name=test-app, app.kubernetes.io/component=database`. With this setting, the list includes only the task runs that have the specified labels or annotations. | ||
+ | ||
.Example output of the `opc results pipelinerun list` command for a namespace | ||
+ | ||
[source,terminal] | ||
---- | ||
NAME UID STARTED DURATION STATUS | ||
openshift-pipelines-main-release-tests-zrgv6-e2e-test 10d6952f-b926-4e4b-a976-519867969ce7 16d ago 12m41s Failed | ||
openshift-pipelines-main-release-tests-zrgv6-deploy-operator ab41b63b-16ec-4a32-8b95-f2678eb5c945 16d ago 22s Succeeded | ||
openshift-pipelines-main-release-tests-zrgv6-provision-cluster b374df00-5132-4633-91df-3259670756b3 16d ago 12m30s Succeeded | ||
operator-main-index-4-18-on-pull-request-ml4ww-show-sbom c5b77784-cd87-4be8-bc12-28957762f382 16d ago 16s Succeeded | ||
openshift-c4ae3a5a28e19ffc930e7c2aa758d85c-provision-eaas-space 22535d8e-d360-4143-9c0c-4bd0414a22b0 16d ago 17s Succeeded | ||
---- | ||
|
||
* To view a list of task runs associate with a pipeline run, enter the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ opc results taskrun list --pipelinerun <pipelinerun_name> -n <namespace_name> | ||
---- | ||
+ | ||
Optionally, specify the `--limit` command line option, for example, `--limit=10`. With this setting, the `opc` command displays the specified number of lines containing pipeline run names and then exits. If you add the `--single-page=false` command line option, the command displays the specified number of lines and then prompts you to continue or quit. | ||
|
||
.Example output of the `opc results taskrun list` command for a pipeline run | ||
+ | ||
[source,terminal] | ||
---- | ||
NAME UID STARTED DURATION STATUS | ||
operator-main-index-4-18-on-pull-request-g95fk-show-sbom 5b405941-0d3e-4f8c-a68a-9ffcc481abf1 16d ago 13s Succeeded | ||
operator-main-index-4-18-on-pul2b222db723593a186d12f1b82f1a1fd9 89588ae7-aa36-4b62-97d1-5634ee201850 16d ago 36s Succeeded | ||
operator-fb80434867bc15d89fea82506058f664-fbc-fips-check-oci-ta 7598d44a-4370-459b-8ef0-ae4165c58ba5 16d ago 5m52s Succeeded | ||
operator-main-index-4-18-on-pull-request-g95fk-validate-fbc fb80d962-807b-4b63-80cb-6a57d383755a 16d ago 1m26s Succeeded | ||
operator-main-index-4-18-on-pull-request-g95fk-apply-tags 8a34b46d-74a9-4f20-9e99-a285f7b258d6 16d ago 13s Succeeded | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good place to use a description list to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DLs are not used elsewhere in this particular docset (Pipelines), so this would break consistency