-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (52 loc) · 2.27 KB
/
Makefile
File metadata and controls
64 lines (52 loc) · 2.27 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
.PHONY: setup dev api web notebook test clean docker-build docker-run docker-compose
# Setup everything
setup:
python3 -m venv .venv
. .venv/bin/activate && pip install --upgrade pip setuptools wheel
. .venv/bin/activate && pip install -e "creatures-core[dev]"
. .venv/bin/activate && pip install fastapi "uvicorn[standard]" websockets msgpack httpx
. .venv/bin/activate && pip install flygym opencv-python-headless numba dm-env protobuf pyarrow
@# mlx is Apple Silicon only — skip gracefully on other platforms
. .venv/bin/activate && pip install mlx mlx-metal 2>/dev/null || echo "Skipping mlx (Apple Silicon only)"
@# brian2genn is optional GPU acceleration — skip if unavailable
. .venv/bin/activate && pip install brian2genn 2>/dev/null || echo "Skipping brian2genn (optional GPU backend)"
cd creatures-web && npm install
@echo "\n=== Setup complete! Run 'make dev' to start. ==="
# Start both servers for development
dev:
@echo "Starting API on :8420 and frontend on :5173..."
@trap 'kill 0' EXIT; \
cd creatures-api && PYTHONPATH="../creatures-core:." ../.venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 8420 --reload & \
cd creatures-web && npm run dev & \
wait
# Start just the API
api:
cd creatures-api && PYTHONPATH="../creatures-core:." ../.venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 8420 --reload
# Start just the frontend
web:
cd creatures-web && npm run dev
# Open Jupyter notebooks
notebook:
. .venv/bin/activate && jupyter notebook notebooks/
# Run tests
test:
. .venv/bin/activate && python -m pytest creatures-core/tests/ -v
# Download all organism data
data:
. .venv/bin/activate && python3 -c "from creatures.connectome.openworm import load; print(load().summary())"
. .venv/bin/activate && python3 -c "from creatures.connectome.flywire import download_data; download_data()"
# Build frontend for production
build:
cd creatures-web && npm run build
# Docker
docker-build:
docker build -t neurevo .
docker-run:
docker run -p 8420:8420 --env-file .env neurevo
docker-compose:
docker compose up --build
# Clean build artifacts
clean:
rm -rf creatures-web/dist creatures-web/node_modules
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true