-
Notifications
You must be signed in to change notification settings - Fork 364
/
Makefile
137 lines (106 loc) · 2.82 KB
/
Makefile
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
.PHONY: dev
dev:
make -j 2 watch up
.PHONY: watch
watch:
@docker compose watch --no-up
.PHONY: up
up:
@docker compose up --build -d
.PHONY: down
down:
@docker compose down
.PHONY: run-unit-tests
run-unit-tests:
poetry run pytest src/backend/tests/unit --cov=src/backend --cov-report=xml
.PHONY: run-community-tests
run-community-tests:
poetry run pytest src/community/tests --cov=src/community --cov-report=xml
.PHONY: run-integration-tests
run-integration-tests:
docker compose run --build backend poetry run pytest -c src/backend/pytest_integration.ini src/backend/tests/integration/$(file)
run-tests: run-unit-tests
.PHONY: attach
attach:
@docker attach cohere-toolkit-backend-1
logs:
@@docker-compose logs --follow --tail 100 $(service)
.PHONY: exec-backend
exec-backend:
docker exec -ti cohere-toolkit-backend-1 bash
.PHONY: exec-db
exec-db:
docker exec -ti cohere-toolkit-db-1 bash
.PHONY: exec-terrarium
exec-terrarium:
docker exec -ti -u root cohere-toolkit-terrarium-1 /bin/sh
.PHONY: migration
migration:
docker compose run --build backend alembic -c src/backend/alembic.ini revision --autogenerate -m "$(message)"
.PHONY: migrate
migrate:
docker compose run --build backend alembic -c src/backend/alembic.ini upgrade head
.PHONY: downgrade
downgrade:
docker compose run --build backend alembic -c src/backend/alembic.ini downgrade -1
.PHONY: reset-db
reset-db:
docker compose down
docker volume rm cohere_toolkit_db
.PHONY: install
install:
poetry install --verbose --with dev
.PHONY: setup
setup:
poetry install --with setup,dev --verbose
poetry run python3 src/backend/cli/main.py
.PHONY: setup-use-community
setup-use-community:
poetry install --with setup,community --verbose
poetry run python3 src/backend/cli/main.py --use-community
.PHONY: win-setup
win-setup:
poetry install --with setup --verbose
poetry run python src/backend/cli/main.py
.PHONY: typecheck
typecheck:
poetry run pyright
.PHONY: lint
lint:
poetry run ruff check
.PHONY: lint-fix
lint-fix:
poetry run ruff check --fix
.PHONY: first-run
first-run:
make setup
make migrate
make dev
.PHONY: win-first-run
win-first-run:
make win-setup
make migrate
make dev
.PHONY: format-web
format-web:
cd src/interfaces/assistants_web && npm run format:write
.PHONY: generate-client-web
generate-client-web:
cd src/interfaces/assistants_web && npm run generate:client && npm run format:write
.PHONY: install-web
install-web:
cd src/interfaces/assistants_web && npm install
.PHONY: build-web
build-web:
cd src/interfaces/assistants_web && npm run build
.PHONY: test-db
test-db:
docker compose stop test_db
docker compose rm -f test_db
docker compose up test_db -d
.PHONY: dev-sync
dev-sync:
@docker compose up --build sync_worker sync_publisher flower -d
.PHONY: dev-sync-down
dev-sync-down:
@docker compose down sync_worker sync_publisher flower