-
Notifications
You must be signed in to change notification settings - Fork 6
/
vagga.yaml
273 lines (244 loc) · 7.05 KB
/
vagga.yaml
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
commands:
make: !Command
description: Build the library and executables
container: xenial
run: [cargo, build]
cargo: !Command
description: Run arbitrary cargo command
container: xenial
symlink-name: cargo
run: [cargo]
test: !Command
description: Run tests
container: xenial
run: [cargo, test]
server: !Command
description: Run the server
container: xenial
run: [cargo, run, --bin, ciruela-server, "--"]
client: !Command
description: Run the client
container: xenial
run: [cargo, run, --bin, ciruela, "--"]
_example-server-dirs: !Command
description: Create dirs for example server
container: xenial
run: |
mkdir -p ./tmp/db
mkdir -p ./tmp/dest/dir1
example-server: !Command
description: Run the server
container: xenial
prerequisites: [make, _example-server-dirs]
environ: &exenv
RUST_LOG: "info,tokio_core=warn,\
tokio_reactor=warn,\
ciruela_server::proto=info,\
ciruela_server::peers::gossip=warn,\
ciruela_server::named_mutex=info,\
ciruela_server::tracking=trace,\
ciruela_server::metadata::upload=debug,\
tk_http::websocket::dispatcher=info"
run:
- ./target/debug/ciruela-server
- --config-base-dir=./example-configs
- --db-dir=./tmp/db
- --override-machine-id=77985419c732412ea38b94db00000001
example-upload: !Command
description: Run the upload command with example key
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- upload
- --identity=ciruela-example.key
example-sync: !Command
description: Run the sync command with example key
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- sync
- --identity=ciruela-example.key
example-edit: !Command
description: Run the edit command with example key
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- edit
- --identity=ciruela-example.key
example-put-file: !Command
description: Run the put-file command with example key
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- put-file
- --identity=ciruela-example.key
trio-sync: !Command
description: Run the sync command with example key to
an example cluster run with `vagga trio`
container: xenial
prerequisites: [make]
environ: *exenv
run:
- ./target/debug/ciruela
- --port=20001
- sync
- --identity=ciruela-example.key
- gw.mglawica.org
example-upload-with-env-key: !Command
description: Run the upload command with example key
container: xenial
prerequisites: [make]
accepts-arguments: true
environ: *exenv
run: |
export CIRUELA_KEY="$(cat ciruela-example.key)"
exec ./target/debug/ciruela upload "$@"
doc: !Command
description: Build documentation
container: doc
run: [make, html]
work-dir: doc
epilog: |
--------------------------------------------------------
xdg-open doc/_build/html/index.html
_bulk: !Command
description: Run any bulk command
container: xenial
run: [bulk]
_package-trusty: !Command
container: trusty
run: &package |
set -e
version=$(git describe --dirty)
codename=$(lsb_release --codename --short)
rm -rf pkg
rm -rf target/release/ciruela*
bulk with-version "${version}" cargo install --root=/work/pkg/usr --path=.
rm pkg/usr/.crates.toml
bulk pack --package-version="${version}+${codename}1"
_package-xenial: !Command
container: xenial
run: *package
_package-bionic: !Command
container: bionic
run: *package
packages: !Command
container: xenial
description: Build packages and repostories (mostly for CI)
prerequisites: [_package-trusty, _package-xenial, _package-bionic]
accepts_arguments: true
run: |
bulk repo-add --config bulk.yaml --repository-base dist/repos \
dist/ciruela-[0-9]*.deb "$@"
_trio-dirs: !Command
description: Create dirs for example server
container: xenial
run: |
mkdir -p ./tmp/db1
mkdir -p ./tmp/dest1/dir1 ./tmp/dest1/dir2
mkdir -p ./tmp/db2
mkdir -p ./tmp/dest2/dir1 ./tmp/dest2/dir2
mkdir -p ./tmp/db3
mkdir -p ./tmp/dest3/dir1 ./tmp/dest3/dir2
trio: !Supervise
description: Runs three ciruela servers to simulate cluster
prerequisites: [make, _trio-dirs]
children:
n1: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest1
network:
ip: 172.23.0.1
ports: {20001: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db1
- --override-machine-id=77985419c732412ea38b94db00000001
- --override-hostname=n1
- --log-machine-id
- --aggressive-index-gc
n2: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest2
network:
ip: 172.23.0.2
ports: {20002: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db2
- --override-machine-id=77985419c732412ea38b94db00000002
- --override-hostname=n2
- --log-machine-id
n3: !Command
container: xenial
environ: *exenv
work-dir: tmp/dest3
network:
ip: 172.23.0.3
ports: {20003: 24783}
run:
- "/work/target/debug/ciruela-server"
- --config-base-dir=/work/example-configs3
- --db-dir=/work/tmp/db3
- --override-machine-id=77985419c732412ea38b94db00000003
- --override-hostname=n3
- --log-machine-id
containers:
xenial:
setup:
- !Ubuntu xenial
- &pkgs !Install
- ca-certificates
- git
- build-essential
- git # to build package
- lsb-release # to build package
- vim # to edit release notes
- &rust !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.29.2-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr \
--components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
- &bulk !Tar
url: "https://github.com/tailhook/bulk/releases/download/v0.4.12/bulk-v0.4.12.tar.gz"
sha256: 7deeb4895b3909afea46194ef01bafdeb30ff89fc4a7b6497172ba117734040e
path: /
- !EnsureDir /cargo
environ: &environ
CARGO_HOME: /cargo
RUST_BACKTRACE: 1
volumes: &volumes
/cargo: !Persistent cargo
trusty:
setup:
- !Ubuntu trusty
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
bionic:
setup:
- !Ubuntu bionic
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
doc:
setup:
- !Alpine v3.7
- !Install [alpine-base, py-sphinx, py-requests, make]