-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.91 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.91 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
# Makefile for FastMCP Todo Server
# set default device name to Omnispindle
DeNa ?= omnispindle
.PHONY: install run test coverage clean status deploy deploy-dry-run deploy-force
# Install dependencies
install:
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt
# uv pip install -r requirements-prod.txt
# Run the FastMCP server (HTTP - recommended for remote)
run:
fastmcp run src/Omnispindle/http_server.py
COMMIT_HASH=$(git rev-parse --short HEAD)
mosquitto_pub -h localhost -p 4140 -t "status/$(DeNa)/commit" -m "{\"commit_hash\": \"$(COMMIT_HASH)\"}"
# Run the old SSE server (legacy)
run-sse:
python3.11 -m src.Omnispindle
COMMIT_HASH=$(git rev-parse --short HEAD)
mosquitto_pub -h localhost -p 4140 -t "status/$(DeNa)/commit" -m "{\"commit_hash\": \"$(COMMIT_HASH)\"}"
# Run stdio server locally
run-stdio:
python3.11 -m src.Omnispindle.stdio_server
# deploy — pull latest on eaws and restart
deploy:
ssh eaws "cd /home/ubuntu/Omnispindle && git pull origin main && pm2 restart Omnispindle-HTTP"
# deploy-dry-run — show what would change
deploy-dry-run:
ssh eaws "cd /home/ubuntu/Omnispindle && git fetch origin main && git log HEAD..origin/main --oneline"
# deploy-force — hard reset to origin/main then restart
deploy-force:
ssh eaws "cd /home/ubuntu/Omnispindle && git fetch origin main && git reset --hard origin/main && pm2 restart Omnispindle-HTTP"
# Run tests
test:
python -m pytest tests/
# Run tests with coverage
coverage:
python -m pytest --cov=src tests/
# Clean up __pycache__ directories
clean:
find . -name "__pycache__" -exec rm -r {} +
# Check status of submodules and remote PM2 processes
status:
git submodule foreach "git status"
ssh eaws "pm2 ls"
ssh saws "pm2 ls"
sync:
git submodule foreach "git pull || echo No changes"
ssh eaws "cd ~/Omnispindle && git pull"
ssh eaws "pm2 restart Omnispindle"
sleep 2 && ssh eaws "pm2 logs Omnispindle --lines 10 && exit"