Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
154 lines (131 loc) Β· 4.73 KB
/
Copy pathMakefile
File metadata and controls
154 lines (131 loc) Β· 4.73 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# π Robolog - AI-Powered Log Monitoring
# Makefile for easy development and management
.PHONY: help install start stop restart logs status test-errors config update clean build
# Default target
help:
@echo "π Robolog - AI-Powered Log Monitoring"
@echo "======================================"
@echo ""
@echo "Available commands:"
@echo " make install - Install Robolog (requires sudo)"
@echo " make start - Start all services"
@echo " make stop - Stop all services"
@echo " make restart - Restart all services"
@echo " make logs - Show logs from all services"
@echo " make logs-app - Show logs from app service"
@echo " make logs-analyzer - Show logs from analyzer service"
@echo " make logs-ollama - Show logs from ollama service"
@echo " make status - Show service status"
@echo " make test-errors - Generate realistic test errors"
@echo " make config - Edit configuration"
@echo " make update - Update to latest images"
@echo " make build - Build all containers"
@echo " make clean - Clean up containers and volumes"
@echo " make uninstall - Completely remove Robolog"
@echo ""
@echo "Development commands:"
@echo " make dev-start - Start in development mode"
@echo " make dev-logs - Follow logs in development"
@echo " make dev-rebuild - Rebuild and restart services"
# Installation (requires sudo)
install:
@echo "π Installing Robolog..."
@if [ "$${EUID}" -ne 0 ]; then \
echo "β Installation requires sudo privileges"; \
echo "Run: sudo make install"; \
exit 1; \
fi
@chmod +x install.sh
@./install.sh
# Service management
start:
@echo "π Starting Robolog services..."
@docker-compose up -d
stop:
@echo "βΉοΈ Stopping Robolog services..."
@docker-compose down
restart:
@echo "π Restarting Robolog services..."
@docker-compose restart
# Logs
logs:
@echo "π Showing logs from all services (Ctrl+C to exit)..."
@docker-compose logs -f
logs-app:
@echo "π Showing app service logs..."
@docker-compose logs -f app
logs-analyzer:
@echo "π Showing analyzer service logs..."
@docker-compose logs -f analyzer
logs-ollama:
@echo "π Showing ollama service logs..."
@docker-compose logs -f ollama
logs-fluent:
@echo "π Showing fluent-bit service logs..."
@docker-compose logs -f fluent-bit
# Status and testing
status:
@echo "π Service status:"
@docker-compose ps
test-errors:
@echo "π§ͺ Generating realistic test errors..."
@curl -s http://localhost/generate-realistic-errors | jq . || curl -s http://localhost/generate-realistic-errors
# Configuration
config:
@echo "π Opening configuration file..."
@$${EDITOR:-nano} .env
# Updates and builds
update:
@echo "π Updating Robolog..."
@docker-compose pull
@docker-compose up -d
build:
@echo "π¨ Building all containers..."
@docker-compose build
dev-rebuild:
@echo "π¨ Rebuilding and restarting for development..."
@docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
@docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Development mode
dev-start:
@echo "π Starting in development mode with live file mounting..."
@docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
dev-logs:
@echo "π Following development logs..."
@docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs -f
# Cleanup
clean:
@echo "π§Ή Cleaning up containers and volumes..."
@docker-compose down --volumes --remove-orphans
@docker system prune -f
# Uninstall
uninstall:
@echo "ποΈ Uninstalling Robolog..."
@docker-compose down --volumes --remove-orphans
@docker system prune -f
@echo "β
Robolog removed (local development)"
@echo "π‘ To remove system installation: sudo robolog uninstall"
# Setup development environment
dev-setup:
@echo "π οΈ Setting up development environment..."
@if [ ! -f .env ]; then \
cp .env.example .env 2>/dev/null || echo "DISCORD_WEBHOOK_URL=" > .env; \
echo "π Created .env file - please configure your Discord webhook"; \
fi
@docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
@echo "β
Development environment ready!"
@echo "π‘ Next steps:"
@echo " 1. Edit .env file: make config"
@echo " 2. Start services: make dev-start"
@echo " 3. Test errors: make test-errors"
# Health check
health:
@echo "π₯ Health check..."
@echo "Docker: $$(docker --version)"
@echo "Docker Compose: $$(docker-compose --version)"
@echo "Services:"
@docker-compose ps
@echo ""
@echo "π Testing endpoints..."
@curl -s http://localhost/ > /dev/null && echo "β
App endpoint working" || echo "β App endpoint failed"
@curl -s http://localhost:11434/api/tags > /dev/null && echo "β
Ollama endpoint working" || echo "β Ollama endpoint failed"