|
.PHONY: help install build up down stop restart logs clean test lint format check-env open open-ui open-ollama |
|
|
|
|
|
help: |
|
@echo "\nLLM Demo - Available commands:\n" |
|
@echo " make install Install Python dependencies" |
|
@echo " make build Build Docker containers" |
|
@echo " make up Start all services in detached mode" |
|
@echo " make down Stop and remove all containers, networks, and volumes" |
|
@echo " make stop Stop all running containers" |
|
@echo " make restart Restart all services" |
|
@echo " make logs Follow container logs" |
|
@echo " make logs-ollama Follow Ollama container logs" |
|
@echo " make logs-ui Follow Streamlit UI logs" |
|
@echo " make clean Remove all containers, networks, and volumes" |
|
@echo " make test Run tests" |
|
@echo " make lint Run linter" |
|
@echo " make format Format code" |
|
@echo " make shell-ollama Open shell in Ollama container" |
|
@echo " make shell-ui Open shell in Streamlit UI container" |
|
@echo " make open Open all services in browser" |
|
@echo " make open-ui Open Streamlit UI in browser" |
|
@echo " make open-ollama Open Ollama API in browser" |
|
|
|
|
|
check-env: |
|
@if [ ! -f .env ]; then \ |
|
echo "Error: .env file not found. Please create one from .env.example"; \ |
|
exit 1; \ |
|
fi |
|
|
|
|
|
install: |
|
@echo "Installing Python dependencies..." |
|
python -m pip install --upgrade pip |
|
pip install -r requirements.txt |
|
|
|
|
|
build: check-env |
|
@echo "Building Docker containers..." |
|
docker-compose build |
|
|
|
|
|
up: check-env |
|
@echo "Starting all services..." |
|
docker-compose up -d |
|
|
|
|
|
down: |
|
@echo "Stopping and removing all containers..." |
|
docker-compose down -v |
|
|
|
|
|
stop: |
|
@echo "Stopping and removing all containers, networks, and images..." |
|
docker-compose down --rmi all --volumes --remove-orphans |
|
@echo "Removing unused Docker resources..." |
|
docker system prune -a -f --volumes |
|
@echo "Removing all unused Docker networks..." |
|
docker network prune -f |
|
@echo "Removing all unused Docker volumes..." |
|
docker volume prune -f |
|
|
|
|
|
restart: stop up |
|
|
|
|
|
logs: |
|
docker-compose logs -f |
|
|
|
|
|
logs-ollama: |
|
docker-compose logs -f ollama |
|
|
|
|
|
logs-ui: |
|
docker-compose logs -f streamlit-ui |
|
|
|
|
|
clean: stop |
|
|
|
|
|
test: |
|
@echo "Running tests..." |
|
|
|
|
|
|
|
|
|
lint: |
|
@echo "Running linter..." |
|
|
|
|
|
|
|
|
|
format: |
|
@echo "Formatting code..." |
|
|
|
|
|
|
|
|
|
shell-ollama: |
|
docker-compose exec ollama /bin/sh |
|
|
|
|
|
shell-ui: |
|
docker-compose exec streamlit-ui /bin/sh |
|
|
|
|
|
open: open-ui open-ollama |
|
|
|
|
|
open-ui: |
|
@echo "Opening Streamlit UI..." |
|
@xdg-open http://localhost:8501 2>/dev/null || open http://localhost:8501 2>/dev/null || start http://localhost:8501 2>/dev/null || echo "Could not open the browser. Please open http://localhost:8501 manually" |
|
|
|
|
|
open-ollama: |
|
@echo "Opening Ollama API..." |
|
@xdg-open http://localhost:11436 2>/dev/null || open http://localhost:11436 2>/dev/null || start http://localhost:11436 2>/dev/null || echo "Could not open the browser. Please open http://localhost:11436 manually" |
|
|