2023-09-01 01:30:53 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2024-02-19 01:03:01 +02:00
|
|
|
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
|
|
|
|
export LD_PRELOAD="$lib_path"
|
2023-12-14 21:51:24 +02:00
|
|
|
export LD_BIND_NOW=1
|
2023-09-01 01:30:53 +02:00
|
|
|
|
|
|
|
: "${MACHINE_LEARNING_HOST:=0.0.0.0}"
|
|
|
|
: "${MACHINE_LEARNING_PORT:=3003}"
|
|
|
|
: "${MACHINE_LEARNING_WORKERS:=1}"
|
2023-09-07 03:27:29 +02:00
|
|
|
: "${MACHINE_LEARNING_WORKER_TIMEOUT:=120}"
|
2023-09-01 01:30:53 +02:00
|
|
|
|
|
|
|
gunicorn app.main:app \
|
2023-12-14 21:51:24 +02:00
|
|
|
-k app.config.CustomUvicornWorker \
|
2024-02-19 01:03:01 +02:00
|
|
|
-w "$MACHINE_LEARNING_WORKERS" \
|
|
|
|
-b "$MACHINE_LEARNING_HOST":"$MACHINE_LEARNING_PORT" \
|
|
|
|
-t "$MACHINE_LEARNING_WORKER_TIMEOUT" \
|
2023-12-14 21:51:24 +02:00
|
|
|
--log-config-json log_conf.json \
|
|
|
|
--graceful-timeout 0
|