-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.sh
More file actions
38 lines (29 loc) · 1.02 KB
/
Copy pathstart_server.sh
File metadata and controls
38 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
!/bin/bash
# Script to manage Ollama and Backend server, including killing processes.
# --- Setup and Configuration ---
# Check for required tools
if ! command -v ollama &> /dev/null
then
echo "Error: ollama is not installed. Please install it using: helm install ollama"
exit 1
fi
if ! command -v uvicorn &> /dev/null
then
echo "Error: uvicorn is not installed. Please install it using: helm install uvicorn"
exit 1
fi
if ! command -v python3 &> /dev/null
then
echo "Error: python3 is not installed. Please install it using: helm install python3"
exit 1
fi
# --- Ollama Command Execution ---
echo "Running Ollama to start the server..."
ollama serve &
# --- Backend Server Command Execution ---
echo "Running Uvicorn to start the backend server..."
uvicorn ~/Document/Project/gemmapilot/backend server:app --host 0.0.0.0 --port 8000
# --- Killing Processes ---
echo "Killing processes to stop the server..."
kill -9 $(lsof -ti :8000) # Kill the backend server process
echo "Script completed successfully."