-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathMakefile.docker
More file actions
143 lines (117 loc) · 3.93 KB
/
Makefile.docker
File metadata and controls
143 lines (117 loc) · 3.93 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
# Docker-based Makefile for StarRocks
# Usage: make -f Makefile.docker <target>
.PHONY: help shell build-fe build-be build-all clean-build test-fe test-be test-all clean docker-pull
# Configuration
DOCKER_IMAGE ?= starrocks/dev-env-ubuntu:latest
DOCKER_BUILD_SCRIPT = ./build-in-docker.sh
DOCKER_DEV_SCRIPT = ./docker-dev.sh
# Default target
help:
@echo "Docker-based build targets for StarRocks"
@echo ""
@echo "Development:"
@echo " shell Open interactive development shell"
@echo " docker-pull Pull the latest Docker image"
@echo ""
@echo "Building:"
@echo " build-fe Build Frontend only"
@echo " build-be Build Backend only"
@echo " build-all Build both Frontend and Backend"
@echo " clean-build Clean and build everything"
@echo ""
@echo "Testing:"
@echo " test-fe Run Frontend tests"
@echo " test-be Run Backend tests"
@echo " test-all Run all tests"
@echo ""
@echo "Maintenance:"
@echo " clean Clean build artifacts"
@echo " docker-clean Clean Docker containers and volumes"
@echo ""
@echo "Environment Variables:"
@echo " DOCKER_IMAGE Docker image to use (default: $(DOCKER_IMAGE))"
@echo ""
@echo "Examples:"
@echo " make -f Makefile.docker shell"
@echo " make -f Makefile.docker build-fe"
@echo " make -f Makefile.docker DOCKER_IMAGE=starrocks/dev-env-ubuntu:latest build-all"
# Development targets
shell:
@echo "Opening development shell..."
$(DOCKER_DEV_SCRIPT) shell
docker-pull:
@echo "Pulling Docker image: $(DOCKER_IMAGE)"
docker pull $(DOCKER_IMAGE)
# Build targets
build-fe:
@echo "Building Frontend..."
$(DOCKER_DEV_SCRIPT) build-fe
build-be:
@echo "Building Backend..."
$(DOCKER_DEV_SCRIPT) build-be
build-all:
@echo "Building all components..."
$(DOCKER_DEV_SCRIPT) build-all
clean-build:
@echo "Clean building all components..."
$(DOCKER_DEV_SCRIPT) clean-build
# Test targets
test-fe:
@echo "Running Frontend tests..."
$(DOCKER_DEV_SCRIPT) test-fe
test-be:
@echo "Running Backend tests..."
$(DOCKER_DEV_SCRIPT) test-be
test-all:
@echo "Running all tests..."
$(DOCKER_DEV_SCRIPT) test-all
# Maintenance targets
clean:
@echo "Cleaning build artifacts..."
rm -rf output/
rm -rf fe/fe-core/target/
rm -rf java-extensions/*/target/
docker-clean:
@echo "Cleaning Docker containers and volumes..."
docker-compose -f docker-compose.dev.yml down -v --remove-orphans || true
docker container prune -f
docker volume prune -f
# Advanced build targets with specific options
build-fe-debug:
@echo "Building Frontend in debug mode..."
BUILD_TYPE=Debug $(DOCKER_BUILD_SCRIPT) --fe
build-be-debug:
@echo "Building Backend in debug mode..."
BUILD_TYPE=Debug $(DOCKER_BUILD_SCRIPT) --be
build-be-asan:
@echo "Building Backend with AddressSanitizer..."
BUILD_TYPE=Asan $(DOCKER_BUILD_SCRIPT) --be
build-be-gcov:
@echo "Building Backend with code coverage..."
$(DOCKER_BUILD_SCRIPT) --be --with-gcov
# Parallel build targets
build-fe-fast:
@echo "Building Frontend with maximum parallelism..."
$(DOCKER_BUILD_SCRIPT) --fe -j $$(nproc)
build-be-fast:
@echo "Building Backend with maximum parallelism..."
$(DOCKER_BUILD_SCRIPT) --be -j $$(nproc)
build-all-fast:
@echo "Building all components with maximum parallelism..."
$(DOCKER_BUILD_SCRIPT) --fe --be -j $$(nproc)
# Docker Compose targets
compose-shell:
@echo "Starting development shell with Docker Compose..."
docker-compose -f docker-compose.dev.yml run --rm starrocks-dev
compose-build-fe:
@echo "Building Frontend with Docker Compose..."
docker-compose -f docker-compose.dev.yml run --rm build-fe
compose-build-be:
@echo "Building Backend with Docker Compose..."
docker-compose -f docker-compose.dev.yml run --rm build-be
compose-test-fe:
@echo "Running Frontend tests with Docker Compose..."
docker-compose -f docker-compose.dev.yml run --rm test-fe
compose-test-be:
@echo "Running Backend tests with Docker Compose..."
docker-compose -f docker-compose.dev.yml run --rm test-be