Skip to content

Commit 4b1bbe5

Browse files
committed
feature: faster docker builds using blacksmith
1 parent a11b52b commit 4b1bbe5

1 file changed

Lines changed: 75 additions & 60 deletions

File tree

.github/workflows/integ-tests.yml

Lines changed: 75 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,29 @@ jobs:
2929
- name: Install dependencies
3030
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
3131

32-
- name: Build Docker image
33-
run: |
34-
docker build -t thevalut-node:test .
32+
- name: Docker meta
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: devflowinc/threshold
37+
tags: |
38+
type=raw,latest
39+
type=sha
3540
36-
- name: Save Docker image
37-
run: |
38-
docker save thevalut-node:test | gzip > thevalut-node-test.tar.gz
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
3943

40-
- name: Upload Docker image artifact
41-
uses: actions/upload-artifact@v4
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v3
4246
with:
43-
name: thevalut-node-test-image
44-
path: thevalut-node-test.tar.gz
45-
retention-days: 1
47+
username: ${{ secrets.DOCKER_USERNAME }}
48+
password: ${{ secrets.DOCKER_PASSWORD }}
49+
50+
- name: Build and push Docker image
51+
uses: useblacksmith/build-push-action@v1
52+
with:
53+
push: true
54+
tags: devflowinc/threshold:latest
4655

4756
dkg_test-12:
4857
runs-on: blacksmith-16vcpu-ubuntu-2204
@@ -69,15 +78,15 @@ jobs:
6978
rustup update 1.87
7079
rustup default 1.87
7180
72-
- name: Download Docker image artifact
73-
uses: actions/download-artifact@v4
81+
- name: Login to Docker Hub
82+
uses: docker/login-action@v3
7483
with:
75-
name: thevalut-node-test-image
76-
path: .
84+
username: ${{ secrets.DOCKER_USERNAME }}
85+
password: ${{ secrets.DOCKER_PASSWORD }}
7786

78-
- name: Load Docker image
87+
- name: Pull Docker image
7988
run: |
80-
gunzip -c thevalut-node-test.tar.gz | docker load
89+
docker pull devflowinc/threshold:latest
8190
8291
- name: Install dependencies
8392
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
@@ -137,15 +146,15 @@ jobs:
137146
rustup update 1.87
138147
rustup default 1.87
139148
140-
- name: Download Docker image artifact
141-
uses: actions/download-artifact@v4
149+
- name: Login to Docker Hub
150+
uses: docker/login-action@v3
142151
with:
143-
name: thevalut-node-test-image
144-
path: .
152+
username: ${{ secrets.DOCKER_USERNAME }}
153+
password: ${{ secrets.DOCKER_PASSWORD }}
145154

146-
- name: Load Docker image
155+
- name: Pull Docker image
147156
run: |
148-
gunzip -c thevalut-node-test.tar.gz | docker load
157+
docker pull devflowinc/threshold:latest
149158
150159
- name: Install dependencies
151160
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
@@ -197,15 +206,15 @@ jobs:
197206
rustup update 1.87
198207
rustup default 1.87
199208
200-
- name: Download Docker image artifact
201-
uses: actions/download-artifact@v4
209+
- name: Login to Docker Hub
210+
uses: docker/login-action@v3
202211
with:
203-
name: thevalut-node-test-image
204-
path: .
212+
username: ${{ secrets.DOCKER_USERNAME }}
213+
password: ${{ secrets.DOCKER_PASSWORD }}
205214

206-
- name: Load Docker image
215+
- name: Pull Docker image
207216
run: |
208-
gunzip -c thevalut-node-test.tar.gz | docker load
217+
docker pull devflowinc/threshold:latest
209218
210219
- name: Clean cargo
211220
run: cargo clean
@@ -262,19 +271,22 @@ jobs:
262271
rustup update 1.87
263272
rustup default 1.87
264273
265-
- name: Download Docker image artifact
266-
uses: actions/download-artifact@v4
274+
- name: Login to Docker Hub
275+
uses: docker/login-action@v3
267276
with:
268-
name: thevalut-node-test-image
269-
path: .
277+
username: ${{ secrets.DOCKER_USERNAME }}
278+
password: ${{ secrets.DOCKER_PASSWORD }}
279+
280+
- name: Pull Docker image
281+
run: |
282+
docker pull devflowinc/threshold:latest
283+
284+
- name: Clean cargo
285+
run: cargo clean
270286

271287
- name: Install dependencies
272288
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
273289

274-
- name: Load Docker image
275-
run: |
276-
gunzip -c thevalut-node-test.tar.gz | docker load
277-
278290
- name: Create NodeCluster (3 nodes)
279291
run: ./scripts/clear_dkg_keys.sh
280292

@@ -327,19 +339,19 @@ jobs:
327339
rustup update 1.87
328340
rustup default 1.87
329341
330-
- name: Download Docker image artifact
331-
uses: actions/download-artifact@v4
342+
- name: Login to Docker Hub
343+
uses: docker/login-action@v3
332344
with:
333-
name: thevalut-node-test-image
334-
path: .
345+
username: ${{ secrets.DOCKER_USERNAME }}
346+
password: ${{ secrets.DOCKER_PASSWORD }}
347+
348+
- name: Pull Docker image
349+
run: |
350+
docker pull devflowinc/threshold:latest
335351
336352
- name: Install dependencies
337353
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
338354

339-
- name: Load Docker image
340-
run: |
341-
gunzip -c thevalut-node-test.tar.gz | docker load
342-
343355
- name: Create NodeCluster (3 nodes)
344356
run: ./scripts/clear_dkg_keys.sh
345357

@@ -392,22 +404,25 @@ jobs:
392404
rustup update 1.87
393405
rustup default 1.87
394406
395-
- name: Download Docker image artifact
396-
uses: actions/download-artifact@v4
407+
- name: Login to Docker Hub
408+
uses: docker/login-action@v3
397409
with:
398-
name: thevalut-node-test-image
399-
path: .
410+
username: ${{ secrets.DOCKER_USERNAME }}
411+
password: ${{ secrets.DOCKER_PASSWORD }}
400412

401-
- name: Load Docker image
413+
- name: Pull Docker image
402414
run: |
403-
gunzip -c thevalut-node-test.tar.gz | docker load
415+
docker pull devflowinc/threshold:latest
404416
405417
- name: Clean cargo
406418
run: cargo clean
407419

408420
- name: Install dependencies
409421
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
410422

423+
- name: Create NodeCluster (3 nodes)
424+
run: ./scripts/clear_dkg_keys.sh
425+
411426
- name: Start 5-node stack with network chaos
412427
run: |
413428
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml up -d
@@ -457,22 +472,22 @@ jobs:
457472
rustup update 1.87
458473
rustup default 1.87
459474
460-
- name: Download Docker image artifact
461-
uses: actions/download-artifact@v4
475+
- name: Login to Docker Hub
476+
uses: docker/login-action@v3
462477
with:
463-
name: thevalut-node-test-image
464-
path: .
478+
username: ${{ secrets.DOCKER_USERNAME }}
479+
password: ${{ secrets.DOCKER_PASSWORD }}
465480

466-
- name: Load Docker image
481+
- name: Pull Docker image
467482
run: |
468-
gunzip -c thevalut-node-test.tar.gz | docker load
469-
470-
- name: Clean cargo
471-
run: cargo clean
483+
docker pull devflowinc/threshold:latest
472484
473485
- name: Install dependencies
474486
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
475487

488+
- name: Create NodeCluster (3 nodes)
489+
run: ./scripts/clear_dkg_keys.sh
490+
476491
- name: Start 5-node stack with node chaos
477492
run: |
478493
docker compose -f docker-compose.yaml -f docker-compose.chaos-nodes.yaml up -d

0 commit comments

Comments
 (0)