Skip to content

throttle jenkins status to openshift build updates #157

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

Merged
merged 1 commit into from
Jul 31, 2017

Conversation

gabemontero
Copy link

bug 1475867
https://bugzilla.redhat.com/show_bug.cgi?id=1475867

@openshift/devex @spadgett FYI

adds both time and state based throttling; all of whose details are certainly negotiable

in my testing, the openshift web console still seems to render stages OK, but certainly it is "choppier" than before

there's comments explaining the various conditions, but I'll summarize here:

  1. no poll jenkins job run status every 10 seconds (vs. 1 second) in addition to listening to jenkins events
  2. will update the build if
    a) an update has not been made in 30 seconds
    b) the number of stages or flow nodes changes
    c) the job run reaches a terminal state

@gabemontero
Copy link
Author

[test]

@spadgett
Copy link
Member

@gabemontero If you have it running, I'd like to take a look.

@gabemontero
Copy link
Author

gabemontero commented Jul 28, 2017

sync-plugin.zip

@spadgett per IRC, here is the plugin change ^^

unzip and then install the hpi file in a running jenkins instance

@bparees
Copy link

bparees commented Jul 28, 2017

so if there's a stage that takes, say, 5 minutes to run, you're going to get 30s updates? It would definitely be good for the webconsole to move to calculating the duration itself in that case. (Are we already providing the information the webconsole would need to do that? starttime+completiontime for a stage?)

@gabemontero
Copy link
Author

gabemontero commented Jul 28, 2017 via email

@bparees
Copy link

bparees commented Jul 28, 2017

The json (provided by jenkins, but tweaked by the plugin to prepend the jenkins root url to any links) annotated to the build includes start time and durations for a) when actually running b) for when it sits in the jenkins queue, c) if the run is paused from the jenkins console

but not completion times?

@gabemontero
Copy link
Author

gabemontero commented Jul 28, 2017 via email

@spadgett
Copy link
Member

@bparees I'm more concerned about the running stage. If there is clock skew between the client and server, we can't accurately calculate duration from just a start time.

@spadgett
Copy link
Member

@gabemontero
Copy link
Author

gabemontero commented Jul 28, 2017 via email

@spadgett
Copy link
Member

I'm more worried about the client clock -- the user's computer running the browser -- since it can be wayyyy off. But it might be the best we can do.

@bparees
Copy link

bparees commented Jul 28, 2017

The end time of the job can be calculated by adding the 3 durations types from the job/stage/flownode levels to the start times of each.

only if we continue to provide the duration. if we wanted to get out of the business of frequently updating the metadata purely for the sake of updating the duration, that would depend on the termination time being available to the web console. @spadgett's clock skew concerns notwithstanding.

@gabemontero
Copy link
Author

gabemontero commented Jul 28, 2017 via email

@bparees
Copy link

bparees commented Jul 28, 2017

I'm inclined to have this PR center on the shorter term flavor of change. Thoughts?

agree, definitely did not mean to distract. I think what's here is good for the short term changes, though i'm a little concerned about the "5 minute long stage will only see duration updates every 30s" case, but i leave that mostly up to @spadgett

@gabemontero
Copy link
Author

OK good thanks.

So I think that leaves us at deciding when to merge this ... factors:

  1. question to @spadgett and @rhamilto - are you guys fine with us merging now, where you folks make any adjustments needed via Update pipeline visualization for sync plugin changes origin-web-console#1891
  2. if not, do you guys have an idea on when @rhamilto will be able to start on Update pipeline visualization for sync plugin changes origin-web-console#1891 and test with the patch I provided in throttle jenkins status to openshift build updates #157 (comment) ?
  3. if relatively soon (like sometime this week) I think I am OK on waiting to merge this
  4. if further out, I'm more inclined to merge this beforehand in order to have it ready in case the online env needs it, and then we make additional changes to tune / adjust as Update pipeline visualization for sync plugin changes origin-web-console#1891 gets going

thoughts everyone ?

thanks

@gabemontero gabemontero force-pushed the nicer-build-polling branch from bbe82ef to 53ce3f4 Compare July 31, 2017 18:28
@gabemontero
Copy link
Author

OK, based on a discussion with @spadgett following some initial testing from @rhamilto I've reverted the polling of Jenkins back to 1 second. This way, stage/flow node transitions should be reported quickly to the build object and console, but we still throttle updates to the build object wrt duration, etc. to 30 seconds when the stages / flow nodes stays the same.

Here is the updated patch
sync-plugin-2.zip

@openshift-bot
Copy link

Evaluated for jenkins sync plugin test up to 53ce3f4

@rhamilto
Copy link
Member

I've reverted the polling of Jenkins back to 1 second. This way, stage/flow node transitions should be reported quickly to the build object and console

Thanks, Gabe. That indeed fixes the issue with the stage transitions.

@gabemontero
Copy link
Author

gabemontero commented Jul 31, 2017 via email

@openshift-bot
Copy link

continuous-integration/openshift-jenkins-sync-plugin/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_jenkins_sync_plugin/4/) (Base Commit: 6ac83f7) (PR Branch Commit: 53ce3f4)

@gabemontero gabemontero merged commit f9f3603 into openshift:master Jul 31, 2017
@gabemontero gabemontero deleted the nicer-build-polling branch July 31, 2017 19:43
waveywaves pushed a commit to waveywaves/jenkins-sync-plugin that referenced this pull request Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants