-
Notifications
You must be signed in to change notification settings - Fork 5
/
initialize.sh
executable file
·28 lines (23 loc) · 1.07 KB
/
initialize.sh
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
#!/bin/sh
set -e
# Set up pipelines scheduler only if $OS_DPP_DISABLE_PIPELINES is not True
if [[ -n "$OS_DPP_DISABLE_PIPELINES" && "$OS_DPP_DISABLE_PIPELINES" = "True" ]]; then
echo "Pipelines are disabled."
dpp init
else
echo "Starting Celery schedulers"
rm -f celeryd.pid
rm -f celerybeat.pid
# Reset pipeline statuses
redis-cli -h $DPP_REDIS_HOST -n 5 FLUSHDB
redis-cli -h $DPP_REDIS_HOST -n 10 FLUSHDB
export DPP_CELERY_BROKER=redis://$DPP_REDIS_HOST:6379/10
SCHEDULER=1 python3 -m celery -b $DPP_CELERY_BROKER -A datapackage_pipelines.app -l INFO beat &
python3 -m celery -b $DPP_CELERY_BROKER --concurrency=1 -A datapackage_pipelines.app -Q datapackage-pipelines-management -l INFO worker -n worker1@%h &
python3 -m celery -b $DPP_CELERY_BROKER --concurrency=4 -A datapackage_pipelines.app -Q datapackage-pipelines -l INFO worker -n worker2@%h &
/usr/bin/env os-types "[]" | true
cd source-specs
fi
# Always run the dpp server, even if pipelines are disabled. This is so the
# container can respond to web requests.
dpp serve