mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-05-20 23:44:43 +02:00
remove unused files, imports
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the directory of the script
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Navigate to the project root (2 levels up from .github/workflows)
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
|
||||
# Move to the project root
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Start Flask server in the background
|
||||
python -m src.api.controller &
|
||||
SERVER_PID=$!
|
||||
|
||||
# Function to check if server is up
|
||||
wait_for_server() {
|
||||
echo "Waiting for Flask server to start..."
|
||||
local max_attempts=100
|
||||
local attempt=0
|
||||
|
||||
while [ $attempt -lt $max_attempts ]; do
|
||||
if curl -s http://localhost:9998/ > /dev/null 2>&1; then
|
||||
echo "Server is up!"
|
||||
return 0
|
||||
fi
|
||||
|
||||
attempt=$((attempt + 1))
|
||||
echo "Attempt $attempt/$max_attempts - Server not ready yet, waiting..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Server failed to start after $max_attempts attempts"
|
||||
kill $SERVER_PID
|
||||
return 1
|
||||
}
|
||||
|
||||
# Wait for server to be ready
|
||||
wait_for_server || exit 1
|
||||
|
||||
# Make the actual request once server is ready
|
||||
echo "Making API request..."
|
||||
curl -X POST -i http://localhost:9998/api/conversations \
|
||||
-d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' \
|
||||
-H "Content-Type: application/json" || exit 1
|
||||
echo
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user