-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·49 lines (36 loc) · 2.05 KB
/
entrypoint.sh
File metadata and controls
executable file
·49 lines (36 loc) · 2.05 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
#!/bin/bash
#export PATH=/reg/g/psdm/sw/conda/inst/miniconda2-prod-rhel7/bin:${PATH}
#source activate ana-1.2.12-py3
# Use this pattern to setup configuration.
# However, please use the EXTERNAL_CONFIG_FILE that is NOT part of this repo to set up sensitive/installation-specific config.
[ -z "$ROLES_DATABASE_HOST" ] && export ROLES_DATABASE_HOST="localhost"
[ -z "$ROLES_DATABASE_DB" ] && export ROLES_DATABASE_DB="ROLES"
[ -z "$ROLES_DATABASE_USER" ] && export ROLES_DATABASE_USER="test"
[ -z "$ROLES_DATABASE_PASSWORD" ] && export ROLES_DATABASE_PASSWORD="test"
# We pick up installation-specific config from a file outside of this repo.
PRNT_DIR=`dirname $PWD`
G_PRNT_DIR=`dirname $PRNT_DIR`;
GG_PRNT_DIR=`dirname $G_PRNT_DIR`;
GGG_PRNT_DIR=`dirname $GG_PRNT_DIR`;
EXTERNAL_CONFIG_FILE="${GGG_PRNT_DIR}/appdata/explgbk_config/explgbk_config.sh"
[ -z "$CONDA_PREFIX" ] && export CONDA_PREFIX="/usr"
if [[ -f "${EXTERNAL_CONFIG_FILE}" ]]
then
echo "Sourcing deployment specific configuration from ${EXTERNAL_CONFIG_FILE}"
source "${EXTERNAL_CONFIG_FILE}"
else
echo "Did not find external deployment specific configuration - ${EXTERNAL_CONFIG_FILE}"
fi
# Of course, please change this port to the appropriate port in the 8000-1000 range.
# Also change start:app to your_service:app (this should make it easier to identify your service amongst the pile of gunicorns)
# Add a proxy in the wen servce to proxy this port onto the location for this service.
export ACCESS_LOG_FORMAT='%(h)s %(l)s %({REMOTE_USER}i)s %(t)s "%(r)s" "%(q)s" %(s)s %(b)s %(D)s'
export SERVER_IP_PORT="0.0.0.0:$GUNICORN_PORT"
# The exec assumes you are calling this from supervisord. If you call this from the command line; your bash shell is proabably gone and you need to log in.
cd $APP_DIR
# sleep to faciliate waiting for kafka
sleep 10
exec gunicorn $GUNICORN_MODULE:$GUNICORN_CALLABLE \
-b ${SERVER_IP_PORT} --worker-class eventlet --reload \
--log-level=DEBUG --env DEBUG=TRUE --capture-output --enable-stdio-inheritance \
--access-logfile - --access-logformat "${ACCESS_LOG_FORMAT}"