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

Taskruns: hard to follow steps status of a task #549

Closed
hrishin opened this issue Feb 22, 2019 · 12 comments
Closed

Taskruns: hard to follow steps status of a task #549

hrishin opened this issue Feb 22, 2019 · 12 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given

Comments

@hrishin
Copy link
Member

hrishin commented Feb 22, 2019

Consider the following task

...
kind: Task
...
spec:
  steps:
    - name: echo1
      image: ubuntu
      command:
        - echo
      args:
        - "hello world 1"
    - name: echo2
      image: ubuntu
      command:
        - echo
      args:
        - "hello world 2"

Once the user executes a such Task using Taskrun the status appears like as follow

status:
  conditions:
  - lastTransitionTime: "2019-02-22T05:22:48Z"
    status: "True"
    type: Succeeded
  podName: echo-hello-world-task-run-pod-c1eaa6
  startTime: "2019-02-22T05:22:15Z"
  steps:
  - logsURL: ""
    terminated:
      containerID: docker://c317b86c9aa06e9ec6d167fc67b819fc8c023010804a6cf69f64fbaaf92acde8
      exitCode: 0
      finishedAt: "2019-02-22T05:22:17Z"
      reason: Completed
      startedAt: "2019-02-22T05:22:17Z"
  - logsURL: ""
    terminated:
      containerID: docker://dd36b9b1d1f5f5181f51ab54ba491b2df99ff25a39daf72d6888c9ad8549e1b5
      exitCode: 0
      finishedAt: "2019-02-22T05:22:22Z"
      reason: Completed
      startedAt: "2019-02-22T05:22:22Z"
  - logsURL: ""
    terminated:
      containerID: docker://5c4077eee28c6b254e09456ad26533ace5644adf341ea589344eb6c186857a7f
      exitCode: 0
      finishedAt: "2019-02-22T05:22:28Z"
      reason: Completed
      startedAt: "2019-02-22T05:22:28Z"

Now as a user I'm not able to determine the status of individual steps. This be might be addressed in #146

Expected Behavior

It's better to associate step name in the individual step status.

Actual Behavior

Taskrun step status doesn't have any association/mapping between step information and its status.
Also wondering 3rd step in the status though task mentions only 2 steps.

Steps to Reproduce the Problem

  1. Create a Task
  2. Create Runtask
bobcatfish added a commit to bobcatfish/pipeline that referenced this issue Feb 28, 2019
In tektoncd#549 @hrishin pointed out that it's hard to understand from the step
status exactly which step did what. While looking at this I realized
that we have included a field `logsURL` which we never populate - I
thought this was copied over from Build but it was actually from our
original prototype API and we have never used it. In #107 we should be
revisiting making logs available and we may add in something like this,
but since we're not using it and it's not clear if we ever will, let's
remove it for now.
@bobcatfish
Copy link
Collaborator

Thanks for opening this @hrishin ! That's a good point - I think I usually work around this by going straight to the pod itself but that's quite a pain and it would be useful to have more info in the TaskRun status directly.

Looking at StepState it's pretty much just corev1.ContainerState right now. If we add in the step names for each of these, does that do the trick @hrishin or is there more info that you already know you'd want?

(In the future we might want to consider including more info from the pod status maybe 🤔 )

Note to the implementer: We support unnamed steps as well.

@bobcatfish bobcatfish added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given labels Feb 28, 2019
knative-prow-robot pushed a commit that referenced this issue Mar 1, 2019
In #549 @hrishin pointed out that it's hard to understand from the step
status exactly which step did what. While looking at this I realized
that we have included a field `logsURL` which we never populate - I
thought this was copied over from Build but it was actually from our
original prototype API and we have never used it. In #107 we should be
revisiting making logs available and we may add in something like this,
but since we're not using it and it's not clear if we ever will, let's
remove it for now.
@hrishin
Copy link
Member Author

hrishin commented Mar 4, 2019

I think I usually work around this by going straight to the pod itself but that's quite a pain and it would be useful to have more info in the TaskRun status directly.

Yes, it's painful.

Looking at StepState it's pretty much just corev1.ContainerState right now. If we add in the step names for each of these, does that do the trick

@bobcatfish I think we need container name (it may be init-container name) for stepstate or taskstate along with whether it's waiting, running, terminated. At this moment we don't have any association between state and step name, right?. As a progressive step, it would be better to have logUrl or logBlob which we are going to address in #107, I guess. right?

@hrishin
Copy link
Member Author

hrishin commented Mar 4, 2019

Let me run the task and pipelines, will post more updates about it. However containerstatus looks good enough.

@hrishin
Copy link
Member Author

hrishin commented Mar 6, 2019

For task and taskrun, the following kind of status could be helpful:

status:
  conditions:
  - lastTransitionTime: "2019-03-06T06:27:41Z"
    status: "True"
    type: Succeeded
  podName: echo-hello-world-task-run-pod-58fa47
  taskName: echo-hello-world 
  startTime: "2019-03-06T06:25:57Z"
  steps:
  - name: "credential-initializer"
    terminated:
      containerID: docker://3231c9736b099b57cbac3000b5fa118617af065816a8db9b9783a5ee9d8b5ad3
      exitCode: 0
      finishedAt: "2019-03-06T06:26:38Z"
      reason: Completed
      startedAt: "2019-03-06T06:26:38Z"
  - name: "echo1"
    terminated:
      containerID: docker://91f963a2bb984ec85b3355e32c0755c3b75fa1e5ae420b5984d817de9b7188b4
      exitCode: 0
      finishedAt: "2019-03-06T06:26:51Z"
      reason: Completed
      startedAt: "2019-03-06T06:26:51Z"
  - name: "echo1"
    terminated:
      containerID: docker://f5e8a13a9a91859dfd6912187f0bf9851213e215d9d75ec22bd132174c9da10e
      exitCode: 0
      finishedAt: "2019-03-06T06:26:58Z"
      reason: Completed
      startedAt: "2019-03-06T06:26:58Z"

where task definition is

spec:
  steps:
    - name: echo1
      image: ubuntu
      command:
        - echo
      args:
        - "hello world 1"
    - name: echo2
      image: ubuntu
      command:
        - echo
      args:
        - "hello world 2"

So

  • taskName: represents the the actual task name from definition
  • .steps.name: represents the actual name of each step from definition

This could help in exact UI/Visual presentation of a pipeline. This could also be useful for doing benchmarking of steps, task and whole pipeline (i.e. exporting metrics in Prometheus).

@hrishin
Copy link
Member Author

hrishin commented Mar 6, 2019

For unnamed steps, I'm really not sure. Maybe putting sequence number with step names could be possible options like

status:
  conditions:
  - lastTransitionTime: "2019-03-06T13:04:21Z"
    status: "True"
    type: Succeeded
  podName: test-unnamed-steps-pod-64c75b
  startTime: "2019-03-06T13:03:23Z"
  steps:
  - name: "step 1"
    terminated:
      containerID: docker://010bb14c157024726a8b2261c8f4ef5d5d4162b37ef8daa7c7ddd76ba60f3b81
      exitCode: 0
      finishedAt: "2019-03-06T13:03:26Z"
      reason: Completed
      startedAt: "2019-03-06T13:03:26Z"
  - name: "step 2"
    terminated:
      containerID: docker://d6a59e9fdf236966cb9788cbed45525cdef31b214d7e113d1035d201d9efabe3
      exitCode: 0
      finishedAt: "2019-03-06T13:03:33Z"
      reason: Completed
      startedAt: "2019-03-06T13:03:33Z"
  - name: "step 3"
    terminated:
      containerID: docker://cd9de32bf993dcd45492f0768b134e258779fc1eff895658bc578b78587f4841
      exitCode: 0
      finishedAt: "2019-03-06T13:03:42Z"
      reason: Completed
      startedAt: "2019-03-06T13:03:42Z"

Any reason we are allowing unnamed steps in a task? what would happen if mandate name to each step?

@skeeey
Copy link

skeeey commented Mar 22, 2019

@bobcatfish the latest code does not allow user to use unnamed step, is it right? when I apply a task that has unnamed steps, the below error will be printed

Error from server (InternalError): error when creating "uname-steps-task.yaml": Internal error occurred: admission webhook "webhook.tekton.dev" denied the request: mutation failed: invalid value "": taskspec.steps.name
Task step name must be a valid DNS Label, For more info refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

@skeeey
Copy link

skeeey commented Mar 22, 2019

I send out a PR to add a step name to taskrun status

@hrishin
Copy link
Member Author

hrishin commented Mar 26, 2019

Hi @skeeey
What do you mean by latest code? I've tried from last release, there unamed task is working.

Hi @bobcatfish @vdemeester @imjasonh
Could you please confirm if we have dropped the support for unamed steps?

@skeeey
Copy link

skeeey commented Mar 27, 2019

@hrishin not the last release, I used the master code, :-)

@imjasonh
Copy link
Member

(Stumbled across this going through good-first-issues)

Is this still an issue?

We still support unnamed steps. If a user doesn't name a step, it's corresponding container name in the Pod will be step-unnamed-N where N is the index in the original steps list.

@vdemeester
Copy link
Member

/close

@tekton-robot
Copy link
Collaborator

@vdemeester: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given
Projects
None yet
Development

No branches or pull requests

6 participants