From 7c91735656435eab79960e165b6797e5bddcc336 Mon Sep 17 00:00:00 2001 From: scepterus <56637330+scepterus@users.noreply.github.com> Date: Wed, 20 Dec 2023 07:29:09 +0200 Subject: [PATCH] Update entrypoint.sh Added Nvidia-SMI and fixed some bash inefficiencies. --- backend-gpu/entrypoint.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/backend-gpu/entrypoint.sh b/backend-gpu/entrypoint.sh index 4149826..11c2157 100755 --- a/backend-gpu/entrypoint.sh +++ b/backend-gpu/entrypoint.sh @@ -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 @@ -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