Skip to content

Commit 03f681c

Browse files
authored
Add parachain image without tee-dev feature (#1567)
* add tee-prod image build * add dependency * small comment update
1 parent 9d6459f commit 03f681c

File tree

1 file changed

+67
-15
lines changed

1 file changed

+67
-15
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ name: General CI
2020
# jobs that will always be executed:
2121
# - fmt
2222
# - set-condition
23-
# - parachain-build
23+
# - parachain-build-dev
24+
# - parachain-build-tee-prod
2425
# - tee-build
2526
#
2627
# [4] please note that job-level if `env` is not supported:
2728
# https://github.com/actions/runner/issues/1189
2829
# as a workaround, we need to put it in a step-level or use `needs.outputs`
30+
#
31+
# [5] parachain-build-tee-prod builds the parachain image without `tee-dev` feature
32+
# It's used with tee-worker production deployment with HW mode.
2933

3034
on:
3135
push:
@@ -240,7 +244,7 @@ jobs:
240244
if: failure()
241245
uses: andymckay/cancel-action@0.3
242246

243-
parachain-build:
247+
parachain-build-dev:
244248
runs-on: ubuntu-latest
245249
needs:
246250
- fmt
@@ -263,13 +267,49 @@ jobs:
263267
264268
- name: Save docker image
265269
run: |
266-
docker save litentry/litentry-parachain -o litentry-parachain.tar
270+
docker save litentry/litentry-parachain -o litentry-parachain-dev.tar
271+
272+
- name: Upload docker image
273+
uses: actions/upload-artifact@v3
274+
with:
275+
name: parachain-artifact-dev
276+
path: litentry-parachain-dev.tar
277+
if-no-files-found: error
278+
279+
- name: Fail early
280+
if: failure()
281+
uses: andymckay/cancel-action@0.3
282+
283+
parachain-build-tee-prod:
284+
runs-on: ubuntu-latest
285+
needs:
286+
- fmt
287+
- set-condition
288+
- sequentialise
289+
steps:
290+
- uses: actions/checkout@v3
291+
292+
- name: Build docker image
293+
if: needs.set-condition.outputs.rebuild_parachain == 'true'
294+
run: |
295+
./scripts/build-docker.sh production tee-prod
296+
echo "============================="
297+
docker images
298+
299+
- name: Pull docker image optinally
300+
if: needs.set-condition.outputs.rebuild_parachain == 'false'
301+
run: |
302+
docker pull litentry/litentry-parachain:tee-prod
303+
304+
- name: Save docker image
305+
run: |
306+
docker save litentry/litentry-parachain:tee-prod -o litentry-parachain-tee-prod.tar
267307
268308
- name: Upload docker image
269309
uses: actions/upload-artifact@v3
270310
with:
271-
name: parachain-artifact
272-
path: litentry-parachain.tar
311+
name: parachain-artifact-tee-prod
312+
path: litentry-parachain-tee-prod.tar
273313
if-no-files-found: error
274314

275315
- name: Fail early
@@ -350,7 +390,7 @@ jobs:
350390
runs-on: ubuntu-latest
351391
needs:
352392
- set-condition
353-
- parachain-build
393+
- parachain-build-dev
354394
strategy:
355395
matrix:
356396
chain:
@@ -362,11 +402,11 @@ jobs:
362402

363403
- uses: actions/download-artifact@v3
364404
with:
365-
name: parachain-artifact
405+
name: parachain-artifact-dev
366406

367407
- name: Load docker image
368408
run: |
369-
docker load -i litentry-parachain.tar
409+
docker load -i litentry-parachain-dev.tar
370410
371411
- name: Run ts tests for ${{ matrix.chain }}
372412
if: needs.set-condition.outputs.run_parachain_test == 'true'
@@ -454,7 +494,7 @@ jobs:
454494
runs-on: ubuntu-latest
455495
needs:
456496
- set-condition
457-
- parachain-build
497+
- parachain-build-dev
458498
- tee-build
459499
env:
460500
WORKER_IMAGE_TAG: integritee-worker:dev
@@ -487,15 +527,15 @@ jobs:
487527
488528
- uses: actions/download-artifact@v3
489529
with:
490-
name: parachain-artifact
530+
name: parachain-artifact-dev
491531

492532
- uses: actions/download-artifact@v3
493533
with:
494534
name: tee-artifact
495535

496536
- name: Load docker image
497537
run: |
498-
docker load -i litentry-parachain.tar
538+
docker load -i litentry-parachain-dev.tar
499539
docker load -i litentry-tee.tar
500540
501541
- name: Re-name Image Tags
@@ -561,20 +601,26 @@ jobs:
561601
needs:
562602
- set-condition
563603
- parachain-ts-test
604+
- parachain-build-tee-prod
564605
- tee-test
565606
if: ${{ !failure() && needs.set-condition.outputs.push_docker == 'true' }}
566607
steps:
567608
- uses: actions/download-artifact@v3
568609
with:
569-
name: parachain-artifact
610+
name: parachain-artifact-dev
611+
612+
- uses: actions/download-artifact@v3
613+
with:
614+
name: parachain-artifact-tee-prod
570615

571616
- uses: actions/download-artifact@v3
572617
with:
573618
name: tee-artifact
574619

575620
- name: Load docker image
576621
run: |
577-
docker load -i litentry-parachain.tar
622+
docker load -i litentry-parachain-dev.tar
623+
docker load -i litentry-parachain-tee-prod.tar
578624
docker load -i litentry-tee.tar
579625
580626
- name: Dockerhub login
@@ -583,13 +629,19 @@ jobs:
583629
username: ${{ secrets.DOCKERHUB_USERNAME }}
584630
password: ${{ secrets.DOCKERHUB_PASSWORD }}
585631

586-
# only push the docker image if we rebuilt it
632+
# only push `litentry/litentry-parachain` if we rebuilt it
587633
- name: Push parachain image
588634
if: needs.set-condition.outputs.rebuild_parachain == 'true'
589635
run: |
590636
docker push litentry/litentry-parachain
591637
592-
# only push the docker image if we rebuilt it
638+
# only push `litentry/litentry-parachain:tee-prod` if we rebuilt it
639+
- name: Push parachain image
640+
if: needs.set-condition.outputs.rebuild_parachain == 'true'
641+
run: |
642+
docker push litentry/litentry-parachain:tee-prod
643+
644+
# only push TEE images if we rebuilt them
593645
- name: Push tee-worker image
594646
if: needs.set-condition.outputs.rebuild_tee == 'true'
595647
run: |

0 commit comments

Comments
 (0)