forked from sentient-agi/ROMA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
166 lines (131 loc) · 3.92 KB
/
Makefile
File metadata and controls
166 lines (131 loc) · 3.92 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
155
156
157
158
159
160
161
162
163
164
165
166
# Makefile for SentientResearchAgent
.PHONY: help install install-dev run run-debug frontend-dev test clean clean-cache clean-experiments lint format docker-up docker-down
# Setup targets
setup:
@./setup.sh
setup-docker:
@./setup.sh --docker
setup-native:
@./setup.sh --native
# Default target
help:
@echo "SentientResearchAgent Development Commands"
@echo "========================================="
@echo "setup Run interactive setup (Docker or Native)"
@echo "setup-docker Run Docker setup directly"
@echo "setup-native Run native Ubuntu/Debian setup"
@echo "install Install dependencies with PDM"
@echo "install-dev Install with development dependencies"
@echo "run Run the server"
@echo "run-debug Run server in debug mode"
@echo "frontend-dev Run frontend development server"
@echo "test Run tests"
@echo "clean Clean all generated files"
@echo "clean-cache Clean agent cache"
@echo "clean-experiments Clean old experiment results"
@echo "lint Run code linting"
@echo "format Format code"
@echo "docker-up Start Docker services"
@echo "docker-down Stop Docker services"
# Installation
install:
@echo "Setting up project dependencies..."
@if ! command -v pdm &> /dev/null; then \
echo "PDM not found. Please run ./setup.sh first"; \
exit 1; \
fi
pdm config use_uv true
uv pip install -r requirements.txt
install-dev:
@echo "Setting up development environment..."
@if ! command -v pdm &> /dev/null; then \
echo "PDM not found. Please run ./setup.sh first"; \
exit 1; \
fi
pdm config use_uv true
uv pip install -r requirements.txt
cd frontend && npm install
# Running
run:
@if [ -f .venv/bin/activate ]; then \
. .venv/bin/activate && python -m sentientresearchagent; \
else \
eval "$$(pdm venv activate)" && python -m sentientresearchagent; \
fi
run-debug:
@if [ -f .venv/bin/activate ]; then \
. .venv/bin/activate && python -m sentientresearchagent --debug; \
else \
eval "$$(pdm venv activate)" && python -m sentientresearchagent --debug; \
fi
frontend-dev:
cd frontend && npm run dev
# Testing
test:
pdm run pytest
test-coverage:
pdm run pytest --cov=sentientresearchagent --cov-report=html
# Cleaning
clean: clean-cache clean-logs clean-pycache
@echo "Cleaned cache, logs, and Python artifacts"
clean-pycache:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name ".DS_Store" -delete
clean-cache:
rm -rf runtime/cache/
rm -rf .agent_cache/ # Legacy
clean-logs:
rm -rf runtime/logs/
rm -f *.log # Legacy logs in root
clean-runtime:
rm -rf runtime/
@echo "Cleaned all runtime files"
clean-legacy:
rm -rf .agent_cache/
rm -rf .agent_projects/
rm -rf project_results/
rm -rf emergency_backups/
rm -f *.log
@echo "Cleaned legacy directories"
clean-experiments:
python scripts/clean_old_experiments.py --dry-run
clean-experiments-force:
python scripts/clean_old_experiments.py
clean-all: clean clean-runtime clean-legacy clean-experiments-force
@echo "Performed complete cleanup"
# Code quality
lint:
pdm run ruff check src/
format:
pdm run ruff format src/
pdm run ruff check --fix src/
# Docker (delegate to docker/Makefile)
docker-up:
$(MAKE) -C docker up
docker-down:
$(MAKE) -C docker down
docker-logs:
$(MAKE) -C docker logs
docker-build:
$(MAKE) -C docker build
docker-shell:
$(MAKE) -C docker shell
docker-clean:
$(MAKE) -C docker clean
# Development shortcuts
dev: install-dev
@echo "Development environment ready!"
quick-test:
python -m sentientresearchagent --config experiments/configs/example_research.yaml
# Logging utilities
logs:
python scripts/view_logs.py -f
logs-error:
python scripts/view_logs.py -f -l ERROR
logs-search:
@read -p "Search pattern: " pattern; \
python scripts/view_logs.py -f -s "$$pattern"
test-logging:
python scripts/test_logging.py