-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (69 loc) · 3.44 KB
/
Makefile
File metadata and controls
85 lines (69 loc) · 3.44 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
.PHONY: dev start_local start stop stop_exchange stop_all status logs stream_logs fix_hibachi help prod_funding_arb dev_funding_arb prod_bb_lighter
# Development command - run locally with gunicorn
dev:
./env/bin/gunicorn --bind 0.0.0.0:8001 --workers 1 --threads 4 --worker-class gthread --worker-connections 1000 --timeout 30 --keep-alive 2 main:application
# Start local development with docker compose
start_local:
docker compose --env-file .env.${EXCHANGE} --project-name tiny-hft-${EXCHANGE} up --build
# Start production with docker compose
start:
docker compose --env-file .env.${EXCHANGE} --project-name tiny-hft-${EXCHANGE} up --build -d
# Stop specific exchange
stop:
docker compose --project-name tiny-hft-${EXCHANGE} down
# Stop all exchanges
stop_all:
docker compose --project-name tiny-hft-extended down
docker compose --project-name tiny-hft-hibachi down
# Stream logs from production server
stream_logs:
ssh vivek@157.230.41.66 "docker logs -f tiny-hft-sma-crossover"
# Check status of all running containers
status:
@echo "Running containers:"
@docker ps --filter "name=tiny-hft" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
# Stream logs for specific exchange
logs:
docker logs -f tiny-hft-${EXCHANGE}-sma-crossover
dev_funding_arb:
./env/bin/gunicorn --bind 0.0.0.0:8001 --workers 1 --threads 4 --worker-class sync strategies.funding_arb:app --reload
prod_funding_arb:
ssh vivek@157.230.41.66 "cd tiny-mute/ && git pull && docker compose -f ./docker-compose.funding-arb.yml up --build -d"
dev_funding_arb_bot:
python3 -m strategies.funding_arb
prod_funding_arb_bot:
ssh vivek@157.230.41.66 "cd tiny-mute/ && git pull && docker compose -f ./docker-compose.funding-arb-bot.yml up --build -d"
prod_bb_lighter:
ssh vivek@157.230.41.66 "cd tiny-mute/ && git pull && docker compose -f ./docker-compose.bb_lighter.yml up -d --build"
# Apply hibachi_xyz compatibility fix for websockets 12.0
fix_hibachi:
@echo "Applying hibachi_xyz compatibility fix..."
@echo "Note: This fix is already applied. The diff file shows the changes made."
@echo "Files modified:"
@echo " - env/lib/python3.13/site-packages/hibachi_xyz/helpers.py"
@echo " - env/lib/python3.13/site-packages/hibachi_xyz/api_ws_trade.py"
@echo "See diff/hibachi_xyz_compatibility_fix.diff for details."
# Show help
help:
@echo "Available commands:"
@echo " dev - Run app locally with gunicorn"
@echo " start_local - Start local development with docker compose"
@echo " start - Start production with docker compose (requires EXCHANGE)"
@echo " stop - Stop docker compose services"
@echo " stop_exchange - Stop specific exchange (requires EXCHANGE)"
@echo " stop_all - Stop all exchanges"
@echo " status - Check status of all running containers"
@echo " logs - Stream logs for specific exchange (requires EXCHANGE)"
@echo " stream_logs - Stream logs from production server"
@echo " dev_funding_arb - Run funding arbitrage dashboard locally"
@echo " prod_funding_arb - Deploy funding arbitrage to production server"
@echo " prod_bb_lighter - Deploy bb_lighter strategy to production server"
@echo " fix_hibachi - Apply hibachi_xyz compatibility fix for websockets 12.0"
@echo " help - Show this help message"
@echo ""
@echo "Examples:"
@echo " EXCHANGE=\"extended\" make start"
@echo " EXCHANGE=\"hibachi\" make start"
@echo " EXCHANGE=\"extended\" make logs"
@echo " make status"
@echo " make stop_all"