-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (92 loc) · 3.33 KB
/
Makefile
File metadata and controls
116 lines (92 loc) · 3.33 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
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
.PHONY: all build install install-cli install-tui test test-fast test-compile lint lint-install clean kill-daemons update e2e-local-host-worker e2e-remote-smoke e2e-backend-smoke e2e-pr-ci e2e-target-host-worker e2e-target-host-worker-local e2e-zeus-full-flow e2e-run-control-local e2e-run-control-zeus e2e-run-control-matrix
.DEFAULT_GOAL := install
BINARY_NAME := orch
INSTALL_DIR := $(HOME)/.local/bin
UNAME_S := $(shell uname -s)
TEST_PKGS ?= ./...
TEST_TIMEOUT ?= 20m
TEST_GOGC ?= 50
TEST_GOMEMLIMIT ?= 2GiB
TEST_MAX_FD ?= 256
TEST_RUN ?= .
TEST_LOCK_DIR ?= /tmp/orch-go-test.lock
all: install
# Build Go binary
build:
go build -o $(BINARY_NAME) ./cmd/orch
# Install Go CLI + daemon
install-cli: build
mkdir -p $(INSTALL_DIR)
cp $(BINARY_NAME) $(INSTALL_DIR)/$(BINARY_NAME)
ifneq ($(UNAME_S),)
@if [ "$(UNAME_S)" = "Darwin" ]; then \
codesign --force --sign - "$(INSTALL_DIR)/$(BINARY_NAME)"; \
fi
endif
# Install Python TUI
install-tui:
uv tool install --force --reinstall ./orch-monitor-tui
# Install everything, then kill daemons (they restart on demand)
install: install-cli install-tui kill-daemons
# Kill all orch daemons and opencode servers (clean slate)
kill-daemons:
@echo "Killing all orch daemons and opencode servers..."
@pkill -9 -f "orch daemon" 2>/dev/null || true
@pkill -9 -f "opencode serve" 2>/dev/null || true
@sleep 1
@echo "Done. Daemons will restart automatically on next orch command."
# Pull from main and reinstall everything
update:
git pull origin main
$(MAKE) install
test:
@if ! mkdir $(TEST_LOCK_DIR) 2>/dev/null; then \
echo "another test run is active ($(TEST_LOCK_DIR))"; \
exit 1; \
fi; \
trap 'rmdir $(TEST_LOCK_DIR)' EXIT INT TERM; \
ulimit -n $(TEST_MAX_FD); \
ORCH_SAFE_CLI_TEST=1 GOGC=$(TEST_GOGC) GOMEMLIMIT=$(TEST_GOMEMLIMIT) go test -run '$(TEST_RUN)' -p 1 -parallel 1 -timeout $(TEST_TIMEOUT) $(TEST_PKGS)
test-fast:
@if ! mkdir $(TEST_LOCK_DIR) 2>/dev/null; then \
echo "another test run is active ($(TEST_LOCK_DIR))"; \
exit 1; \
fi; \
trap 'rmdir $(TEST_LOCK_DIR)' EXIT INT TERM; \
ORCH_SAFE_CLI_TEST=1 go test -p 1 -parallel 1 $(TEST_PKGS)
test-compile:
@if ! mkdir $(TEST_LOCK_DIR) 2>/dev/null; then \
echo "another test run is active ($(TEST_LOCK_DIR))"; \
exit 1; \
fi; \
trap 'rmdir $(TEST_LOCK_DIR)' EXIT INT TERM; \
ORCH_SAFE_CLI_TEST=1 GOGC=$(TEST_GOGC) GOMEMLIMIT=$(TEST_GOMEMLIMIT) go test -run '^$$' -p 1 -parallel 1 -timeout $(TEST_TIMEOUT) $(TEST_PKGS)
lint:
@command -v semgrep >/dev/null 2>&1 || uv tool install semgrep
semgrep --error --config .semgrep/ ./internal/cli/ ./internal/monitor/ ./internal/daemon/ --exclude='*_test.go'
lint-install:
uv tool install semgrep
uv tool install pre-commit
pre-commit install
clean:
rm -f $(BINARY_NAME)
e2e-local-host-worker:
./scripts/e2e-master-worker-client-local.sh
e2e-remote-smoke:
./scripts/e2e-master-worker-client-remote-smoke.sh
e2e-backend-smoke:
./scripts/e2e-backend-matrix-smoke.sh
e2e-pr-ci:
./scripts/e2e-pr-ci.sh
e2e-target-host-worker:
./scripts/e2e-master-worker-client-target.sh
e2e-target-host-worker-local:
./scripts/e2e-master-worker-client-target-local.sh
e2e-zeus-full-flow:
./scripts/e2e-master-worker-client-zeus.sh
e2e-run-control-local:
./scripts/e2e-run-control-local.sh
e2e-run-control-zeus:
./scripts/e2e-run-control-zeus.sh
e2e-run-control-matrix:
./scripts/e2e-run-control-matrix.sh