Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit dad396b

Browse files
0ssigenovaclavbartos
authored andcommitted
Better broker mgmt inside entrypoints (intelowlproject#2491)
Signed-off-by: 0ssigeno <[email protected]>
1 parent def53e3 commit dad396b

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

docker/entrypoints/celery_default.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ else
1414
worker_number=8
1515
fi
1616

17-
ARGUMENTS="-A intel_owl.celery worker -n worker_default --uid www-data --gid www-data --time-limit=10000 --pidfile= -c $worker_number -Ofair -Q default,broadcast,config -E --without-gossip"
17+
18+
if [ "$AWS_SQS" = "True" ]
19+
then
20+
queues="default.fifo,config.fifo"
21+
else
22+
queues="default,broadcast,config"
23+
fi
24+
25+
26+
ARGUMENTS="-A intel_owl.celery worker -n worker_default --uid www-data --gid www-data --time-limit=10000 --pidfile= -c $worker_number -Ofair -Q ${queues} -E --without-gossip"
1827
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
1928
then
2029
echo "Running celery with autoreload"

docker/entrypoints/celery_ingestor.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ until cd /opt/deploy/intel_owl
44
do
55
echo "Waiting for server volume..."
66
done
7-
ARGUMENTS="-A intel_owl.celery worker -n worker_ingestor --uid www-data --gid www-data --time-limit=40000 --pidfile= -Ofair -Q ingestor,broadcast,config -E --autoscale=1,15 --without-gossip"
7+
8+
if [ "$AWS_SQS" = "True" ]
9+
then
10+
queues="ingestor.fifo,config.fifo"
11+
else
12+
queues="ingestor,broadcast,config"
13+
fi
14+
15+
ARGUMENTS="-A intel_owl.celery worker -n worker_ingestor --uid www-data --gid www-data --time-limit=40000 --pidfile= -Ofair -Q ${queues} -E --autoscale=1,15 --without-gossip"
816
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
917
then
1018
echo "Running celery with autoreload"

docker/entrypoints/celery_local.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ until cd /opt/deploy/intel_owl
44
do
55
echo "Waiting for server volume..."
66
done
7+
if [ "$AWS_SQS" = "True" ]
8+
then
9+
queues="local.fifo,config.fifo"
10+
else
11+
queues="local,broadcast,config"
12+
fi
713

8-
ARGUMENTS="-A intel_owl.celery worker -n worker_local --uid www-data --time-limit=10000 --gid www-data --pidfile= -Ofair -Q local,broadcast,config -E --without-gossip"
14+
ARGUMENTS="-A intel_owl.celery worker -n worker_local --uid www-data --time-limit=10000 --gid www-data --pidfile= -Ofair -Q ${queues} -E --without-gossip"
915
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
1016
then
1117
echo "Running celery with autoreload"

docker/entrypoints/celery_long.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ until cd /opt/deploy/intel_owl
44
do
55
echo "Waiting for server volume..."
66
done
7-
ARGUMENTS="-A intel_owl.celery worker -n worker_long --uid www-data --gid www-data --time-limit=40000 --pidfile= -Ofair -Q long,broadcast,config -E --without-gossip"
7+
if [ "$AWS_SQS" = "True" ]
8+
then
9+
queues="long.fifo,config.fifo"
10+
else
11+
queues="long,broadcast,config"
12+
fi
13+
14+
ARGUMENTS="-A intel_owl.celery worker -n worker_long --uid www-data --gid www-data --time-limit=40000 --pidfile= -Ofair -Q ${queues} -E --without-gossip"
815
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
916
then
1017
echo "Running celery with autoreload"

0 commit comments

Comments
 (0)