Skip to content

Commit

Permalink
Merge pull request #113 from scepterus/patch-1
Browse files Browse the repository at this point in the history
Update entrypoint.sh
  • Loading branch information
derneuere authored Dec 21, 2023
2 parents f63d630 + 7c91735 commit e8b7643
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions backend-gpu/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#! /bin/bash
#!/bin/bash
export PYTHONUNBUFFERED=TRUE
export PYTHONFAULTHANDLER=1
nvidia-smi

if [[ "$(uname -m)" == "aarch64"* ]]; then
export OPENBLAS_CORETYPE=ARMV8
echo "ARM architecture detected. OPENBLAS_CORETYPE set to ARMV8"
export OPENBLAS_CORETYPE=ARMV8
echo "ARM architecture detected. OPENBLAS_CORETYPE set to ARMV8"
fi
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_MAIN_FREE=1

mkdir -p /logs
Expand All @@ -19,20 +20,18 @@ python service/thumbnail/main.py 2>&1 | tee /logs/thumbnail.log &
python service/face_recognition/main.py 2>&1 | tee /logs/face_recognition.log &
python service/clip_embeddings/main.py 2>&1 | tee /logs/clip_embeddings.log &
python service/image_captioning/main.py 2>&1 | tee /logs/image_captioning.log &
python manage.py clear_cache
python manage.py clear_cache
python manage.py build_similarity_index 2>&1 | tee /logs/command_build_similarity_index.log

if [ -n "$ADMIN_USERNAME" ]
then
python manage.py createadmin -u $ADMIN_USERNAME $ADMIN_EMAIL 2>&1 | tee /logs/command_createadmin.log
if [[ -n "$ADMIN_USERNAME" ]]; then
python manage.py createadmin -u "$ADMIN_USERNAME" "$ADMIN_EMAIL" 2>&1 | tee /logs/command_createadmin.log
fi

echo "Running backend server..."

python manage.py qcluster 2>&1 | tee /logs/qcluster.log &

if [ "$DEBUG" = 1 ]
then
if [[ "$DEBUG" = 1 ]]; then
echo "development backend starting"
gunicorn --worker-class=gevent --max-requests 50 --reload --bind 0.0.0.0:8001 --log-level=info librephotos.wsgi 2>&1 | tee /logs/gunicorn_django.log
else
Expand Down

0 comments on commit e8b7643

Please sign in to comment.