You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modified the section about the flower authentication, as the
auth.py module in tornado was deprecated and the example code app
had been adjusted.
Add some text to serve more informations about flower.
Copy file name to clipboardExpand all lines: Guides/Python/Celery.md
+31-29Lines changed: 31 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Deploying Celery on cloudControl
2
-
[Celery] is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.
2
+
[Celery] is an asynchronous task queue/job queue based on distributed message
3
+
passing. It is focused on real-time operation, but supports scheduling as well.
3
4
4
-
In this tutorial we're going to show you how to deploy an example Celery app using the [CloudAMQP Add-on] and a [Worker] on [cloudControl].
5
+
In this tutorial we're going to show you how to deploy an example Celery app
6
+
using the [CloudAMQP Add-on], a [Worker] and [Flower] on [cloudControl].
5
7
6
8
## The Example App Explained
7
-
First, lets clone the example code from Github. It is based on the official [first steps with Celery guide][celeryguide] and also includes [Flower] the Celery web interface.
9
+
First, lets clone the example code from Github. It is based on the official [first steps with Celery guide][celeryguide] and also includes [Flower] the Celery web interface for monitoring your application.
@@ -17,21 +19,26 @@ The code from the example repository is ready to be deployed. Lets still go thro
17
19
The [Python buildpack] tracks dependencies via pip and the `requirements.txt` file. It needs to be placed in the root directory of your repository. Our example app requires both `celery` itself aswell as `flower` Celery's monitoring web app. The `requirements.txt` you cloned as part of the example app looks like this:
18
20
19
21
~~~pip
20
-
celery==3.0.15
21
-
flower==0.4.2
22
+
celery==3.1.18
23
+
flower==0.8.3
22
24
~~~
23
25
24
26
### Process Type Definition
25
27
cloudControl uses a [Procfile] to know how to start the app's processes.
26
28
27
-
The example code also already includes a file called `Procfile` at the top level of your repository. It looks like this:
29
+
The example code also already includes a file called `Procfile` at the top level
We have specified two process types here. One called `web` to start the web interface and additionally one called `worker` used to start the actual Celery worker.
37
+
We have specified two process types here. One called `web` to start the web
38
+
interface and additionally one called `worker` used to start the actual Celery
39
+
worker.
40
+
41
+
*Note: Checkout the Flower docs for other [authentication methods](https://flower.readthedocs.org/en/latest/auth.html)*
Since we are reading the AMQP URL for the broker from the environment in both, the `Procfile` and the Python code we have to enable providing Add-on credentials as environment variables which is disabled per default for Python apps.
71
78
72
-
We also set another environment variable called `FLOWER_AUTH_EMAIL` that is passed to the Flower web process for authentication purposes. Without this, the web interface would be public showing your secret AMQP credentials and allowing people to stop your workers.
79
+
We also set another environment variables called `AUTH_USER` and `AUTH_PW` that are passed to the Flower web process for authentication purposes. Without this, the web interface would be public showing your secret AMQP credentials and allowing people to stop your workers.
[TIMESTAMP] WRK_ID [TIMESTAMP: INFO/MainProcess] Events enabled by remote.
154
156
~~~
155
157
156
-
If you refresh the web interface at `http://APP_NAME.cloudcontrolled.com` you should be able to see the worker now.
158
+
Congratulations, you can now see your Celery application with the worker in the Flower web interface at `http://APP_NAME.cloudcontrolled.com`
157
159
158
160
To handle more tasks simultaneously you can always just add more workers. (Please note that only the first worker is free, adding additional workers requires a billing account.)
0 commit comments