Skip to content

Commit

Permalink
Better broker mgmt inside entrypoints (#2491)
Browse files Browse the repository at this point in the history
Signed-off-by: 0ssigeno <s.berni@certego.net>
  • Loading branch information
0ssigeno authored Aug 29, 2024
1 parent d1ee5f1 commit 854be54
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
11 changes: 10 additions & 1 deletion docker/entrypoints/celery_default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ else
worker_number=8
fi

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"

if [ "$AWS_SQS" = "True" ]
then
queues="default.fifo,config.fifo"
else
queues="default,broadcast,config"
fi


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"
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
then
echo "Running celery with autoreload"
Expand Down
10 changes: 9 additions & 1 deletion docker/entrypoints/celery_ingestor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ until cd /opt/deploy/intel_owl
do
echo "Waiting for server volume..."
done
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"

if [ "$AWS_SQS" = "True" ]
then
queues="ingestor.fifo,config.fifo"
else
queues="ingestor,broadcast,config"
fi

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"
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
then
echo "Running celery with autoreload"
Expand Down
8 changes: 7 additions & 1 deletion docker/entrypoints/celery_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ until cd /opt/deploy/intel_owl
do
echo "Waiting for server volume..."
done
if [ "$AWS_SQS" = "True" ]
then
queues="local.fifo,config.fifo"
else
queues="local,broadcast,config"
fi

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"
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"
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
then
echo "Running celery with autoreload"
Expand Down
9 changes: 8 additions & 1 deletion docker/entrypoints/celery_long.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ until cd /opt/deploy/intel_owl
do
echo "Waiting for server volume..."
done
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"
if [ "$AWS_SQS" = "True" ]
then
queues="long.fifo,config.fifo"
else
queues="long,broadcast,config"
fi

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"
if [[ $DEBUG == "True" ]] && [[ $DJANGO_TEST_SERVER == "True" ]];
then
echo "Running celery with autoreload"
Expand Down

0 comments on commit 854be54

Please # to comment.