← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/explicit-beat-schedule into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/explicit-beat-schedule into lp:maas.

Commit message:
Explicitly have the cluster worker use the file /var/lib/maas/celerybeat-cluster-schedule to store its celerybeat schedule.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/explicit-beat-schedule/+merge/127775

Explicitly have the cluster worker use the file /var/lib/maas/celerybeat-cluster-schedule to store its celerybeat schedule.

= Notes =

On a dev instance, the cluster controller will use run/celerybeat-cluster-schedule and the region worker will use run/celerybeat-region-schedule.
-- 
https://code.launchpad.net/~rvb/maas/explicit-beat-schedule/+merge/127775
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/explicit-beat-schedule into lp:maas.
=== modified file 'etc/celeryconfig_common.py'
--- etc/celeryconfig_common.py	2012-09-28 15:31:48 +0000
+++ etc/celeryconfig_common.py	2012-10-03 14:22:19 +0000
@@ -42,6 +42,8 @@
 # Location for log file.
 MAAS_CELERY_LOG = '/var/log/maas/celery.log'
 
+# Location for the cluster worker schedule file.
+MAAS_CLUSTER_CELERY_DB = '/var/lib/maas/celerybeat-cluster-schedule'
 
 WORKER_QUEUE_DNS = 'celery'
 WORKER_QUEUE_BOOT_IMAGES = 'celery'

=== modified file 'etc/democeleryconfig.py'
--- etc/democeleryconfig.py	2012-09-28 15:04:45 +0000
+++ etc/democeleryconfig.py	2012-10-03 14:22:19 +0000
@@ -28,4 +28,3 @@
 
 MAAS_CELERY_LOG = os.path.join(
     DEV_ROOT_DIRECTORY, 'logs/region-worker/current')
-

=== modified file 'etc/democeleryconfig_cluster.py'
--- etc/democeleryconfig_cluster.py	2012-09-28 15:04:45 +0000
+++ etc/democeleryconfig_cluster.py	2012-10-03 14:22:19 +0000
@@ -33,3 +33,5 @@
 MAAS_CELERY_LOG = os.path.join(
     DEV_ROOT_DIRECTORY, 'logs/cluster-worker/current')
 
+MAAS_CLUSTER_CELERY_DB = os.path.join(
+    DEV_ROOT_DIRECTORY, 'run/celerybeat-cluster-schedule')

=== modified file 'services/region-worker/run'
--- services/region-worker/run	2012-09-27 22:11:29 +0000
+++ services/region-worker/run	2012-10-03 14:22:19 +0000
@@ -19,4 +19,5 @@
 script="$(readlink -f bin/celeryd)"
 exec fghack "${script}" \
     --loglevel INFO --beat --queues celery,master \
+    --schedule=run/celerybeat-region-schedule
     --config democeleryconfig

=== modified file 'src/provisioningserver/start_cluster_controller.py'
--- src/provisioningserver/start_cluster_controller.py	2012-10-03 13:41:23 +0000
+++ src/provisioningserver/start_cluster_controller.py	2012-10-03 14:22:19 +0000
@@ -72,6 +72,11 @@
     return app_or_default().conf.MAAS_CELERY_LOG
 
 
+def get_maas_celerybeat_db():
+    """Read location for MAAS Celery schedule file from the config."""
+    return app_or_default().conf.MAAS_CLUSTER_CELERY_DB
+
+
 def register(server_url):
     """Request Rabbit connection details from the domain controller.
 
@@ -132,6 +137,7 @@
     command = [
         'celeryd',
         '--logfile=%s' % get_maas_celery_log(),
+        '--schedule=%s' % get_maas_celerybeat_db(),
         '--loglevel=INFO',
         '--beat',
         '-Q', get_cluster_uuid(),


Follow ups