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

generate build state events #13660

Merged
merged 1 commit into from
Apr 12, 2017
Merged

Conversation

bparees
Copy link
Contributor

@bparees bparees commented Apr 6, 2017

No description provided.

@bparees
Copy link
Contributor Author

bparees commented Apr 6, 2017

[test]

@bparees bparees force-pushed the build_events branch 2 times, most recently from 7cc6f3f to 9983952 Compare April 6, 2017 21:57
@bparees
Copy link
Contributor Author

bparees commented Apr 7, 2017

@bparees
Copy link
Contributor Author

bparees commented Apr 7, 2017

@jwforres fyi, these are the new build events we're going to be adding.
@openshift/api-review ptal at the events we're introducing.

@bparees
Copy link
Contributor Author

bparees commented Apr 7, 2017

[testextended][extended:core(builds)]

@bparees
Copy link
Contributor Author

bparees commented Apr 7, 2017 via email

@@ -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"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

// 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"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@bparees bparees force-pushed the build_events branch 4 times, most recently from 1254da7 to 63a3183 Compare April 10, 2017 02:08
@jwforres
Copy link
Member

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.

@bparees
Copy link
Contributor Author

bparees commented Apr 10, 2017

@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)?

@jwforres
Copy link
Member

jwforres commented Apr 10, 2017 via email

@bparees
Copy link
Contributor Author

bparees commented Apr 10, 2017

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)

@bparees bparees force-pushed the build_events branch 3 times, most recently from da6d87c to 3ce38a3 Compare April 10, 2017 19:29
@bparees
Copy link
Contributor Author

bparees commented Apr 10, 2017

@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

@@ -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).
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

// 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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update

@bparees bparees force-pushed the build_events branch 2 times, most recently from d1ec407 to 3f9c4b0 Compare April 10, 2017 19:48
Copy link
Contributor

@smarterclayton smarterclayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API is acceptable.

@@ -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) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (renamed)

@csrwng
Copy link
Contributor

csrwng commented Apr 10, 2017

lgtm

@bparees bparees changed the title [DO_NOT_MERGE] generate build state events generate build state events Apr 10, 2017
@openshift-bot
Copy link
Contributor

Evaluated for origin testextended up to 1462117

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 1462117

@openshift-bot
Copy link
Contributor

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))

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/683/) (Base Commit: 445ae00)

@bparees
Copy link
Contributor Author

bparees commented Apr 11, 2017

[merge]

@bparees
Copy link
Contributor Author

bparees commented Apr 11, 2017

flake #13712
[merge]

@bparees
Copy link
Contributor Author

bparees commented Apr 11, 2017

dnf flake [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 1462117

@openshift-bot
Copy link
Contributor

openshift-bot commented Apr 11, 2017

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)

@openshift-bot openshift-bot merged commit b01ec19 into openshift:master Apr 12, 2017
@bparees bparees deleted the build_events branch April 17, 2017 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants