-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
generate build state events #13660
generate build state events #13660
Conversation
[test] |
7cc6f3f
to
9983952
Compare
@jwforres fyi, these are the new build events we're going to be adding. |
[testextended][extended:core(builds)] |
[test]
…On Fri, Apr 7, 2017 at 3:53 PM, OpenShift Bot ***@***.***> wrote:
continuous-integration/openshift-jenkins/test FAILURE (
https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/645/)
(Base Commit: b4b7083
<b4b7083>
)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13660 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEvl3iKXQ6oIApZL1zra9BVBdMMv-kv4ks5rtpRJgaJpZM4M2Atp>
.
--
Ben Parees | OpenShift
|
pkg/build/api/types.go
Outdated
@@ -63,6 +63,31 @@ const ( | |||
// forces the build to be processed by the build controller queue without waiting | |||
// for a resync. | |||
BuildAcceptedAnnotation = "build.openshift.io/accepted" | |||
|
|||
// BuildCreatedEvent is the reason associated with the event registered when a build is created. | |||
BuildCreatedEventReason = "BuildCreated" |
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.
There's a lot of duplication here. Why do I care about created and started and running? I'd prefer just one, probably started.
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.
we don't have to display them all in the console by default, but is that a good reason not to create them?
I viewed all 3 as interesting primarily in an unhealthy system.
Created - a build was kicked off for some reason (manual, image trigger, git push, etc) - i think i want to know this.
Started - The system is attempting to start working on my build.. particularly relevant if you are doing serial builds, there could be a long time between creating a build and starting it.
Running - In an overscheduled system, there could be a long time between starting a build(pod is created) and the pod getting scheduled. I like to know when my build is actually running, not when it was eligible to run.
I can maybe see the argument for leaving out "Running" because in a healthy system started and running will happen very close together, but i definitely thing created and started are distinct and important due to the serial build policy.
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.
They're interesting in an unhealthy system and completely useless / waste space / clog up event views in a normal system. If the goal is to debug unhealthy, dispatch events for specific unhealthy. I don't think the serial build thing is a good reason, especially if you have conditions on builds that convey that info, because that's the system working as designed.
We already have an event for created which is the watch. We don't fire events when anything else is created, so no reason to start here. We have a long term strategy for user creation stuff which is roughly analogous to an event log for object changes (not just events), and that would subsume this anyway.
In short - I'm really against sending events just because we can. We should send events that materially improve users understanding of the system. I'd rather have 2 events that tell people something really important vs 10 that convey the same total amount of info. Every event is a write to etcd - that cost has to be worth it.
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.
I'd like @jwforres to weigh in, the only reason we're even creating these events is because the web console wanted to be able to convey this information to the user.
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.
All of these are reconstructable from the new status input - what am I missing?
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.
not sure what the "new status input" is, but the idea was for these to feed toaster notifications, i believe.
pkg/build/api/types.go
Outdated
// BuildFailedEvent is the message associated with the event registered when build fails. | ||
BuildFailedEventMessage = "Build %s/%s failed" | ||
// BuildCancelledEvent is the reason associated with the event registered when build is cancelled. | ||
BuildCancelledEventReason = "BuildCancelled" |
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.
I'd be ok with terminal state build events, in that they are useful for bringing together reason and status together. I'm not really happy with more than a single initial state. I'd encourage brainstorming whether there are events that aren't lifecycle but that actually help resolve questions users have about the system.
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.
I'm not going to cry about making this simpler, but I do worry that if we provide one kind of event, people are just going to ask why we don't provide the other kind... ie if we provide build created events, people will say they actually just want to know when the build started, and vice versa.
so again, let's see what @jwforres wants to display in the webconsole and go from there.
1254da7
to
63a3183
Compare
we definitely want success/cancelled/failed as far as created vs started, we do have a use for both, but if i have to choose one, then I want started. Ideally we were only going to have events feeding our toast notifications and notification drawer, so after someone creates a build we were hoping to just get the event back immediately for creation, and then to @bparees 's point the start may not happen till much later. That said, if we need to then we can send the toast notification to our drawer ourselves when you launch a build and not require an event for it, but knowing when the build actually started definitely needs an event. |
@jwforres @smarterclayton ok. Do we want the "build started" event to be created when the pod is created (meaning the build has reached the top of the queue for serial builds), or when the pod starts running (meaning the pod was scheduled to a node)? |
at what point do you generate startTimestamp? thats what i would want
…On Mon, Apr 10, 2017 at 10:46 AM, Ben Parees ***@***.***> wrote:
@jwforres <https://github.com/jwforres> @smarterclayton
<https://github.com/smarterclayton> ok. Do we want the "build started"
event to be created when the pod is created (meaning the build has reached
the top of the queue for serial builds), or when the pod starts running
(meaning the pod was scheduled to a node)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13660 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7cAdXakidHrPzeBt8G3MJ5tEkWxgks5rukDagaJpZM4M2Atp>
.
|
we set the startimestamp when the pod starts running. So what is currently in the code as the "build running" event would become the build started event (and the existing build created and build started events currently in this PR will go away) |
da6d87c
to
3ce38a3
Compare
@smarterclayton @jwforres ok i've stripped this down to the started event (when the pod starts running) and the terminal state events. needs @openshift/api-review signoff. @openshift/devex ptal |
pkg/build/api/types.go
Outdated
@@ -63,6 +63,23 @@ const ( | |||
// forces the build to be processed by the build controller queue without waiting | |||
// for a resync. | |||
BuildAcceptedAnnotation = "build.openshift.io/accepted" | |||
|
|||
// BuildStartedEvent is the reason associated with the event registered when a build is started (pod is created). |
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.
Should be BuildStartedEventReason in comment (also should be fixed in the rest of the comments to match constant names)
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.
fixed
pkg/build/api/types.go
Outdated
// BuildStartedEvent is the reason associated with the event registered when a build is started (pod is created). | ||
BuildStartedEventReason = "BuildStarted" | ||
// BuildStartedEvent is the message associated with the event registered when a build is started (pod is created). | ||
BuildStartedEventMessage = "Pod has been created to run build %s/%s" |
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.
Could the event ever apply to a pipeline build? If so, maybe a more generic message would be better.
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.
will update
d1ec407
to
3f9c4b0
Compare
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.
API is acceptable.
test/extended/util/framework.go
Outdated
@@ -1400,3 +1400,20 @@ func CreateExecPodOnNode(client kcoreclient.CoreInterface, ns, nodeName, name st | |||
o.Expect(err).NotTo(o.HaveOccurred()) | |||
return created.Name | |||
} | |||
|
|||
func CheckForEvent(client kcoreclient.CoreInterface, build *buildapi.Build, reason, message string) { |
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.
Give this a name that indicates it's checking for build events, or move it to a build specific package.
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.
done (renamed)
lgtm |
Evaluated for origin testextended up to 1462117 |
Evaluated for origin test up to 1462117 |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended/148/) (Base Commit: 5e305ac) (Extended Tests: core(builds)) |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/683/) (Base Commit: 445ae00) |
[merge] |
flake #13712 |
dnf flake [merge] |
Evaluated for origin merge up to 1462117 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/320/) (Base Commit: 15941b9) (Image: devenv-rhel7_6134) |
No description provided.