mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 08:56:32 +00:00
[AZ-173] [AZ-174] Stream-based detection API and DB-driven AI config
Made-with: Cursor
This commit is contained in:
+11
-6
@@ -17,8 +17,10 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
PY="$(command -v python3 2>/dev/null || command -v python 2>/dev/null || echo python)"
|
||||
|
||||
echo "Building Cython extensions ..."
|
||||
python setup.py build_ext --inplace
|
||||
"$PY" setup.py build_ext --inplace
|
||||
|
||||
for port in $LOADER_PORT $ANNOTATIONS_PORT $DETECTIONS_PORT; do
|
||||
if lsof -ti :"$port" >/dev/null 2>&1; then
|
||||
@@ -29,13 +31,15 @@ for port in $LOADER_PORT $ANNOTATIONS_PORT $DETECTIONS_PORT; do
|
||||
done
|
||||
|
||||
echo "Starting mock-loader on :$LOADER_PORT ..."
|
||||
MODELS_ROOT="$FIXTURES" \
|
||||
python -m gunicorn --bind "0.0.0.0:$LOADER_PORT" --workers 1 --timeout 120 \
|
||||
cd "$ROOT"
|
||||
MODELS_ROOT="$FIXTURES" PYTHONPATH="$ROOT" \
|
||||
"$PY" -m gunicorn --bind "0.0.0.0:$LOADER_PORT" --workers 1 --timeout 120 \
|
||||
'e2e.mocks.loader.app:app' >/dev/null 2>&1 &
|
||||
PIDS+=($!)
|
||||
|
||||
echo "Starting mock-annotations on :$ANNOTATIONS_PORT ..."
|
||||
python -m gunicorn --bind "0.0.0.0:$ANNOTATIONS_PORT" --workers 1 --timeout 120 \
|
||||
MEDIA_DIR="$FIXTURES" PYTHONPATH="$ROOT" \
|
||||
"$PY" -m gunicorn --bind "0.0.0.0:$ANNOTATIONS_PORT" --workers 1 --timeout 120 \
|
||||
'e2e.mocks.annotations.app:app' >/dev/null 2>&1 &
|
||||
PIDS+=($!)
|
||||
|
||||
@@ -43,7 +47,7 @@ echo "Starting detections service on :$DETECTIONS_PORT ..."
|
||||
LOADER_URL="http://localhost:$LOADER_PORT" \
|
||||
ANNOTATIONS_URL="http://localhost:$ANNOTATIONS_PORT" \
|
||||
PYTHONPATH="$ROOT/src" \
|
||||
python -m uvicorn main:app --host 0.0.0.0 --port "$DETECTIONS_PORT" \
|
||||
"$PY" -m uvicorn main:app --host 0.0.0.0 --port "$DETECTIONS_PORT" \
|
||||
--log-level warning >/dev/null 2>&1 &
|
||||
PIDS+=($!)
|
||||
|
||||
@@ -66,4 +70,5 @@ BASE_URL="http://localhost:$DETECTIONS_PORT" \
|
||||
MOCK_LOADER_URL="http://localhost:$LOADER_PORT" \
|
||||
MOCK_ANNOTATIONS_URL="http://localhost:$ANNOTATIONS_PORT" \
|
||||
MEDIA_DIR="$FIXTURES" \
|
||||
python -m pytest e2e/tests/ -v --tb=short "$@"
|
||||
PYTHONPATH="$ROOT/src" \
|
||||
"$PY" -m pytest e2e/tests/ tests/ -v --tb=short "$@"
|
||||
|
||||
Reference in New Issue
Block a user