-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
88 lines (74 loc) · 2.59 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
.PHONY: test lock lock-core lock-evaluators install install-core install-evaluators run-docker
test:
@for dir in evaluators/*; do \
if [ -d $$dir ]; then \
echo "Running tests in $$dir"; \
cd $$dir && poetry run pytest -s -vv && cd ../..; \
fi \
done
ensure-poetry:
@if ! command -v poetry &> /dev/null; then \
curl -sSL https://install.python-poetry.org | python3 -; \
fi
setup:
poetry run python scripts/generate_evaluator_dependencies.py
poetry run python scripts/generate_workspace.py
poetry run python scripts/generate_evaluators_ts.py
lock-core:
@echo "Locking dependencies for langevals_core..."
@cd langevals_core && poetry lock --no-update
lock-evaluators: lock-core install-core
@for dir in evaluators/*; do \
if [ -d $$dir ]; then \
echo "Locking in $$dir"; \
cd $$dir && poetry lock --no-update && cd ../..; \
fi \
done
install-core:
@echo "Installing dependencies for langevals_core..."
@cd langevals_core && poetry install
install-evaluators: install-core
@for dir in evaluators/*; do \
if [ -d $$dir ]; then \
echo "Installing in $$dir"; \
cd $$dir && poetry install && cd ../..; \
fi \
done
lock: ensure-poetry lock-core install-core lock-evaluators
@echo "All packages locked."
poetry lock --no-update
install: ensure-poetry install-core install-evaluators
@echo "All evaluator packages installed."
poetry install --all-extras
make setup && poetry lock --no-update && poetry install --all-extras
preload:
@echo "Preloading evaluators..."
poetry run python langevals/server.py --preload
start:
@echo "Starting the server..."
poetry run python langevals/server.py $(filter-out $@,$(MAKECMDGOALS))
run-docker:
@echo "Building and running the Docker container for the evaluator..."
@docker build --build-arg EVALUATOR=$(EVALUATOR) -t langevals-$(EVALUATOR) .
@docker run -p 80:80 langevals-$(EVALUATOR)
check-evaluator-versions:
@echo "Checking all evaluator versions for changes..."
@(cd langevals_core && ../scripts/check_version_bump.sh --bump; exit_status=$$?; \
if [ $$exit_status -eq 3 ]; then \
echo "[Auto Bump] Bumping poetry version"; \
poetry version patch; \
fi); \
for dir in evaluators/*; do \
if [ -d "$$dir" ]; then \
echo "Checking $$dir"; \
(cd "$$dir" && git add pyproject.toml && python ../../scripts/replace_develop_dependencies.py pyproject.toml && ../../scripts/check_version_bump.sh --bump; exit_status=$$?; git checkout pyproject.toml; \
if [ $$exit_status -eq 3 ]; then \
echo "[Auto Bump] Bumping poetry version"; \
poetry version patch; \
else \
exit $$exit_status; \
fi); \
fi \
done
%:
@: