-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
174 lines (142 loc) · 4.76 KB
/
Makefile
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
# Makefile for Go project
# Variables
GO_CMD_W_CGO = CGO_ENABLED=1 GOOS=linux go
GO_CMD = CGO_ENABLED=0 GOOS=linux go
ifneq (,$(wildcard ./.env))
include .env
export
endif
# Build the Search API Go binary
.PHONY: build-search
build-search:
@echo "Building Search Go binary..."
$(GO_CMD) build -o search cmd/search/*.go
.PHONY: search-up
search-up:
@echo "Starting Search API..."
docker compose -f build/search/docker-compose.yml up --build -d
.PHONY: search-restart
search-restart:
@echo "Restarting Search API..."
docker compose -f build/search/docker-compose.yml restart -t 5
# Build the Sentiment Analysis Python Service
.PHONY: sentiment-up
sentiment-up:
@echo "Starting Sentiment Analysis API..."
docker compose -f build/sentiment/docker-compose.yml up --build -d
# Build the Sentiment Analysis Python Service with GPU Acceleration
.PHONY: sentiment-gpu-up
sentiment-gpu-up:
@echo "Starting Sentiment Analysis API with GPU Acceleration..."
docker compose -f build/sentiment/gpu.docker-compose.yml up --build -d
# Build the Object Detection Python Service
.PHONY: object-detection-up
object-detection-up:
@echo "Starting Object Detection API..."
docker compose -f build/object-detection/docker-compose.yml up --build -d
# Build the Object Detection Python Service with GPU Acceleration
.PHONY: object-detection-gpu-up
object-detection-gpu-up:
@echo "Starting Object Detection API with GPU Acceleration..."
docker compose -f build/object-detection/gpu.docker-compose.yml up --build -d
# Build the Translation Python Service
.PHONY: translation-up
translation-up:
@echo "Starting Translation API..."
docker compose -f build/translation/docker-compose.yml up --build -d
# Build the Translation Analysis Python Service with GPU Acceleration
.PHONY: translation-gpu-up
translation-gpu-up:
@echo "Starting Translation API with GPU Acceleration..."
docker compose -f build/translation/gpu.docker-compose.yml up --build -d
# Build the Indexer Go binary
.PHONY: build-indexer
build-indexer:
@echo "Building Indexer Go binary..."
$(GO_CMD_W_CGO) build -o indexer cmd/indexer/*.go
.PHONY: indexer-up
indexer-up:
@echo "Starting Indexer..."
docker compose -f build/indexer/docker-compose.yml up --build -d
# Build the Feedgen Go binary
.PHONY: build-feedgen-go
build-feedgen-go:
@echo "Building Feed Generator Go binary..."
$(GO_CMD_W_CGO) build -o feedgen cmd/feed-generator/*.go
.PHONY: feedgen-go-up
feedgen-go-up:
@echo "Starting Go Feed Generator..."
docker compose -f build/feedgen-go/docker-compose.yml up --build -d
# Start up the Redis Store
.PHONY: redis-up
redis-up:
@echo "Starting Redis..."
docker compose -f build/redis/docker-compose.yml up -d
# Stop the Redis Store
.PHONY: redis-down
redis-down:
@echo "Stopping Redis..."
docker compose -f build/redis/docker-compose.yml down
# Build the Consumer
.PHONY: build-consumer
build-consumer:
@echo "Building Consumer Go binary..."
$(GO_CMD_W_CGO) build -o consumer cmd/consumer/*.go
.PHONY: consumer-up
consumer-up:
@echo "Starting Consumer..."
docker compose -f build/consumer/docker-compose.yml up --build -d
# Build Jazbot
.PHONY: build-jazbot
build-jazbot:
@echo "Building Jazbot Go binary..."
$(GO_CMD_W_CGO) build -o jazbot cmd/jazbot/*.go
.PHONY: jazbot-up
jazbot-up:
@echo "Starting Jazbot..."
docker compose -f build/jazbot/docker-compose.yml up --build -d
# Generate SQLC Code
.PHONY: sqlc
sqlc:
@echo "Generating SQLC code for store..."
sqlc generate -f pkg/consumer/store/sqlc.yaml
.PHONY: empty-plc
empty-plc:
@echo "Emptying PLC Mirror in Redis..."
redis-cli --scan --pattern "plc_directory:*" | xargs -L 100 redis-cli DEL
.PHONY: empty-fanout
empty-fanout:
@echo "Emptying Fanout keys in Redis..."
redis-cli --scan --pattern "cg:*" | xargs -L 1000 redis-cli DEL
.PHONY: build-graphd
build-graphd:
@echo "Building GraphD..."
$(GO_CMD_W_CGO) build -v -o graphd cmd/graphd/*.go
.PHONY: graphd-up
graphd-up: # Runs graphd docker container
@echo "Starting GraphD..."
docker compose -f build/graphd/docker-compose.yml up --build -d
.PHONY: graphd-down
graphd-down: # Stops graphd docker container
@echo "Stopping GraphD..."
docker compose -f build/graphd/docker-compose.yml down
.PHONY: rgraphd-up
rgraphd-up: # Runs rgraphd docker container
@echo "Starting rGraphD..."
docker compose -f build/rgraphd/docker-compose.yml up --build -d
.PHONY: rgraphd-down
rgraphd-down: # Stops rgraphd docker container
@echo "Stopping rGraphD..."
docker compose -f build/rgraphd/docker-compose.yml down
# Build Pagerank
.PHONY: pagerank-up
pagerank-up:
@echo "Starting Pagerank..."
docker compose -f build/pagerank/docker-compose.yml up --build -d
.PHONY: pagerank-down
pagerank-down:
@echo "Stopping Pagerank..."
docker compose -f build/pagerank/docker-compose.yml down
.PHONY: skypub
skypub: .env
go run cmd/skypub/main.go