[Webkit-unassigned] [Bug 89391] Would like a way to force a clean build

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 16 10:24:28 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89391


Josh Hawn <jhawn at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhawn at apple.com




--- Comment #6 from Josh Hawn <jhawn at apple.com>  2012-07-16 10:24:22 PST ---
I've come up with a working solution for this, though it required a change to my buildbot installation.

A "Clean Build" button was be added to the builders/$buildername page, with one button adjacent to all of the listed buildslaves.
This button acts much like the "Force Build" button, except that it schedules a build only on the slave that was specified, rather than any available slave for this builder.

I've created a new type of scheduler called a CleanScheduler, and (like ForceScheduler) the button is only available for builders that are given to this scheduler.

Because the new build request is for a specific slave, I needed to add a new attribute to build requests currently called clean_slavename. It is None by default, but is set to the name of the slave that is to be cleaned when the build request is caused by pressing the "Clean Build" button.
I added a new file to db migrations to add this column to the buildrequests table.

These build requests are given highest priority and are guaranteed to run only on the slave that was specified.

Because the clean steps are different than the normal build steps, the builder must be given a separate "clean_factory" object which will send the steps to the remote slave to clean the build directory for that builder.

Here's an excerpt from an example config file:

...
# create a Clean Scheduler with a list of builders that may need cleaning.
c['schedulers'].append(CleanScheduler(name="clean", builderNames=["builder1"]))

...
# make the usual build factory, and a clean factory with the steps for performing a clean.
factory = BuildFactory()
factory.addStep(ShellCommand(command=["make", "debug"]))

clean_factory = BuildFactory()
clean_factory.addStep(ShellCommand(command=["make", "clean"]))

...
# add builders, making sure that the builders listed in the clean scheduler have a 'clean_factory' specified.
# notice how "builder1" has a clean factory because it was listed in the clean scheduler, but "builder2" does not.
c['builders'].append(
    BuilderConfig(name="builder1",
      slavenames=["slave1", "slave2", "slave3", "slave4"],
      factory=factory,
      clean_factory=clean_factory))
c['builders'].append(
    BuilderConfig(name="builder2",
      slavenames=["slave3", "slave4", "slave5"],
      factory=factory))

...
# make sure that only authorized users can use the new button, notice the new 'cleanBuild' keyword argument
authz_cfg=authz.Authz(
    # change any of these to True to enable; see the manual for more
    # options
    auth=auth.BasicAuth([("username", "password")]),
    gracefulShutdown = False,
    forceBuild = 'auth',
    cleanBuild = 'auth', # the 'clean' button should appear on the builders page
    forceAllBuilds = False,
    pingBuilder = False,
    stopBuild = False,
    stopAllBuilds = False,
    cancelPendingBuild = False,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

I'll attach a diff off all of the changes I made to buildbot as well. I know it's probably not the best design yet, so let me know what you think.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list