-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
488 lines (437 loc) · 11.4 KB
/
.drone.yml
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# sdk @iexec/iexec-oracle-factory-wrapper default pipeline
kind: pipeline
type: docker
name: sdk-default
trigger:
event:
exclude:
- promote
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: format
image: node:18
commands:
- npm run check-format
depends_on:
- install
- name: lint
image: node:18
commands:
- npm run lint
depends_on:
- install
- name: check-types
image: node:18
commands:
- npm run check-types
depends_on:
- install
- name: test:unit
image: node:18
commands:
- npm run test:unit
depends_on:
- install
##### START LOCAL STACK #####
- name: prepare-local-stack-env
image: node
commands:
- node tests/scripts/prepare-test-env.js
- name: bellecour-fork
detach: true
image: ghcr.io/foundry-rs/foundry:latest
pull: always
expose:
- 8545
commands:
- anvil --host 0.0.0.0 --port 8545 --block-time 1 --hardfork berlin --fork-url $(cat local-stack-env/BELLECOUR_FORK_URL) --fork-block-number $(cat local-stack-env/BELLECOUR_FORK_BLOCK) --chain-id 134 --gas-limit 6700000 --gas-price 0
depends_on:
- prepare-local-stack-env
- test:unit
- name: bellecour-fork-healthy
image: bash
commands:
- while ! nc -z bellecour-fork 8545 ; do sleep 1 ; done && echo "bellecour-fork ready"
depends_on:
- bellecour-fork
- name: ipfs
image: ipfs/go-ipfs:v0.9.1
detach: true
expose:
- 8080
- 5001
depends_on:
- test:unit
- name: ipfs-healthy
image: bash
commands:
- while ! nc -z ipfs 8080 ; do sleep 1 ; done && echo "ipfs gateway ready"
- while ! nc -z ipfs 5001 ; do sleep 1 ; done && echo "ipfs upload ready"
depends_on:
- ipfs
- name: market-mongo
image: mongo:6.0.3
detach: true
expose:
- 27017
depends_on:
- test:unit
- name: market-mongo-healthy
image: bash
commands:
- while ! nc -z market-mongo 27017 ; do sleep 1 ; done && echo "market-mongo ready"
depends_on:
- market-mongo
- name: market-redis
image: redis:7.0.7-alpine
detach: true
commands:
- redis-server --appendonly yes
expose:
- 6379
depends_on:
- test:unit
- name: market-redis-healthy
image: bash
commands:
- while ! nc -z market-redis 6379 ; do sleep 1 ; done && echo "market-redis ready"
depends_on:
- market-redis
- name: result-proxy-mongo
image: library/mongo:4.2
detach: true
commands:
- mongod --bind_ip_all --port 13202
expose:
- 13202
depends_on:
- test:unit
- name: result-proxy-mongo-healthy
image: bash
commands:
- while ! nc -z result-proxy-mongo 13202 ; do sleep 1 ; done && echo "result-proxy-mongo ready"
depends_on:
- result-proxy-mongo
- name: graphnode-postgres
image: postgres:12
detach: true
commands:
- docker-entrypoint.sh postgres -cshared_preload_libraries=pg_stat_statements
expose:
- 5432
environment:
POSTGRES_USER: graphnode
POSTGRES_PASSWORD: password
POSTGRES_DB: graphnode-db
PGDATA: '/var/lib/postgresql/data'
POSTGRES_INITDB_ARGS: '-E UTF8 --locale=C'
- name: graphnode-postgres-healthy
image: bash
commands:
- while ! nc -z graphnode-postgres 5432 ; do sleep 1 ; done && echo "graphnode-postgres ready"
depends_on:
- graphnode-postgres
depends_on:
- test:unit
- name: graphnode
image: graphprotocol/graph-node:v0.34.1
detach: true
expose:
- 8000
- 8020
environment:
postgres_host: graphnode-postgres
postgres_port: 5432
postgres_user: graphnode
postgres_pass: password
postgres_db: graphnode-db
ipfs: ipfs:5001
ethereum: bellecour:http://bellecour-fork:8545
commands:
- export GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cat local-stack-env/BELLECOUR_FORK_BLOCK
- start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- ipfs-healthy
- graphnode-postgres-healthy
- name: graphnode-healthy
image: bash
commands:
- while ! nc -z graphnode 8020 ; do sleep 1 ; done && echo "graphnode admin ready"
- while ! nc -z graphnode 8000 ; do sleep 1 ; done && echo "graphnode gql ready"
depends_on:
- graphnode
- name: sms
image: iexechub/iexec-sms:7.1.0
detach: true
environment:
TZ: Europe/Paris
IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
IEXEC_TEE_WORKER_PRE_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-pre-compute:7.1.0-sconify-5.3.15-debug
IEXEC_TEE_WORKER_PRE_COMPUTE_FINGERPRINT: 9f0f782d6edc611baa23ca0978f555ee58ea70e092640c961e75c25e9e4b0f22
IEXEC_TEE_WORKER_PRE_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_TEE_WORKER_POST_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-post-compute:7.1.1-sconify-5.3.15-debug
IEXEC_TEE_WORKER_POST_COMPUTE_FINGERPRINT: face1376b97131e2dc75a556381d47a2e03bed9e1bc11e462471f99d1eefae50
IEXEC_TEE_WORKER_POST_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_IGNORED_SGX_ADVISORIES: INTEL-SA-00161,INTEL-SA-00289,INTEL-SA-00334,INTEL-SA-00381,INTEL-SA-00389,INTEL-SA-00220,INTEL-SA-00270,INTEL-SA-00293,INTEL-SA-00320,INTEL-SA-00329,INTEL-SA-00477
IEXEC_SCONE_TOLERATED_INSECURE_OPTIONS: debug-mode,hyperthreading,outdated-tcb
IEXEC_SMS_DISPLAY_DEBUG_SESSION: 'true'
IEXEC_SCONE_CAS_HOST: foo
IEXEC_SMS_IMAGE_LAS_IMAGE: foo
expose:
- 13300
depends_on:
- bellecour-fork-healthy
- name: sms-healthy
image: bash
commands:
- while ! nc -z sms 13300 ; do sleep 1 ; done && echo "sms ready"
depends_on:
- sms
- name: result-proxy
image: iexechub/iexec-result-proxy:7.1.0
detach: true
environment:
IEXEC_PRIVATE_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_PUBLIC_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: result-proxy-mongo
MONGO_PORT: 13202
IEXEC_IPFS_HOST: ipfs
expose:
- 13200
depends_on:
- bellecour-fork-healthy
- ipfs-healthy
- result-proxy-mongo-healthy
- name: result-proxy-healthy
image: bash
commands:
- while ! nc -z result-proxy 13200 ; do sleep 1 ; done && echo "result-proxy ready"
depends_on:
- result-proxy
- name: market-watcher
image: iexechub/iexec-market-watcher:6.4
detach: true
environment:
CHAIN: BELLECOUR
ETH_WS_HOST: ws://bellecour-fork:8545
ETH_RPC_HOST: http://bellecour-fork:8545
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
commands:
- export START_BLOCK=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cd /app
- npm start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api
image: iexechub/iexec-market-api:6.4
detach: true
expose:
- 3000
environment:
CHAINS: BELLECOUR_FORK
BELLECOUR_FORK_ETH_RPC_HOST: http://bellecour-fork:8545
BELLECOUR_FORK_CHAIN_ID: 134
BELLECOUR_FORK_IS_NATIVE: 'true'
BELLECOUR_FORK_IEXEC_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
RATE_LIMIT_MAX: 10000
RATE_LIMIT_PERIOD: 60000
MAX_OPEN_ORDERS_PER_WALLET: 1000
depends_on:
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api-healthy
image: bash
commands:
- while ! nc -z market-api 3000 ; do sleep 1 ; done && echo "market-api ready"
depends_on:
- market-api
- market-watcher
- name: voucher-subgraph-deployer
# https://github.com/iExecBlockchainComputing/iexec-voucher-subgraph
image: iexechub/voucher-subgraph-deployer:c0640e8d
pull: always
environment:
RPC_URL: http://bellecour-fork:8545
GRAPHNODE_URL: http://graphnode:8020
IPFS_URL: http://ipfs:5001
VOUCHER_HUB_ADDRESS: '0x3137B6DF4f36D338b82260eDBB2E7bab034AFEda'
commands:
- export VOUCHER_HUB_START_BLOCK=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cd /iexec-voucher-subgraph && npm run all
depends_on:
- prepare-local-stack-env
- ipfs-healthy
- graphnode-healthy
- name: stack-ready
image: bash
commands:
- echo "all services ready"
depends_on:
- bellecour-fork-healthy
- sms-healthy
- result-proxy-healthy
- market-api-healthy
- ipfs-healthy
- graphnode-healthy
- voucher-subgraph-deployer
### START LOCAL STACK END ###
- name: test:e2e
image: node:18
commands:
- npm run test:prepare
- npm run test:e2e
depends_on:
- install
- stack-ready
- name: build
image: node:18
commands:
- npm run build
depends_on:
- install
- name: npm-publish-dry-run
image: node:18
commands:
- npm publish --dry-run
depends_on:
- format
- lint
- check-types
- test:e2e
- build
---
# sdk @iexec/iexec-oracle-factory-wrapper publish npm nightly pipeline
kind: pipeline
type: docker
name: sdk-publish-nightly
trigger:
event:
- promote
target:
- sdk-nightly
branch:
- develop
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: format
image: node:18
commands:
- npm run check-format
depends_on:
- install
- name: lint
image: node:18
commands:
- npm run lint
depends_on:
- install
- name: check-types
image: node:18
commands:
- npm run check-types
depends_on:
- install
- name: build
image: node:18
commands:
- npm run build
depends_on:
- install
- name: set-version-nightly
image: node:18
commands:
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
- name: npm publish nightly version
image: plugins/npm
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: nightly
access: public
depends_on:
- format
- lint
- check-types
- build
- set-version-nightly
when:
branch:
- develop
target:
- sdk-nightly
---
# sdk @iexec/iexec-oracle-factory-wrapper publish npm latest pipeline
kind: pipeline
type: docker
name: sdk-publish-latest
trigger:
event:
- promote
target:
- sdk-latest
branch:
- main
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: format
image: node:18
commands:
- npm run check-format
- name: lint
image: node:18
commands:
- npm run lint
- name: check-types
image: node:18
commands:
- npm run check-types
# - name: test
# image: node:18
# commands:
# - npm run test
- name: build
image: node:18
commands:
- npm run build
- name: publish
image: plugins/npm
pull: always
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: latest
access: public