-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (72 loc) · 2.14 KB
/
Copy pathMakefile
File metadata and controls
86 lines (72 loc) · 2.14 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
IMAGE_NAME ?= starshell
PORT ?= 8080
ENV_FILE ?= .env
PLATFORM ?= linux/amd64
NO_CACHE ?= 0
DOCKER_BUILD_FLAGS = --platform=$(PLATFORM)
ifeq ($(NO_CACHE),1)
DOCKER_BUILD_FLAGS += --no-cache
endif
GEMINI_MOUNT := $(if $(wildcard $(PWD)/gemini_service_account),-v $(PWD)/gemini_service_account:/app/gemini_service_account:ro)
DOCKER_RUN = docker run --rm -it \
--platform $(PLATFORM) \
-v $(PWD)/$(ENV_FILE):/app/.env:ro \
-v $(PWD)/data:/app/docs:ro \
-v $(PWD)/skills:/app/skills \
$(GEMINI_MOUNT)
.PHONY: build download-docs run-app run-cli run-eval run-viewer run-tests clean
build:
docker build $(DOCKER_BUILD_FLAGS) -t $(IMAGE_NAME) .
download-docs:
docker run --rm \
--platform $(PLATFORM) \
-v $(PWD)/$(ENV_FILE):/app/.env:ro \
-v $(PWD)/data:/app/docs \
$(IMAGE_NAME) \
uv run python scripts/download_docs.py
run-app: build
$(DOCKER_RUN) -p $(PORT):8080 $(IMAGE_NAME) \
uv run chainlit run app.py --host 0.0.0.0 --port 8080
@echo "Running at http://localhost:$(PORT)"
run-cli: build
$(DOCKER_RUN) $(IMAGE_NAME) \
uv run python cli.py
## Evaluation
AGENT ?= bash
DOMAIN ?= servicenow
MODEL ?=
TASK_NAME ?=
MAX_SAMPLES ?=
NO_DOCS ?= 0
NO_SKILLS ?= 0
EVAL_CMD = uv run python eval.py --agent $(AGENT) --domain $(DOMAIN)
ifneq ($(MODEL),)
EVAL_CMD += --model $(MODEL)
endif
ifneq ($(TASK_NAME),)
EVAL_CMD += --task-name $(TASK_NAME)
endif
ifneq ($(MAX_SAMPLES),)
EVAL_CMD += --max-samples $(MAX_SAMPLES)
endif
ifeq ($(NO_DOCS),1)
EVAL_CMD += --no-docs
endif
ifeq ($(NO_SKILLS),1)
EVAL_CMD += --no-skills
endif
run-eval: build
@echo "=== StarShell Eval ==="
@echo "Agent: $(AGENT) Domain: $(DOMAIN) Model: $(or $(MODEL),(default))"
@echo "======================"
$(DOCKER_RUN) -v $(PWD)/results:/app/results $(IMAGE_NAME) \
$(EVAL_CMD)
run-viewer: build
$(DOCKER_RUN) -v $(PWD)/results:/app/results:ro -p $(PORT):8080 $(IMAGE_NAME) \
uv run streamlit run viewer.py --server.port 8080 --server.address 0.0.0.0
run-tests: build
$(DOCKER_RUN) $(IMAGE_NAME) \
uv run pytest tests/ -v
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .chainlit_cache -exec rm -rf {} + 2>/dev/null || true