You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
@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...)
@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.
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.
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).
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...
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.
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.
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.
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.
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.
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.
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.
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.
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.
@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.
@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?
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.
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)
Activity
ironcladlou commentedon Nov 4, 2014
This would be good to add after #335
ironcladlou commentedon Dec 4, 2014
@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?
ironcladlou commentedon Dec 4, 2014
Previous IRC discussion: https://botbot.me/freenode/openshift-dev/2014-11-05/?msg=24913376&page=7
bparees commentedon Dec 4, 2014
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.
ironcladlou commentedon Dec 4, 2014
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.bparees commentedon Dec 4, 2014
Should probably have started+finished times?
also we should include @csrwng and @soltysh in the discussion.
ironcladlou commentedon Dec 4, 2014
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?
mfojtik commentedon Dec 4, 2014
isn't started same as created?
On Dec 4, 2014 5:44 PM, "Dan Mace" [email protected] wrote:
mfojtik commentedon Dec 4, 2014
@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...)
ironcladlou commentedon Dec 4, 2014
@mfojtik
It's the container start time according to the docker client library.
bparees commentedon Dec 4, 2014
@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.
ironcladlou commentedon Dec 4, 2014
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.
bparees commentedon Dec 4, 2014
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).
ironcladlou commentedon Dec 4, 2014
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...
smarterclayton commentedon Dec 4, 2014
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.
smarterclayton commentedon Dec 4, 2014
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.
soltysh commentedon Dec 5, 2014
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.
bparees commentedon Dec 5, 2014
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.
ironcladlou commentedon Dec 5, 2014
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.
ironcladlou commentedon Dec 5, 2014
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.
smarterclayton commentedon Dec 5, 2014
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.
jwforres commentedon Dec 8, 2014
@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.
ironcladlou commentedon Dec 8, 2014
@jwforres
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?
bparees commentedon Dec 9, 2014
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.
smarterclayton commentedon Dec 9, 2014
Eventually we want to gather this info. Can we live without it for now? Sure.
----- Original Message -----
bparees commentedon Mar 10, 2015
https://trello.com/c/UPzNPdLM/521-timestamp-for-build-completion-time
soltysh commentedon Mar 30, 2015
This should be fixed by now, can we close this @jwforres @bparees ?
Merge pull request openshift#332 from ncdc/3.2/pick-9822