File tree 5 files changed +57
-11
lines changed
5 files changed +57
-11
lines changed Original file line number Diff line number Diff line change @@ -173,3 +173,18 @@ OAUTH2_CLIENT_SECRET=rCnp5txobUo83EpQEblM8fVj3QT5zb5qRfxNsuPzCqZaiRyIoxM4jdgMiZK
173
173
# GeoNode APIs
174
174
API_LOCKDOWN = False
175
175
TASTYPIE_APIKEY =
176
+
177
+ # CELERY
178
+
179
+ # expressed in KB
180
+ # CELERY__MAX_MEMORY_PER_CHILD="200000"
181
+ # ##
182
+ # Note right autoscale value must coincide with worker concurrency value
183
+ # CELERY__AUTOSCALE_VALUES="1,4"
184
+ # CELERY__WORKER_CONCURRENCY="4"
185
+ # ##
186
+ # CELERY__OPTS="--without-gossip --without-mingle -Ofair -B -E"
187
+ # CELERY__BEAT_SCHEDULE="/mnt/volumes/statics/celerybeat-schedule"
188
+ # CELERY__LOG_LEVEL="INFO"
189
+ # CELERY__LOG_FILE="/var/log/celery.log"
190
+ # CELERY__WORKER_NAME="worker1@%h"
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ RUN chmod +x /usr/src/geonode/tasks.py \
47
47
COPY celery.sh /usr/bin/celery-commands
48
48
RUN chmod +x /usr/bin/celery-commands
49
49
50
+ COPY celery-cmd /usr/bin/celery-cmd
51
+ RUN chmod +x /usr/bin/celery-cmd
52
+
50
53
# Prepraing dependencies
51
54
RUN apt-get update && apt-get install -y devscripts build-essential debhelper pkg-kde-tools sharutils
52
55
# RUN git clone https://salsa.debian.org/debian-gis-team/proj.git /tmp/proj
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # A configurable celery command.
3
+ # Luca Pasquali <luca.pasquali@geo-solutions.it>
4
+ CELERY_BIN=${CELERY_BIN:- " $( which celery|| echo celery) " }
5
+ CELERY_APP=${CELERY_APP:- " geonode.celery_app:app" }
6
+ CELERY__STATE_DB=${CELERY__STATE_DB:- " /mnt/volumes/statics/worker.state" }
7
+ # expressed in KB
8
+ CELERY__MAX_MEMORY_PER_CHILD=${CELERY__MAX_MEMORY_PER_CHILD:- " 200000" }
9
+ CELERY__AUTOSCALE_VALUES=${CELERY__AUTOSCALE_VALUES:- " 2,4" }
10
+ CELERY__MAX_TASKS_PER_CHILD=${CELERY__MAX_TASKS_PER_CHILD:- " 10" }
11
+ CELERY__OPTS=${CELERY__OPTS:- " --without-gossip --without-mingle -Ofair -B -E" }
12
+ CELERY__BEAT_SCHEDULE=${CELERY__BEAT_SCHEDULE:- " /mnt/volumes/statics/celerybeat-schedule" }
13
+ CELERY__LOG_LEVEL=${CELERY__LOG_LEVEL:- " INFO" }
14
+ CELERY__LOG_FILE=${CELERY__LOG_FILE:- " /var/log/celery.log" }
15
+ CELERY__WORKER_NAME=${CELERY__WORKER_NAME:- " worker1@%h" }
16
+ CELERY__WORKER_CONCURRENCY=${CELERY__WORKER_CONCURRENCY:- " 4" }
17
+
18
+ $CELERY_BIN -A $CELERY_APP worker --autoscale=$CELERY__AUTOSCALE_VALUES \
19
+ --max-memory-per-child=$CELERY__MAX_MEMORY_PER_CHILD $CELERY__OPTS \
20
+ --statedb=$CELERY__STATE_DB -s $CELERY__BEAT_SCHEDULE \
21
+ --loglevel=$CELERY__LOG_LEVEL -n $CELERY__WORKER_NAME -f $CELERY__LOG_FILE \
22
+ --concurrency=$CELERY__WORKER_CONCURRENCY --max-tasks-per-child=$CELERY__MAX_TASKS_PER_CHILD
Original file line number Diff line number Diff line change 1
1
version : ' 3.4'
2
2
services :
3
3
4
- # Common Django template for Geonode, Celery services below
4
+ # Common Django template for GeoNode and Celery services below
5
5
x-common-django :
6
6
&default-common-django
7
7
image : geonode/geonode:latest
8
8
restart : on-failure
9
- build :
10
- context : ./
11
- dockerfile : Dockerfile
12
9
env_file :
13
10
- .env_test
14
11
volumes :
@@ -24,6 +21,9 @@ services:
24
21
# Our custom django application. It includes Geonode.
25
22
django :
26
23
<< : *default-common-django
24
+ build :
25
+ context : ./
26
+ dockerfile : Dockerfile
27
27
container_name : django4${COMPOSE_PROJECT_NAME}
28
28
healthcheck :
29
29
test : " curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n ' --output /dev/null http://127.0.0.1:8001/"
@@ -39,11 +39,14 @@ services:
39
39
# Celery worker that executes celery tasks created by Django.
40
40
celery :
41
41
<< : *default-common-django
42
+ image : geonode/geonode:latest
42
43
container_name : celery4${COMPOSE_PROJECT_NAME}
44
+ depends_on :
45
+ - django
43
46
environment :
44
47
- IS_CELERY=True
45
48
entrypoint : ["/usr/src/geonode/entrypoint.sh"]
46
- command : " celery -A geonode.celery_app:app worker --without-gossip --without-mingle -Ofair -B -E --statedb=/mnt/volumes/statics/worker.state -s /mnt/volumes/statics/celerybeat-schedule --loglevel=INFO --concurrency=10 -n worker1@%h -f /var/log/celery.log "
49
+ command : " celery-cmd "
47
50
48
51
# Nginx is serving django static and media files and proxies to django and geonode
49
52
geonode :
@@ -110,7 +113,7 @@ services:
110
113
111
114
# PostGIS database.
112
115
db :
113
- # use geonode official postgis 11 image
116
+ # use geonode official postgis 13 image
114
117
image : geonode/postgis:13
115
118
container_name : db4${COMPOSE_PROJECT_NAME}
116
119
env_file :
Original file line number Diff line number Diff line change 1
1
version : ' 3.4'
2
2
services :
3
3
4
- # Common Django template for Geonode, Celery services below
4
+ # Common Django template for GeoNode and Celery services below
5
5
x-common-django :
6
6
&default-common-django
7
7
image : geonode/geonode:latest
8
8
restart : on-failure
9
- build :
10
- context : ./
11
- dockerfile : Dockerfile
12
9
env_file :
13
10
- .env
14
11
volumes :
@@ -24,6 +21,9 @@ services:
24
21
# Our custom django application. It includes Geonode.
25
22
django :
26
23
<< : *default-common-django
24
+ build :
25
+ context : ./
26
+ dockerfile : Dockerfile
27
27
container_name : django4${COMPOSE_PROJECT_NAME}
28
28
healthcheck :
29
29
test : " curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n ' --output /dev/null http://127.0.0.1:8001/"
@@ -39,11 +39,14 @@ services:
39
39
# Celery worker that executes celery tasks created by Django.
40
40
celery :
41
41
<< : *default-common-django
42
+ image : geonode/geonode:latest
42
43
container_name : celery4${COMPOSE_PROJECT_NAME}
44
+ depends_on :
45
+ - django
43
46
environment :
44
47
- IS_CELERY=True
45
48
entrypoint : ["/usr/src/geonode/entrypoint.sh"]
46
- command : " celery -A geonode.celery_app:app worker --without-gossip --without-mingle -Ofair -B -E --statedb=/mnt/volumes/statics/worker.state -s /mnt/volumes/statics/celerybeat-schedule --loglevel=INFO --concurrency=10 -n worker1@%h -f /var/log/celery.log "
49
+ command : " celery-cmd "
47
50
48
51
# Nginx is serving django static and media files and proxies to django and geonode
49
52
geonode :
You can’t perform that action at this time.
0 commit comments