openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

Make use of resource watch instead of Thread.sleep #113

Closed jcantrill closed 5 years ago

jcantrill commented 7 years ago

This PR removes the use of Thread.sleep in a few places in lieu of watchers that do OpenShift watches

cc @gabemontero any chance you can help me verify the changes work. I was able to get logs but my origin code is unable to see github.com in order to confirm its actually able to properly monitor a build.

gabemontero commented 7 years ago

yep taking a look / can do some testing @jcantrill - as we discussed in IRC, will probably merge / cut a new release after 3.4 code freeze

gabemontero commented 7 years ago

@jupierce FYI some suggestions from @jcantrill

gabemontero commented 7 years ago

@jcantrill the change has an couple of initial functional issues: 1) it always dumps the build log, even if the build step has disabled that 2) there is a lot of duplication of log output ... given lines being printed multiple times ... both @jupierce and myself have had to do some work to avoid this from occurring

If you want to debug those issues, great. If not, we can certainly use this PR as a starting point to leveraging watches in upcoming versions of the plugin

just let us know ... and thanks a bunch for putting this together

jcantrill commented 7 years ago

I am willing to debug... i wonder if this is because of the code that calls 'waitFor' which is in a loop. I started modifying that but stopped. Can you point me how you tested? Create a BC and then just trigger a build from jenkins? Monitor log output, etc?

gabemontero commented 7 years ago

On Fri, Nov 11, 2016 at 4:47 PM, Jeff Cantrill notifications@github.com wrote:

I am willing to debug... i wonder if this is because of the code that calls 'waitFor' which is in a loop.

Perhaps ... haven't studied it in an detail yet.

I started modifying that but stopped. Can you point me how you tested? Create a BC and then just trigger a build from jenkins? Monitor log output, etc?

With a fresh cloning of https://github.com/openshift/origin, then running hack/build-base-images.sh followed by make release 1) oc cluster up 2) oc new-app jenkins-ephemeral 3) cd into the origin directory from your git clone 4) oc new-app examples/jenkins/application-template.json 5) log into openshift webconsole 6) from the overview page, click on the route for jenkins, and log in with "developer" 7) Manage Jenkins -> Manage Plugins -> Advanced tab -> upload from file, giving it your hpi file 8) click restart checkbox, to to top level page link 9) after jenkins restarts, log back int 10) click link for new job, type any name, select freestyle job 11) click link for new job, click link for configure 12) select the "trigger openshift build" build step 13) you can leave all the params as default except for the build config name ... type in "frontend".... toggle the "Pipe the build logs from OpenShift to the Jenkins console" as needed for testing 14) save job 15) run job

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openshift/jenkins-plugin/pull/113#issuecomment-260063078, or mute the thread https://github.com/notifications/unsubscribe-auth/ADbadCG4nlEloBBAq_HeYz2ihVzAb2azks5q9OJVgaJpZM4KwIuG .

openshift-bot commented 7 years ago

Jenkins Plugin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again