-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·50 lines (46 loc) · 1.35 KB
/
entrypoint.sh
File metadata and controls
executable file
·50 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env sh
set -e
. /app/.venv/bin/activate
. /app/construct-redis-url.sh
LOG_LEVEL=${LOG_LEVEL:=INFO}
WORKER_CONCURRENCY=${WORKER_CONCURRENCY:=4}
wait-for-dep ${REDIS_DEPENDENCIES} "${MONGO_URI}" "${MIB_INDEX}"
ENABLE_TRAPS_SECRETS=${ENABLE_TRAPS_SECRETS:=false}
ENABLE_WORKER_POLLER_SECRETS=${ENABLE_WORKER_POLLER_SECRETS:=false}
wait-for-dep "${REDIS_DEPENDENCIES}" "${MONGO_URI}" "${MIB_INDEX}"
if [ "$ENABLE_TRAPS_SECRETS" = "true" ] || [ "$ENABLE_WORKER_POLLER_SECRETS" = "true" ]; then
python /app/secrets/manage_secrets.py
fi
case $1 in
inventory)
inventory-loader
;;
celery)
case $2 in
beat)
celery -A splunk_connect_for_snmp.poller beat -l "$LOG_LEVEL" --max-interval=10
;;
worker-trap)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -Q traps --autoscale=8,"$WORKER_CONCURRENCY"
;;
worker-poller)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -O fair -Q poll --autoscale=8,"$WORKER_CONCURRENCY"
;;
worker-sender)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -Q send --autoscale=6,"$WORKER_CONCURRENCY"
;;
flower)
celery -A splunk_connect_for_snmp.poller flower
;;
*)
celery "$2"
;;
esac
;;
trap)
traps "$LOG_LEVEL"
;;
*)
echo -n unknown cmd "$@"
;;
esac