Skip to content

Builds should say what time they completed #332

Closed

Description

@jwforres

Need to add something like completionTimestamp to builds at that point when the build's status is marked as complete.

Activity

  1. ironcladlou commented on Nov 4, 2014

    @ironcladlou
    Contributor

    This would be good to add after #335

  2. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    @jwforres @pmorie @bparees Did we ever decide what form this would take? Annotations, or a field on Build?

    Also, who else is interested in this discussion?

  3. bparees commented on Dec 4, 2014

    @bparees
    Contributor

    i don't know if we decided, but i'd vote for a field on build. it's pretty universal information so i think it should be a first class field.

  4. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    i don't know if we decided, but i'd vote for a field on build. it's pretty universal information so i think it should be a first class field.

    I'm fine with a field as well. Should the time be set to the value of ContainerStateTerminated.FinishedAt? AFAIK, that would be the most accurate timestamp we have access to in this context.

  5. bparees commented on Dec 4, 2014

    @bparees
    Contributor

    Should probably have started+finished times?

    also we should include @csrwng and @soltysh in the discussion.

  6. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    Should probably have started+finished times?

    Good catch, I didn't realize before that we had access to the container start time. In the IRC discussions with @smarterclayton we decided trying to guess at the start time was too hazy to be useful. If we get it for free from ContainerStateTerminated, why not capture it?

  7. mfojtik commented on Dec 4, 2014

    @mfojtik
    Contributor

    isn't started same as created?
    On Dec 4, 2014 5:44 PM, "Dan Mace" [email protected] wrote:

    Should probably have started+finished times?

    Good catch, I didn't realize before that we had access to the container
    start time. In the IRC discussions with @smarterclayton
    https://github.com/smarterclayton we decided trying to guess at the
    start time was too hazy to be useful. If we get it for free from
    ContainerStateTerminated, why not capture it?

    —
    Reply to this email directly or view it on GitHub
    #332 (comment).

  8. mfojtik commented on Dec 4, 2014

    @mfojtik
    Contributor

    @bparees also isn't better to use Event for this kind of information? How about when the Build gets canceled? Should the finishTime be updated (the build wasn't finished properly...)

  9. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    @mfojtik

    isn't started same as created?

    It's the container start time according to the docker client library.

  10. bparees commented on Dec 4, 2014

    @bparees
    Contributor

    @mfojtik finishTime should be updated either way. the state of the build should indicate if it was canceled vs finished normally vs failed.

    as for using Event... i'm not familiar enough w/ the event infrastructure. It seems likely we'd want to emit events when these things happen, so if we also want to use that event to trigger updating the build info, that seems reasonable.

  11. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    Events would make sense as a separate feature to allow external infra to react, but I don't see how it relates to persisting the timings. We need to persist the timings for build history/reporting.

  12. bparees commented on Dec 4, 2014

    @bparees
    Contributor

    Again, I need to study the event infrastructure, but in theory the persisting of the timings (adding them to the build object) could be triggered by an event that is emitted when the build starts/finishes, right? (and extra infra could also listen for those events).

  13. ironcladlou commented on Dec 4, 2014

    @ironcladlou
    Contributor

    Events have no delivery guarantees, AFAIK, and shouldn't be used for controller plumbing. The time we transition the build states (in response to watch events, which is the stable internal eventing system) seems like the right time to persist the information related to that transition. We can wait for @smarterclayton to chime in...

  14. smarterclayton commented on Dec 4, 2014

    @smarterclayton
    Contributor

    Events are exceptional messages that allow other components to become aware of significant execution. Container exit time and status code are already events but there is no guarantee an event ever gets fired. You should use both events and pod state watching and polling to know those things.

    On Dec 4, 2014, at 10:08 AM, Dan Mace [email protected] wrote:

    Events have no delivery guarantees, AFAIK, and shouldn't be used for controller plumbing. The time we transition the build states (in response to watch events, which is the stable internal eventing system) seems like the right time to persist the information related to that transition. We can wait for @smarterclayton to chime in...

    —
    Reply to this email directly or view it on GitHub.

  15. smarterclayton commented on Dec 4, 2014

    @smarterclayton
    Contributor

    That's not guaranteed to be the first start time. Containers may get run multiple times without you knowing what the first time was. The create date of the build is the best and most reliable indicator. It's ok to use container start time as a slightly untrustworthy value.

    On Dec 4, 2014, at 9:03 AM, Dan Mace [email protected] wrote:

    @mfojtik

    isn't started same as created?

    It's the container start time according to the docker client library.

    —
    Reply to this email directly or view it on GitHub.

  16. soltysh commented on Dec 5, 2014

    @soltysh
    Contributor

    I agree with @ironcladlou I don't see any sense in using Events for that, since that's responsibility of build controller IMHO, eventually the controller can reach that info from pod controller, but it's still build controller responsibility. And yes, having both (start+finish) makes sense, for example to know what is the expected time of build, more or less at least.

  17. bparees commented on Dec 5, 2014

    @bparees
    Contributor

    if events are not a guaranteed delivery mechanism then i agree we shouldn't use them for this. but if they were, I would still argue we should be consuming them for this sort of flow rather than doing one-off operations.

  18. ironcladlou commented on Dec 5, 2014

    @ironcladlou
    Contributor

    if events are not a guaranteed delivery mechanism then i agree we shouldn't use them for this. but if they were, I would still argue we should be consuming them for this sort of flow rather than doing one-off operations.

    Correct me if I'm misinterpreting, but there is no externally facing flow control or behavior happening related to start/end transitions. We just update state for informational purposes. This is just capturing stats during a build/pod state transition that's already being handled appropriately (using watches).

    Event (i.e. k8s "Event" struct) emission/consumption by related (i.e. non-build-controller) subsystems is orthogonal: we should probably have a separate issue describing what events the build system should be emitting as defined by the requirements of these related subsystems which would act upon them. I'm not aware of any existing related subsystem which is being retrofitted to consume build events yet.

  19. ironcladlou commented on Dec 5, 2014

    @ironcladlou
    Contributor

    What I've taken away from this so far given the thought from @smarterclayton re: container start time volatility is that we should capture the terminated time as a field on Build, and let consumers use the Build.CreationTimestamp field for the start time.

  20. smarterclayton commented on Dec 5, 2014

    @smarterclayton
    Contributor

    Nothing is guaranteed, and we're building a system that has to take that into account by building multiple systems that work together to achieve that.

    So, an event is valid information, but as you guys note you cannot rely on it. That doesn't mean it's information is invalid. It just means like any distributed system you have to have a sync loop that corrects for gaps. Events supplement information we have, but an individual event cannot be a critical (non-redundant) part of any flow.

    On Dec 5, 2014, at 5:45 AM, Ben Parees [email protected] wrote:

    if events are not a guaranteed delivery mechanism then i agree we shouldn't use them for this. but if they were, I would still argue we should be consuming them for this sort of flow rather than doing one-off operations.

    —
    Reply to this email directly or view it on GitHub.

  21. jwforres commented on Dec 8, 2014

    @jwforres
    MemberAuthor

    @ironcladlou @smarterclayton if we are using Build.CreationTimestamp for the build's start time, and there is a delay in the build pod getting scheduled, then your "build time" isn't really going to reflect how long the build took, it is instead how long it took from when you asked for the build to when it completed. They are both interesting numbers, but knowing how long the build actually took seems more important to me for comparison purposes.

  22. ironcladlou commented on Dec 8, 2014

    @ironcladlou
    Contributor

    @jwforres

    @ironcladlou @smarterclayton if we are using Build.CreationTimestamp for the build's start time, and there is a delay in the build pod getting scheduled, then your "build time" isn't really going to reflect how long the build took, it is instead how long it took from when you asked for the build to when it completed. They are both interesting numbers, but knowing how long the build actually took seems more important to me for comparison purposes.

    Not trying to be pedantic, just want to clarify concepts to make sure we're talking about the same thing... only the actual build process (like a maven process or the script bootstrapping a build) can know what the actual build time is. From there, we get into fuzzier territory for which I don't think we have any established terms: the total time spent in the container hosting the actual build process, the total time between pod schedule and pod termination, the total time spent between Build creation and Pod termination, etc, etc. Which timing do we actually need to persist?

  23. bparees commented on Dec 9, 2014

    @bparees
    Contributor

    pod creation to pod termination is probably closest to what a user might expect while not making the build process itself responsible for recording times.

  24. smarterclayton commented on Dec 9, 2014

    @smarterclayton
    Contributor

    Eventually we want to gather this info. Can we live without it for now? Sure.

    ----- Original Message -----

    pod creation to pod termination is probably closest to what a user might
    expect while not making the build process itself responsible for recording
    times.


    Reply to this email directly or view it on GitHub:
    #332 (comment)

  25. soltysh commented on Mar 30, 2015

    @soltysh
    Contributor

    This should be fixed by now, can we close this @jwforres @bparees ?

  26. added a commit that references this issue on Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions