Opened 6 years ago

Last modified 4 years ago

#2219 new enhancement

Support reconfig-by-restart

Reported by: tom.prince Owned by: config
Priority: major Milestone: 0.9.+
Version: 0.8.5 Keywords:
Cc:

Description (last modified by dustin)

Best practices for buildbot configuration are to have modular config of some sort. Don't ship with an example that doesn't follow best practices.

<@exarkun> (Heck, the sample deployment _starts_ as a mess; to avoid a mess, you'd have to clean it up the config distributed with buildbot)

Change History (6)

comment:1 Changed 6 years ago by dustin

Modular configs lead to difficulty with reloading, so they're not for the faint of heart. I'm not sure that the initial recommendation should look like that.

comment:2 Changed 6 years ago by tom.prince

That won't be an issue, once we reconfig by graceful shutdown.

comment:3 Changed 6 years ago by bdbaddog

I've got a pretty stable modular config which handles reconfig's well. The main trick was to get rid of :

from XYZ import a,b,c

Since those aren't re-evaluated on reconfig. However doing something like:

import XYZ
a=XYZ.a
b=XYZ.b
c=XYZ.c

Seems to handle reconfig well.

comment:4 Changed 5 years ago by ewong

I tried the following:

import buildbot.status
html=buildbot.status.html

I get the following error during checkconfig:

(sandbox)bash-4.1$ buildbot checkconfig master
error while parsing config file:
Traceback (most recent call last):
  File "/home/cc/projs/bb9/master/bin/buildbot", line 4, in <module>
    runner.run()
  File "/home/cc/projs/bb9/master/buildbot/scripts/runner.py", line 743, in run
    sys.exit(subcommandFunction(subconfig))
  File "/home/cc/projs/bb9/master/buildbot/scripts/checkconfig.py", line 50, in checkconfig
    return cl.load(quiet=quiet)
  File "/home/cc/projs/bb9/master/buildbot/scripts/checkconfig.py", line 29, in load
    self.basedir, self.configFileName)
--- <exception caught here> ---
  File "/home/cc/projs/bb9/master/buildbot/config.py", line 156, in loadConfig
    exec f in localDict
  File "/home/cc/projs/playground/c-c/master/master.cfg", line 116, in <module>
    html=buildbot.status.html
exceptions.AttributeError: 'module' object has no attribute 'html'
Configuration Errors:
  error while parsing config file: 'module' object has no attribute 'html' (traceback in logfile)

comment:5 Changed 5 years ago by dustin

  • Description modified (diff)

Right, that won't work - Python doesn't automatically import all sub-modules of a package. I'm not sure what prompted you to try that?

comment:6 Changed 4 years ago by dustin

  • Milestone changed from 0.9.0 to 0.9.+
  • Summary changed from Make sample configuration modular. to Support reconfig-by-restart

I'm re-purposing this bug to be about reconfig by starting a new master and cleanly stopping the running master. This is a plan for nine or one-oh, when multi-master is fully and automatically supported. Even then, it will only work if you're not using sqlite.

Note: See TracTickets for help on using tickets.