-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
41 lines (32 loc) · 1.13 KB
/
entrypoint.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
29
30
31
32
33
34
35
36
37
38
39
40
41
export PYTHONUNBUFFERED=TRUE
export XDG_CACHE_HOME=/tmp/xdg_cache_home
mkdir -pv $XDG_CACHE_HOME/astropy
ls -tlroa /var/log/containers/
(
export HOME_OVERRRIDE=$PWD/runtime-home
mkdir -pv $HOME_OVERRRIDE
source /init.sh
export TMPDIR=/scratch/tmpdir
mkdir -pv TMPDIR
python -c 'import xspec; print(xspec)'
# it might be better not to change directory, if jobs need to be preserved between restarts
# WORK_DIR=$PWD/$(date +%Y-%m-%d-%H-%M-%S)-$$
# mkdir -pv $WORK_DIR
# cd $WORK_DIR
echo -e "\033[31mworking in $PWD\033[0m"
if [ ${DISPATCHER_GUNICORN:-no} == "yes" ]; then
gunicorn \
'cdci_data_analysis.flask_app.app:conf_app("/dispatcher/conf/conf_env.yml")' \
--bind 0.0.0.0:8000 \
--workers 8 \
--preload \
--timeout 900 \
--limit-request-line 0 \
--log-level debug
else
python /cdci_data_analysis/bin/run_osa_cdci_server.py \
-conf_file /dispatcher/conf/conf_env.yml \
-debug \
-use_gunicorn 2>&1 | tee -a /var/log/containers/${CONTAINER_NAME} -
fi
)