Browse Source

Use scheduler-specific log config and pidfile

This makes the scheduler configuration style match the rest of
the components.

Change-Id: I87fc2d1f7138ead83142f4634f6a74663fb1a82a
changes/90/477590/8
James E. Blair 4 years ago
parent
commit
d1de946403
  1. 1
      doc/source/admin/components.rst
  2. 2
      tests/base.py
  3. 6
      zuul/cmd/scheduler.py
  4. 6
      zuul/scheduler.py

1
doc/source/admin/components.rst

@ -125,7 +125,6 @@ webapp
scheduler
"""""""""
.. TODO: rename this to 'scheduler' (currently 'zuul') and update to match these docs
**tenant_config**
Path to tenant config file.

2
tests/base.py

@ -1870,7 +1870,7 @@ class ZuulTestCase(BaseTestCase):
os.path.join(
FIXTURE_DIR,
self.config.get('scheduler', 'tenant_config')))
self.config.set('zuul', 'state_dir', self.state_root)
self.config.set('scheduler', 'state_dir', self.state_root)
self.config.set('merger', 'git_dir', self.merger_src_root)
self.config.set('merger', 'state_dir', self.merger_state_root)
self.config.set('executor', 'git_dir', self.executor_src_root)

6
zuul/cmd/scheduler.py

@ -59,7 +59,7 @@ class Scheduler(zuul.cmd.ZuulApp):
signal.signal(signal.SIGHUP, signal.SIG_IGN)
self.log.debug("Reconfiguration triggered")
self.read_config()
self.setup_logging('zuul', 'log_config')
self.setup_logging('scheduler', 'log_config')
try:
self.sched.reconfigure(self.config)
except Exception:
@ -140,7 +140,7 @@ class Scheduler(zuul.cmd.ZuulApp):
self.config.getboolean('gearman_server', 'start')):
self.start_gear_server()
self.setup_logging('zuul', 'log_config')
self.setup_logging('scheduler', 'log_config')
self.log = logging.getLogger("zuul.Scheduler")
self.sched = zuul.scheduler.Scheduler(self.config)
@ -207,7 +207,7 @@ def main():
if scheduler.args.validate:
sys.exit(scheduler.test_config())
pid_fn = get_default(scheduler.config, 'zuul', 'pidfile',
pid_fn = get_default(scheduler.config, 'scheduler', 'pidfile',
'/var/run/zuul-scheduler/zuul-scheduler.pid',
expand_user=True)
pid = pid_file_module.TimeoutPIDLockFile(pid_fn, 10)

6
zuul/scheduler.py

@ -372,12 +372,12 @@ class Scheduler(threading.Thread):
self.log.debug("Waiting for exit")
def _get_queue_pickle_file(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
return os.path.join(state_dir, 'queue.pickle')
def _get_time_database_dir(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
d = os.path.join(state_dir, 'times')
if not os.path.exists(d):
@ -385,7 +385,7 @@ class Scheduler(threading.Thread):
return d
def _get_project_key_dir(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
key_dir = os.path.join(state_dir, 'keys')
if not os.path.exists(key_dir):

Loading…
Cancel
Save