-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (56 loc) · 2.28 KB
/
Makefile
File metadata and controls
70 lines (56 loc) · 2.28 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
# =============================================================================
# python — Astronomical Transient Triage
# =============================================================================
SHELL := /bin/sh
COMPOSE ?= docker compose
ENV_FILE ?= .env
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_%-]+:.*?## / {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
$(ENV_FILE):
@cp .env.example $(ENV_FILE)
@echo "Created $(ENV_FILE) from .env.example — edit as desired."
.PHONY: build
build: $(ENV_FILE) ## Build images (proves @latest install)
$(COMPOSE) --env-file $(ENV_FILE) build
.PHONY: up
up: $(ENV_FILE) ## Bring up ollama + runtime + alert-source + client
$(COMPOSE) --env-file $(ENV_FILE) up --build --abort-on-container-exit --remove-orphans
.PHONY: up-detached
up-detached: $(ENV_FILE) ## Bring up in the background
$(COMPOSE) --env-file $(ENV_FILE) up -d --build
.PHONY: down
down: ## Stop and remove containers
$(COMPOSE) --env-file $(ENV_FILE) down --remove-orphans
.PHONY: logs
logs: ## Tail logs from all services
$(COMPOSE) --env-file $(ENV_FILE) logs -f --tail=200
.PHONY: replay
replay: $(ENV_FILE) ## Re-run just the alert-source against an already-running runtime
$(COMPOSE) --env-file $(ENV_FILE) run --rm alert-source
.PHONY: watch
watch: $(ENV_FILE) ## Tail night_reports as new artifacts land
@mkdir -p night_reports
@echo "Watching ./night_reports/ — Ctrl-C to stop"
@if command -v fswatch >/dev/null 2>&1; then \
fswatch -r night_reports; \
else \
while true; do clear; ls -lR night_reports || true; sleep 2; done; \
fi
.PHONY: shell
shell: ## Shell into the client container
$(COMPOSE) --env-file $(ENV_FILE) run --rm --entrypoint /bin/sh arcp-client
.PHONY: test
test: ## Run the offline pytest smoke suite
pytest tests/ -q
.PHONY: verify
verify: ## docker build only — proves @latest install resolves cleanly
docker build --build-arg ARCP_SDK_VERSION=$${ARCP_SDK_VERSION:-latest} -t arcp-sdk-examples/python-verify:test .
.PHONY: clean
clean: down ## Remove built images
-docker rmi \
arcp-sdk-examples/python-runtime:dev \
arcp-sdk-examples/python-alert-source:dev \
arcp-sdk-examples/python-client:dev \
arcp-sdk-examples/python-verify:test 2>/dev/null || true