-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
251 lines (209 loc) · 9.1 KB
/
Makefile
File metadata and controls
251 lines (209 loc) · 9.1 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
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
include env
UNAME := $(shell uname)
GO_PATH := $(shell which go)
ifeq ($(UNAME), Linux)
NODE_BUILD_PATH = ${NODE_BUILD_PATH_LINUX}
CLIENT_BUILD_PATH = ${CLIENT_BUILD_PATH_LINUX}
SOURCE = .
endif
ifeq ($(UNAME), Darwin)
NODE_BUILD_PATH = ${NODE_BUILD_PATH_DARWIN}
CLIENT_BUILD_PATH = ${CLIENT_BUILD_PATH_DARWIN}
SOURCE = source
endif
ifeq ($(GO_PATH),)
GO_PATH = ${GO_REMOTE_PATH}
endif
.PHONY: help
## help: prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
.PHONY: tidy
## tidy: tidy up go modules
tidy:
@${GO_PATH} mod tidy
# helper rule for deployment
check-environment:
ifndef OPENSTACK_PASSWORD_INPUT
$(error environmet values not set)
endif
.PHONY: build
## build: build the node and the client
build: clean build-node build-client
.PHONY: build-node
## build-node: build the node component (OS-dependent)
build-node: check-environment
@echo "Building Node ..."
@${GO_PATH} build -o ${NODE_BUILD_PATH}${NODE_BINARY} ./cmd/node
.PHONY: build-client
## build-client: build the client component (OS-dependent)
build-client:check-environment
@echo "Building Client ..."
@${GO_PATH} build -o ${CLIENT_BUILD_PATH}${CLIENT_BINARY} ./cmd/client
.PHONY: build-remote-linux
## build-remote-linux: build for remote Linux on Darwin
build-remote-linux: check-environment
@echo "Building the components on the build remote system..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" ./scripts/build_on_linux.sh
.PHONY: build-local-linux
## build-local-linux: build for local Linux on Darwin
build-local-linux: check-environment
@echo "Building the components on the build local system..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="local" ./scripts/build_on_linux.sh
.PHONY: run-node
## run-node: run the node component
run-node: check-environment
@echo "Running Node ..."
@${GO_PATH} run ./cmd/node
Coordinator=false
Benchmark="0_sample"
.PHONY: run-client
## run-client: run the client component
run-client: check-environment
@echo "Running Client ..."
@${GO_PATH} run ./cmd/client -coordinator=${Coordinator} -benchmark=${Benchmark}
.PHONY: clean
## clean: clean for Darwin
clean: check-environment
@echo "Cleaning"
@${GO_PATH} clean
@rm -rf ${NODE_BUILD_PATH}
@rm -rf ${CLIENT_BUILD_PATH}
.PHONY: clean-all
## clean-all: clean everything
clean-all: check-environment
@echo "Cleaning"
@${GO_PATH} clean
@rm -rf ${NODE_BUILD_PATH_LINUX}
@rm -rf ${NODE_BUILD_PATH_DARWIN}
@rm -rf ${CLIENT_BUILD_PATH_LINUX}
@rm -rf ${CLIENT_BUILD_PATH_DARWIN}
.PHONY: git-commit
## git-commit: pull from main and push to main
git-commit:
@echo "Commit"
@git add . ; git commit -m 'auto push';
.PHONY: git-push
## git-push: push to main
git-push:
@echo "Pushing to git main"
@git add . ; git commit -m 'auto push'; \
git push origin main
.PHONY: git-pull
## git-pull: pull from main
git-pull:
@echo "Pulling from git main"
@git pull origin main
.PHONY: protos
## protos: generate the protos
protos:
@echo "Generating the Protos ..."
@rm -rf ./protos/goprotos;
@mkdir ./protos/goprotos
@protoc -I ./protos ./protos/*.proto --go_out=./protos/goprotos
@protoc -I ./protos ./protos/*.proto --go-grpc_out=require_unimplemented_servers=false:./protos/goprotos
.PHONY: terraform-deploy-opennebula-prepare-vms
## terraform-deploy-opennebula-prepare-vms: deploy the current plan of terraform-opennebula and prepare remote VMs
terraform-deploy-opennebula-prepare-vms: check-environment terraform-opennebula-deploy sleep-shortly prepare-remote-vms
@echo "Terraform deploying and preparing remote VMS..."
.PHONY: terraform-deploy-digitalocean-prepare-vms
## terraform-digitalocean-deploy-digitalocean-prepare-vms: deploy the current plan of terraform-digitalocean digitalocean and prepare remote VMs
terraform-deploy-digitalocean-prepare-vms: check-environment terraform-digitalocean-deploy sleep-shortly prepare-remote-vms
@echo "Terraform deploying digitalocean and preparing remote VMS..."
.PHONY: sleep-shortly
sleep-shortly:
@echo "Sleeping for 5 seconds ..."
@sleep 5
.PHONY: terraform-opennebula-deploy
## terraform-opennebula-deploy: deploy the current plan of terraform-opennebula
terraform-opennebula-deploy: check-environment
@echo "Terraform deploying ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} ./scripts/terraform_opennebula_deploy.sh
.PHONY: terraform-opennebula-destroy
## terraform-opennebula-destroy: destroy the current plan of terraform-opennebula
terraform-opennebula-destroy: check-environment
@echo "Terraform OpenNebula destroying ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} ./scripts/terraform_opennebula_destroy.sh
.PHONY: terraform-digitalocean-deploy
## terraform-digitalocean-digitalocean-deploy: deploy the current plan of terraform on Digitalocean
terraform-digitalocean-deploy: check-environment
@echo "Terraform Digitalocean deploying ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} ./scripts/terraform_digitalocean_deploy.sh
.PHONY: terraform-digitalocean-destroy
## terraform-digitalocean-digitalocean-destroy: destroy the current plan of terraform on Digitalocean
terraform-digitalocean-destroy: check-environment
@echo "Terraform Digitalocean destroying ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} ./scripts/terraform_digitalocean_destroy.sh
.PHONY: vagrant-deploy
## vagrant-deploy: deploy the vagrant locally
vagrant-deploy: check-environment
@echo "Vagrant deploying locally ..."
@cd ./deployment/vagrant/; vagrant up
.PHONY: vagrant-destroy
## vagrant-destroy: destroy the vagrant locally
vagrant-destroy: check-environment
@echo "Vagrant destroy locally ..."
@cd ./deployment/vagrant/; vagrant destroy -f
.PHONY: vagrant-suspend
## vagrant-suspend: suspend the vagrant locally
vagrant-suspend: check-environment
@echo "Vagrant suspend locally ..."
@cd ./deployment/vagrant/; vagrant suspend
.PHONY: vagrant-resume
## vagrant-resume: resume the vagrant locally
vagrant-resume: check-environment
@echo "Vagrant resume locally ..."
@cd ./deployment/vagrant/; vagrant resume
.PHONY: build-deploy-all-remote
## build-deploy-all-remote: build and deploy remote components using Ansible
build-deploy-all-remote: check-environment build-remote-linux
@echo "Running the bash script for building and deploying components ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" WAN_DRIVE=${WAN_DRIVE_REMOTE} ./scripts/deploy_components.sh
.PHONY: build-deploy-all-local
## build-deploy-all-local: build and deploy local components using Ansible
build-deploy-all-local: check-environment build-local-linux
@echo "Running the bash script for building and deploying components ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="local" WAN_DRIVE=${WAN_DRIVE_LOCAL} ./scripts/deploy_components.sh
.PHONY: destroy-all-remote
## destroy-all-remote: destroy remote components using Ansible
destroy-all-remote: check-environment
@echo "Running the bash script for destroying components ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" WAN_DRIVE=${WAN_DRIVE_REMOTE} ./scripts/destroy_components.sh
.PHONY: prepare-remote-linux-env
## prepare-remote-linux-env: Create the remote linux build env
prepare-remote-linux-env:
@echo "Preparing the remote linux build env ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" ./scripts/prepare_linux_build_env.sh
.PHONY: prepare-remote-vms
## prepare-remote-vms: Install dependencies on all remote VMs
prepare-remote-vms: prepare-remote-linux-env
@echo "Install dependencies on all remote VMs ..."
.PHONY: prepare-local-vms
## prepare-local-vms: Install dependencies on local VMs
prepare-local-vms:
@echo "Preparing the local linux build env ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="local" ./scripts/prepare_linux_build_env.sh
.PHONY: run-example-experiment-remote
## run-example-experiment-remote: Run the example experiment remote
run-example-experiment-remote:
@echo "Running the example experiment remote..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" ./scripts/run_example_experiment.sh
.PHONY: build-deploy-run-experiment-remote
## build-deploy-run-experiment-remote: Build deploy and run the example experiment remote
build-deploy-run-experiment-remote: build-deploy-all-remote run-example-experiment-remote
@echo "Build deploy and run the example experiment remote..."
.PHONY: run-all-experiments-remote
## run-all-experiments: Run ALL experiments remote
run-all-experiments-remote:
@echo "Running ALL experiments remote..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="remote" ./scripts/run_all_experiments.sh
.PHONY: run-example-experiment-local
## run-example-experiment-local: Run the example experiment local
run-example-experiment-local:
@echo "Running the example experiment locally ..."
@PROJECT_ABSOLUTE_PATH=${PROJECT_ABSOLUTE_PATH} BUILD_MODE="local" ./scripts/run_example_experiment.sh
.PHONY: build-deploy-run-experiment-local
## build-deploy-run-experiment-local: Build deploy and run the example experiment local
build-deploy-run-experiment-local: build-deploy-all-local run-example-experiment-local
@echo " Build deploy and run the example experiment local..."