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

Proposed by Raphaël Badin on 2012-10-03
Status: Merged
Approved by: Raphaël Badin on 2012-10-03
Approved revision: 1149
Merged at revision: 1153
Proposed branch: lp:~rvb/maas/explicit-beat-schedule
Merge into: lp:maas/trunk
Diff against target: 65 lines (+11/-1)
5 files modified
etc/celeryconfig_common.py (+2/-0)
etc/democeleryconfig.py (+0/-1)
etc/democeleryconfig_cluster.py (+2/-0)
services/region-worker/run (+1/-0)
src/provisioningserver/start_cluster_controller.py (+6/-0)
To merge this branch: bzr merge lp:~rvb/maas/explicit-beat-schedule
Reviewer Review Type Date Requested Status
Andres Rodriguez Approve on 2012-10-03
Launchpad code reviewers 2012-10-03 Pending
Review via email: mp+127775@code.launchpad.net

Commit Message

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

Description of the Change

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.

To post a comment you must log in.
Andres Rodriguez (andreserl) wrote :

Looks good to me!

review: Approve
Julian Edwards (julian-edwards) wrote :

1 === modified file 'etc/celeryconfig_common.py'
2 --- etc/celeryconfig_common.py 2012-09-28 15:31:48 +0000
3 +++ etc/celeryconfig_common.py 2012-10-03 14:22:19 +0000
4 @@ -42,6 +42,8 @@
5 # Location for log file.
6 MAAS_CELERY_LOG = '/var/log/maas/celery.log'
7
8 +# Location for the cluster worker schedule file.
9 +MAAS_CLUSTER_CELERY_DB = '/var/lib/maas/celerybeat-cluster-schedule'

If it's in the 'common' config, won't this affect the region's celeryd?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/celeryconfig_common.py'
2--- etc/celeryconfig_common.py 2012-09-28 15:31:48 +0000
3+++ etc/celeryconfig_common.py 2012-10-03 14:22:19 +0000
4@@ -42,6 +42,8 @@
5 # Location for log file.
6 MAAS_CELERY_LOG = '/var/log/maas/celery.log'
7
8+# Location for the cluster worker schedule file.
9+MAAS_CLUSTER_CELERY_DB = '/var/lib/maas/celerybeat-cluster-schedule'
10
11 WORKER_QUEUE_DNS = 'celery'
12 WORKER_QUEUE_BOOT_IMAGES = 'celery'
13
14=== modified file 'etc/democeleryconfig.py'
15--- etc/democeleryconfig.py 2012-09-28 15:04:45 +0000
16+++ etc/democeleryconfig.py 2012-10-03 14:22:19 +0000
17@@ -28,4 +28,3 @@
18
19 MAAS_CELERY_LOG = os.path.join(
20 DEV_ROOT_DIRECTORY, 'logs/region-worker/current')
21-
22
23=== modified file 'etc/democeleryconfig_cluster.py'
24--- etc/democeleryconfig_cluster.py 2012-09-28 15:04:45 +0000
25+++ etc/democeleryconfig_cluster.py 2012-10-03 14:22:19 +0000
26@@ -33,3 +33,5 @@
27 MAAS_CELERY_LOG = os.path.join(
28 DEV_ROOT_DIRECTORY, 'logs/cluster-worker/current')
29
30+MAAS_CLUSTER_CELERY_DB = os.path.join(
31+ DEV_ROOT_DIRECTORY, 'run/celerybeat-cluster-schedule')
32
33=== modified file 'services/region-worker/run'
34--- services/region-worker/run 2012-09-27 22:11:29 +0000
35+++ services/region-worker/run 2012-10-03 14:22:19 +0000
36@@ -19,4 +19,5 @@
37 script="$(readlink -f bin/celeryd)"
38 exec fghack "${script}" \
39 --loglevel INFO --beat --queues celery,master \
40+ --schedule=run/celerybeat-region-schedule
41 --config democeleryconfig
42
43=== modified file 'src/provisioningserver/start_cluster_controller.py'
44--- src/provisioningserver/start_cluster_controller.py 2012-10-03 13:41:23 +0000
45+++ src/provisioningserver/start_cluster_controller.py 2012-10-03 14:22:19 +0000
46@@ -72,6 +72,11 @@
47 return app_or_default().conf.MAAS_CELERY_LOG
48
49
50+def get_maas_celerybeat_db():
51+ """Read location for MAAS Celery schedule file from the config."""
52+ return app_or_default().conf.MAAS_CLUSTER_CELERY_DB
53+
54+
55 def register(server_url):
56 """Request Rabbit connection details from the domain controller.
57
58@@ -132,6 +137,7 @@
59 command = [
60 'celeryd',
61 '--logfile=%s' % get_maas_celery_log(),
62+ '--schedule=%s' % get_maas_celerybeat_db(),
63 '--loglevel=INFO',
64 '--beat',
65 '-Q', get_cluster_uuid(),