-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.windows
286 lines (239 loc) · 11.2 KB
/
Makefile.windows
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
SHELL=cmd.exe
AUTH_BINARY = authApp
SEARCH_BINARY = searchApp
ML_GATEWAY_BINARY = mlGateWayApp
DATA_BINARY = dataApp
## install_all_dependencies : installs all the dependencies for all the services
install_all_dependencies:
@echo "Installing all dependencies..."
cd auth-service && go mod tidy
cd search-esdb-service && go mod tidy
cd data-management-service && go mod tidy
cd ml-gateway-service && go mod tidy
cd frontend && yarn install
@echo "Done!"
## install_auth_dependencies : installs all the dependencies for auth service
install_auth_dependencies:
@echo "Installing auth service dependencies..."
cd auth-service && go mod tidy
@echo "Done!"
## install_search_dependencies : installs all the dependencies for search service
install_search_dependencies:
@echo "Installing search service dependencies..."
cd search-esdb-service && go mod tidy
@echo "Done!"
## install_ml_gateway_dependencies : installs all the dependencies for ml-gateway service
install_ml_gateway_dependencies:
@echo "Installing ml-gateway service dependencies..."
cd ml-gateway-service && go mod tidy
@echo "Done!"
## install_data_dependencies : installs all the dependencies for data service
install_data_dependencies:
@echo "Installing data service dependencies..."
cd data-management-service && go mod tidy
@echo "Done!"
## install_frontend_dependencies : installs all the dependencies for frontend service
install_frontend_dependencies:
@echo "Installing frontend service dependencies..."
cd frontend && yarn install
@echo "Done!"
## install backend dependencies for all services
install_backend_dependencies: install_auth_dependencies install_search_dependencies install_ml_gateway_dependencies install_data_dependencies
## up: starts all containers in the background without forcing build
up:
@echo "Starting Docker images..."
docker compose -f docker-compose.dev.yml up -d
@echo "Docker images started!"
## up_build: stops docker compose (if running), builds all projects and starts docker compose
up_build: build_auth build_search build_data build_frontend build_ml_gateway
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d auth-service search-service data-service ml-gateway-service frontend nginx rabbitmq
@echo "Docker images built and started!"
up_build_full_service: build_auth build_search build_data build_frontend build_ml_gateway
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d auth-service search-service data-service ml-gateway-service frontend nginx rabbitmq loki promtail grafana prometheus
@echo "Docker images built and started!"
up_build_backend: build_auth build_search build_data build_ml_gateway
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d auth-service search-service ml-gateway-service data-service rabbitmq
@echo "Docker images built and started!"
####### AUTH SERVICE #######
## up_build_auth: stops docker compose (if running), builds projects and starts docker compose
up_build_auth: build_auth
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down auth-service
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d auth-service
@echo "Docker images built and started!"
## build_auth: builds the auth binary as a linux executable
build_auth:
@echo "Building auth binary..."
cd auth-service && set GOOS=linux&& set GOARCH=amd64&& set CGO_ENABLED=0 && go build -o ${AUTH_BINARY} .
@echo "Done!"
## down_auth: stops the auth service
down_auth:
@echo "Stopping auth service..."
docker compose -f docker-compose.dev.yml down auth-service
@echo "Auth service stopped!"
## up_dev_auth: stops db container and rebuild and start go server
up_dev_auth:
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down auth-db
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d auth-db
@echo "Docker images built and started!"
cd auth-service && go run main.go
@echo "Auth service development server started!"
#################################
###### Search Service ######
## up_build_search: stops docker compose (if running), builds projects and starts docker compose
up_build_search: build_search
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down search-service
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d search-service
@echo "Docker images built and started!"
## build_search: builds the search binary as a linux executable
build_search:
@echo "Building search binary..."
cd search-esdb-service && set GOOS=linux&& set GOARCH=amd64&& set CGO_ENABLED=0 && go build -o ${SEARCH_BINARY} .
@echo "Done!"
## down_search: stops the search service
down_search:
@echo "Stopping search service..."
docker compose -f docker-compose.dev.yml down search-service
@echo "Search service stopped!"
## search_dev_environments: start search service dependencies services
search_dev_environments:
@echo "Starting search service dependencies services..."
docker compose -f docker-compose.dev.yml up -d elastic-db rabbitmq ml-gateway-service
@echo "Search service dependencies services started!"
## empty_elastic: stops elastic-db (if running), remove volumes, starts elastic-db
## !!! BE CAREFUL WITH THIS COMMAND CUZ IT WILL REMOVE ALL THE EXISITING DATA!!!
empty_elastic:
@echo "Stopping elastic-db (if running...)"
docker compose -f docker-compose.dev.yml down elastic-db
@echo "Remove volumes..."
rm -rf ./volumes/database/elastic
@echo "starting elastic-db containers..."
docker compose -f docker-compose.dev.yml up --build -d elastic-db
@echo "elastic-db started!"
## up_dev_search: stops db container and rebuild and start go server
up_dev_search:
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down elastic-db
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d elastic-db rabbitmq ml-gateway-service
@echo "Docker images built and started!"
cd search-esdb-service && go run main.go
@echo "Search service development server started!"
#################################
##### ML Gateway Service #####
## up_build_ml_gateway: stops docker compose (if running), builds projects and starts docker compose
up_build_ml_gateway: build_ml_gateway
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down ml-gateway-service
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d ml-gateway-service
@echo "Docker images built and started!"
## down_ml_gateway: stops the ml-gateway service
down_ml_gateway:
@echo "Stopping ml-gateway service..."
docker compose -f docker-compose.dev.yml down ml-gateway-service
@echo "ML Gateway service stopped!"
## build_ml_gateway: builds the ml-gateway binary as a linux executable
build_ml_gateway:
@echo "Building ml-gateway binary..."
cd ml-gateway-service && set GOOS=linux&& set GOARCH=amd64&& set CGO_ENABLED=0 && go build -o ${ML_GATEWAY_BINARY} .
@echo "Done!"
#################################
###### Data Management Service ######
## up_build_data: stops docker compose (if running), builds projects and starts docker compose
up_build_data: build_data
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down data-service
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d data-service
@echo "Docker images built and started!"
## build_data: builds the data binary as a linux executable
build_data:
@echo "Building data binary..."
cd data-management-service && set GOOS=linux&& set GOARCH=amd64&& set CGO_ENABLED=0 && go build -o ${DATA_BINARY} .
@echo "Done!"
## down_data: stops the data service
down_data:
@echo "Stopping data service..."
docker compose -f docker-compose.dev.yml down data-service
@echo "Data service stopped!"
## empty_data_db: stops data-db (if running), removes volumes and starts data-db
## !!! BE CAREFUL WITH THIS COMMAND CUZ IT WILL REMOVE ALL THE EXISITING DATA!!!
empty_data_db:
@echo "Stopping data-db (if running...)"
docker compose -f docker-compose.dev.yml down data-db
@echo "Remove volumes..."
rm -rf ./volumes/database/mongo-data
@echo "starting data-db containers..."
docker compose -f docker-compose.dev.yml up --build -d data-db
@echo "Data-db started!"
## up_dev_data: stops db container and rebuild and start go server
up_dev_data:
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down data-db
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d data-db
@echo "Docker images built and started!"
cd data-management-service && go run main.go
@echo "Data service development server started!"
#################################
##### Frontend Service #####
## up_build_frontend: stops docker compose (if running), builds projects and starts docker compose
up_build_frontend: build_frontend
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down frontend
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d frontend
@echo "Docker images built and started!"
## down_frontend: stops the frontend service
down_frontend:
@echo "Stopping frontend service..."
docker compose -f docker-compose.dev.yml down frontend
@echo "Frontend service stopped!"
## build_frontend: builds the frontend binary as a linux executable
build_frontend:
@echo "Building frontend binary..."
cd frontend && yarn build
@echo "Done!"
#################################
###### Nginx Service ######
## up_build_nginx: stops docker compose (if running), builds projects and starts docker compose
up_build_nginx:
@echo "Stopping docker images (if running...)"
docker compose -f docker-compose.dev.yml down nginx
@echo "Building (when required) and starting docker images..."
docker compose -f docker-compose.dev.yml up --build -d nginx
@echo "Docker images built and started!"
## down_nginx : stops the nginx service
down_nginx:
@echo "Stopping nginx service..."
docker compose -f docker-compose.dev.yml down nginx
@echo "Nginx service stopped!"
## down: stops all containers
down:
@echo "Stopping Docker images..."
docker compose -f docker-compose.dev.yml down
@echo "Docker images stopped!"
## monitoring service
up_monitoring:
@echo "Starting monitoring service..."
docker compose -f docker-compose.dev.yml up -d loki promtail grafana prometheus
@echo "Monitoring service started!"
down_monitoring:
@echo "Stopping monitoring service..."
docker compose -f docker-compose.dev.yml down loki promtail grafana prometheus
@echo "Monitoring service stopped!"