-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (44 loc) · 1.61 KB
/
Copy pathMakefile
File metadata and controls
62 lines (44 loc) · 1.61 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
# Legate Agent — developer task runner.
# These targets assume a POSIX shell (Linux/macOS or WSL/Git Bash on Windows).
API_DIR := apps/api
WEB_DIR := apps/web
.PHONY: help install install-api install-web up down logs migrate \
test test-api lint lint-api format format-api typecheck
help:
@echo "Targets:"
@echo " install Install backend + frontend dependencies"
@echo " up docker compose up (all services)"
@echo " down docker compose down"
@echo " migrate Run Alembic migrations inside the api container"
@echo " test Run the full backend test suite"
@echo " lint Run ruff + mypy (backend) and eslint (frontend)"
@echo " format Run black (backend) and prettier (frontend)"
install: install-api install-web
install-api:
cd $(API_DIR) && python -m pip install -e ".[dev]"
install-web:
cd $(WEB_DIR) && npm install
up:
docker compose up --build
down:
docker compose down
logs:
docker compose logs -f
migrate:
cd $(API_DIR) && alembic upgrade head
backup:
@echo "Backing up PostgreSQL + object storage (see docs/backup.md)."
pg_dump "$(DATABASE_URL)" -Fc -f legate-backup-$$(date +%F).dump
tar czf legate-storage-$$(date +%F).tgz $(API_DIR)/data/storage 2>/dev/null || true
@echo "Remember: back up LEGATE_MASTER_KEY separately — it is not in the database."
test: test-api
test-api:
cd $(API_DIR) && python -m pytest -q
lint: lint-api
lint-api:
cd $(API_DIR) && ruff check legate tests && mypy legate
format: format-api
format-api:
cd $(API_DIR) && black legate tests && ruff check --fix legate tests
typecheck:
cd $(API_DIR) && mypy legate