-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
152 lines (122 loc) · 5.56 KB
/
Copy pathMakefile
File metadata and controls
152 lines (122 loc) · 5.56 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.PHONY: build test lint clean docker help install deps integration-test test-unit test-scripts test-integration test-e2e test-all fmt vet check build-agent-musl build-agent-all docker-mgmt docker-agent docker-push
# Docker image tags
# Internal base image. Versioned tag is what downstream Dockerfile FROMs
# consume; `:latest` is kept as a developer-convenience alias only. Per
# issue #262, no `:latest` in FROM lines anywhere in the repo.
BASE_VERSION := v2026.5.17
BASE_IMAGE := agentic-sandbox-base:$(BASE_VERSION)
BASE_IMAGE_LATEST := agentic-sandbox-base:latest
TEST_IMAGE := agentic-sandbox-test:latest
REGISTRY ?= registry.example.invalid
MGMT_IMAGE := $(REGISTRY)/agentic-sandbox/agentic-mgmt
AGENT_IMAGE := $(REGISTRY)/agentic-sandbox/agent-client
IMAGE_TAG ?= latest
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# Build targets
build: ## Build Rust components (management server, agent client, CLI)
@echo "Building Rust components..."
@$(MAKE) -s build-management
@$(MAKE) -s build-agent
@$(MAKE) -s build-cli
build-management: ## Build Rust management server
@echo "Building management server..."
@cd management && cargo build --release
build-agent: ## Build Rust agent client (glibc - for Ubuntu)
@echo "Building agent client (glibc)..."
@cd agent-rs && cargo build --release
build-agent-musl: ## Build agent client (musl/static - for Alpine)
@echo "Building agent client (musl/static)..."
@cd agent-rs && cargo build --release --target x86_64-unknown-linux-musl --no-default-features
build-agent-all: build-agent build-agent-musl ## Build both agent variants (glibc + musl)
build-cli: ## Build Rust CLI
@echo "Building CLI..."
@cd cli && cargo build --release
# Test targets
test: test-unit ## Run unit tests (default)
test-unit: ## Run Rust unit tests (workspace-wide for management)
@echo "Running Rust unit tests..."
@cd management && cargo test --workspace
@cd agent-rs && cargo test
@cd cli && cargo test
test-scripts: ## Run lightweight script regression tests
@echo "Running script regression tests..."
@./tests/package/test-package-macos.sh
@./tests/package/test-macos-release-recovery.sh
@./scripts/test-benchmark-terminal-transports.sh
@./images/qemu/tests/test-vsock-cidr-lifecycle.sh
@./images/qemu/tests/test-cloud-hypervisor-backend.sh
@./images/qemu/tests/test-ch-faststart.sh
@./images/qemu/tests/test-libvirt-checkpoint.sh
@python3 ./images/qemu/tests/test-ch-fork-memory-probe.py
@./scripts/test-reap-e2e-vms-cloud-hypervisor.sh
@./scripts/test-vfio-gpu-runner-guard.sh
@./images/qemu/tests/test-agent-client-path-parity.sh
@./images/qemu/tests/test-build-base-image-automation.sh
@./tests/container/test-multiarch-build-contract.sh
@./tests/container/test-macos-validation-contract.sh
@./tests/container/test-macos-release-ceremony-contract.sh
@./tests/container/test-debian-apt-https.sh
# E2E tests
test-e2e: ## Run E2E integration tests (management server + agents)
@echo "Running E2E integration tests..."
./scripts/run-e2e-tests.sh
test-all: test-unit test-e2e ## Run all tests
@echo "All tests completed"
# Lint/format targets
fmt: ## Format Rust code
@echo "Formatting Rust code..."
@cd management && cargo fmt
@cd agent-rs && cargo fmt
@cd cli && cargo fmt
lint: ## Check Rust formatting
@echo "Checking Rust formatting..."
@cd management && cargo fmt -- --check
@cd agent-rs && cargo fmt -- --check
@cd cli && cargo fmt -- --check
# Docker targets
docker: docker-base docker-test ## Build all Docker images
docker-base: ## Build base Docker image (versioned + :latest alias)
@echo "Building base Docker image $(BASE_IMAGE)..."
docker build -t $(BASE_IMAGE) -t $(BASE_IMAGE_LATEST) images/base/
docker-test: ## Build test Docker image
@echo "Building test Docker image..."
docker build -t $(TEST_IMAGE) images/test/
docker-mgmt: ## Build management server image
@echo "Building management server image..."
docker build -t $(MGMT_IMAGE):$(IMAGE_TAG) -f deploy/docker/Dockerfile.management .
docker-agent: ## Build agent client image
@echo "Building agent client image..."
docker build -t $(AGENT_IMAGE):$(IMAGE_TAG) -f deploy/docker/Dockerfile.agent-rust .
docker-push: docker-mgmt docker-agent ## Build and push production images to registry
@echo "Pushing to $(REGISTRY)..."
docker push $(MGMT_IMAGE):$(IMAGE_TAG)
docker push $(AGENT_IMAGE):$(IMAGE_TAG)
docker-clean: ## Remove Docker images
@echo "Removing Docker images..."
docker rmi -f $(BASE_IMAGE) $(BASE_IMAGE_LATEST) $(TEST_IMAGE) $(MGMT_IMAGE):$(IMAGE_TAG) $(AGENT_IMAGE):$(IMAGE_TAG) 2>/dev/null || true
# Development environment
dev-setup: ## Set up development environment
@echo "Setting up development environment..."
./scripts/dev-setup.sh
dev-up: ## Start development environment
@echo "Starting development environment..."
docker-compose -f docker-compose.dev.yaml up -d
dev-down: ## Stop development environment
@echo "Stopping development environment..."
docker-compose -f docker-compose.dev.yaml down
dev-logs: ## View development environment logs
docker-compose -f docker-compose.dev.yaml logs -f
# Clean targets
clean: ## Remove build artifacts
@echo "Cleaning build artifacts..."
@cd management && cargo clean
@cd agent-rs && cargo clean
@cd cli && cargo clean
clean-all: clean docker-clean ## Remove all build artifacts and Docker images
# Quick checks before commit
check: lint test-unit test-scripts ## Run all checks (format check + tests)
.DEFAULT_GOAL := help