-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy path.drone.yml
634 lines (570 loc) · 15.3 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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
kind: pipeline
type: docker
name: default
trigger:
event:
exclude:
- promote
- pull_request
steps:
##### START LOCAL STACK #####
- name: prepare-local-stack-env
image: node
commands:
- node test/scripts/prepare-test-env.js
- name: service-internal-error
detach: true
image: nginx:alpine
pull: always
expose:
- 80
commands:
- cp test/mock/server/http500.nginx.conf /etc/nginx/conf.d/default.conf
- nginx -g "daemon off;"
- name: bellecour-fork
detach: true
image: ghcr.io/foundry-rs/foundry:v1.0.0
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
- 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
- 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
- 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
- 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
- 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
- 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
- name: graphnode
image: graphprotocol/graph-node:v0.27.0
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)
- echo $GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER
- 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: sms-gramine
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-gramine-healthy
image: bash
commands:
- while ! nc -z sms-gramine 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:1.0.0
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:
- bellecour-fork-healthy
- ipfs-healthy
- graphnode-healthy
- name: custom-token-chain
detach: true
image: 'iexechub/poco-chaintest:5.3.2-token-openethereum'
expose:
- 8545
- name: custom-token-chain-healthy
image: bash
commands:
- while ! nc -z custom-token-chain 8545 ; do sleep 1 ; done && echo "custom-token-chain ready"
depends_on:
- custom-token-chain
- name: stack-ready
image: bash
commands:
- echo "all services ready"
depends_on:
- bellecour-fork-healthy
- sms-healthy
- sms-gramine-healthy
- result-proxy-healthy
- market-api-healthy
- ipfs-healthy
- graphnode-healthy
- custom-token-chain-healthy
- voucher-subgraph-deployer
### START LOCAL STACK END ###
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: build
image: node:18
pull: always
commands:
- npm run build
depends_on:
- install
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- build
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- build
- name: test
image: node:18
pull: always
environment:
ALCHEMY_API_KEY:
from_secret: alchemy_api_key
INFURA_PROJECT_ID:
from_secret: infura_project_id
ETHERSCAN_API_KEY:
from_secret: etherscan_api_key
commands:
- apt update
- apt install xxd
- node -v
- npm -v
- npm -g install .
- npm test
depends_on:
- build
- stack-ready
- name: code analysis
# issue with sonarsource/sonar-scanner-cli:latest
# https://community.sonarsource.com/t/error-running-sonarsource-sonar-scanner-cli-latest/116539
# 5.0.1 is working
image: sonarsource/sonar-scanner-cli:5
pull: always
environment:
SONAR_TOKEN:
from_secret: sonar_token
SONAR_HOST:
from_secret: sonar_host
commands:
- sonar-scanner -Dsonar.host.url=$SONAR_HOST -Dsonar.branch.name=$DRONE_BRANCH
depends_on:
- test
- name: test node 20
image: node:20
pull: always
environment:
ALCHEMY_API_KEY:
from_secret: alchemy_api_key
INFURA_PROJECT_ID:
from_secret: infura_project_id
ETHERSCAN_API_KEY:
from_secret: etherscan_api_key
commands:
- apt update
- apt install xxd
- node -v
- npm -v
- npm -g install .
- npm test
when:
event:
- tag
depends_on:
- build
- stack-ready
- test
---
kind: pipeline
type: docker
name: publish dry-run
trigger:
event:
exclude:
- promote
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: build
image: node:18
commands:
- npm run build
depends_on:
- install
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- build
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- build
- name: npm publish dry-run
image: node:18
commands:
- npm publish --dry-run
- name: docker publish dry-run
image: plugins/docker
pull: always
settings:
repo: iexechub/iexec-sdk
dockerfile: Dockerfile
dry_run: true
---
kind: pipeline
type: docker
name: publish nightly
trigger:
event:
- promote
target:
- nightly
branch:
- next
- new
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: build
image: node:18
commands:
- npm run build
depends_on:
- install
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- build
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- build
- name: set-version-nightly
image: node:18
commands:
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
- name: npm publish
image: plugins/npm
pull: always
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: ${DRONE_BRANCH}
depends_on:
- format
- lint
- build
- set-version-nightly
- name: docker publish
image: plugins/docker
pull: always
settings:
registry: docker-regis.iex.ec
repo: docker-regis.iex.ec/iexec-sdk
dockerfile: Dockerfile
username:
from_secret: nexus-user
password:
from_secret: nexus-password
tags:
- ${DRONE_BRANCH}
- ${DRONE_BRANCH}-${DRONE_COMMIT}
---
kind: pipeline
type: docker
name: publish latest
# promote latest on tag semver tags
trigger:
event:
- promote
target:
- latest
ref:
include:
- refs/tags/v[0-9]*.*[0-9].*[0-9]
exclude:
- refs/tags/v*.*.*.*
- refs/tags/v*-*
- refs/tags/v*[a-zA-Z]*
steps:
- name: install
image: node:18
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: build
image: node:18
commands:
- npm run build
depends_on:
- install
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- build
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- build
- name: npm publish
image: plugins/npm
pull: always
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: latest
depends_on:
- format
- lint
- build
- name: docker publish
image: plugins/docker
pull: always
settings:
repo: iexechub/iexec-sdk
dockerfile: Dockerfile
tags:
- latest
- ${DRONE_TAG##v}
username:
from_secret: docker_username
password:
from_secret: docker_password