forked from openebs/mayastor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
248 lines (218 loc) · 5.1 KB
/
Makefile.toml
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
# Beware this file is OBSOLETE! It is left around only until all its
# functionality that it provides is acquired by nix, ci/cd scripts and
# other tools.
[env]
REV_TAG = { script = ["git rev-parse --short HEAD"] }
[tasks.deps]
script = [
"git submodule update --init --recursive",
"sudo apt-get update",
"sudo ./spdk-sys/spdk/scripts/pkgdep.sh",
"sudo pip install --upgrade pip",
# nasm is optional dep of spdk so it must be installed explicitly
"sudo apt-get install nasm",
"sudo apt-get install docker.io libblkid-dev xfsprogs",
"sudo curl -sL https://deb.nodesource.com/setup_10.x -sSf | sudo bash",
"sudo apt install nodejs",
"sudo npm install -g jshint prettier"
]
workspace = false
[tasks.setup]
script = [
"sudo sysctl -w vm.nr_hugepages=512",
"sudo -E ./spdk-sys/spdk/scripts/setup.sh",
"sudo modprobe nbd"
]
workspace = false
[tasks.bootstrap]
script = [
"rustup component add rustfmt",
"rustup component add clippy"
]
dependencies = [
"deps",
"setup",
]
workspace = false
[tasks.style-rust]
script = ["cargo fmt --all"]
workspace = false
[tasks.lint-rust]
script = ["cargo clippy --all --all-features --all-targets -- -D warnings"]
workspace = false
[tasks.style-js]
script = [
"prettier --version",
"prettier --config .prettierrc --check csi/moac/*.js mayastor-test/*.js"
]
workspace = false
[tasks.lint-js]
script = ["jshint --config .jshintrc csi/moac/*.js mayastor-test/*.js"]
workspace = false
[tasks.clean-moac]
script = ["rm -rf csi/moac/node_modules"]
[tasks.clean-rust]
command = "cargo"
args = ["clean"]
[tasks.clean-spdk]
script = [
'''
cd spdk-sys/spdk || exit 1;
make clean;
rm -f dpdk/config/defconfig_x86_64-nhm-linuxapp-gcc
'''
]
workspace = false
[tasks.clean-test]
script = ["rm -rf mayastor-test/node_modules"]
workspace = false
[tasks.clean]
dependencies = [
"clean-rust",
"clean-spdk",
"clean-test",
"clean-moac"
]
workspace = false
[tasks.build-moac]
script = ["cd csi/moac && npm install"]
workspace = false
[tasks.build-spdk]
script = ["./spdk-sys/build.sh --enable-debug --with-isal --with-crypto"]
workspace = false
[tasks.build-spdk-release]
script = [
"make -C spdk-sys/spdk clean",
"./spdk-sys/build.sh --with-isal --with-crypto"
]
workspace = false
[tasks.install-spdk]
script = [
"sudo make -C spdk-sys/spdk install",
"sudo cp spdk-sys/build/libspdk_fat.so /usr/lib/"
]
workspace = false
# build spdk lib, install it and then build everything else
[tasks.build]
command = "cargo"
args = ["build", "--all-targets"]
dependencies = ["build-moac", "build-spdk", "install-spdk"]
workspace = false
[tasks.build-release]
command = "cargo"
args = ["build", "--all", "--release"]
dependencies = ["clean", "build-moac", "build-spdk-release", "install-spdk"]
workspace = false
[tasks.unit-test]
command = "cargo"
args = ["test", "--all"]
workspace = false
[tasks.cli-test]
script = [
'''
cd mayastor-test || exit 1;
[ -d node_modules ] || npm install || exit 1;
npm test
'''
]
workspace = false
[tasks.docker]
script = [
'''
docker build \
-t mayadata/mayastor:dev-${REV_TAG} \
-f mayastor/Dockerfile . &&
docker build \
-t mayadata/mayastor-client:dev-${REV_TAG} \
-f mayastor-client/Dockerfile . &&
docker build \
-t mayadata/moac:dev-${REV_TAG} \
-f moac/Dockerfile .
'''
]
workspace = false
[tasks.docker-push]
script = [
'''
read -p "$(tput setaf 3) You are about to push changes to all three mayastor images on docker hub, continue? (y/n)?($tput sgr0)" c
case "$c" in
y|Y)
docker push mayadata/mayastor:dev-${REV_TAG} &&
docker push mayadata/mayastor-client:dev-${REV_TAG} &&
docker push mayadata/moac:dev-${REV_TAG}
;;
*) echo "Smart, it could create problems and then you own it!";;
esac
'''
]
dependencies = ["docker"]
workspace = false
[tasks.pre-check]
dependencies = [
"style-rust",
"style-js",
"lint-rust",
"lint-js"
]
workspace = false
[tasks.ci-flow]
dependencies = [
"bootstrap",
"pre-check",
"docker"
]
command = "docker"
args = [
"run",
"-i",
"-t",
"--privileged",
"--shm-size=1g",
"-v", "/dev:/dev",
"--entrypoint",
"test_rpc.sh",
"mayadata/mayastor:dev-${REV_TAG}"
]
workspace = false
[tasks.buildah-create]
script = [
'''
docker build -t mayadata/buildah:latest -f docker/Dockerfile.buildah .
'''
]
workspace = false
[tasks.buildah-push]
script = [
'''
read -p "$(tput setaf 3) You are about to push changes if any to the buildah:latest image, continue? (y/n)?($tput sgr0)" c
case "$c" in
y|Y) docker push mayadata/buildah:latest;;
*) echo "Smart, it could create problems and then you own it!";;
esac
'''
]
dependencies = ["buildah-create"]
workspace = false
[tasks.ms-buildenv-create]
script = [
'''
docker build -t mayadata/ms-buildenv:latest -f docker/Dockerfile.ms-buildenv .
'''
]
workspace = false
[tasks.ms-buildenv-push]
script = [
'''
read -p "$(tput setaf 3) You are about to push changes if any to the ms-buildenv:latest image, continue? (y/n)?($tput sgr0)" c
case "$c" in
y|Y) docker push mayadata/ms-buildenv:latest;;
*) echo "Smart, it could create problems and then you own it!";;
esac
'''
]
dependencies = ["ms-buildenv-create"]
workspace = false
[tasks.ms-buildenv-build]
command = "./tools/devtool"
args = ["-y", "build"]
workspace = false