forked from gradium-ai/gradbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (28 loc) · 1.02 KB
/
Copy pathMakefile
File metadata and controls
33 lines (28 loc) · 1.02 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
DEMOS := business_bank fantasy_shop hotel restaurant_ordering \
simple_chat npc_3d_game
MATURIN := uv tool run maturin
MANIFEST := -m gradbot_py/Cargo.toml
WHEEL_DIR := /tmp/gradbot_wheel
# Build and install gradbot_py into a specific demo's venv
# Usage: make build DEMO=npc_3d_game
build:
ifndef DEMO
$(error DEMO is required. Usage: make build DEMO=npc_3d_game)
endif
@rm -rf $(WHEEL_DIR)
$(MATURIN) build $(MANIFEST) -o $(WHEEL_DIR)
demos/$(DEMO)/.venv/bin/python3 -m pip install $(WHEEL_DIR)/gradbot-*.whl --force-reinstall --no-deps
# Build and install into all demo venvs
build-all:
@rm -rf $(WHEEL_DIR)
$(MATURIN) build $(MANIFEST) -o $(WHEEL_DIR)
@for demo in $(DEMOS); do \
echo "==> Installing for $$demo"; \
demos/$$demo/.venv/bin/pip install $(WHEEL_DIR)/gradbot-*.whl --force-reinstall --no-deps || exit 1; \
done
# Run a demo with uvicorn
# Usage: make run DEMO=npc_3d_game [PORT=8000]
PORT ?= 8000
run: build
cd demos/$(DEMO) && .venv/bin/uvicorn main:app --port $(PORT)
.PHONY: build build-all run