Skip to content

Commit 9412b77

Browse files
authored
fix: docker CI performance & release builds (#2659)
## Description - We now build the docker test CI jobs in a way that more closely resembles the release process. It should compile the binaries and build the image significantly faster now. (down from 8+ min to 2 min) - Secrets are properly passed in to the reusable workflow so [release docker builds should no longer fail](https://github.com/n0-computer/iroh/actions/runs/10473026816/job/29005092378) ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
1 parent dc78ba5 commit 9412b77

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,17 @@ jobs:
428428
- name: Install sccache
429429
uses: mozilla-actions/[email protected]
430430

431+
- name: Prep
432+
run: sudo apt-get install musl-tools -y
433+
434+
- name: Build iroh
435+
run: cargo build --profile=dev-ci --all-features --bin iroh --target x86_64-unknown-linux-musl
436+
437+
- name: Prep bins
438+
run: |
439+
mkdir -p bins/linux/amd64
440+
cp target/x86_64-unknown-linux-musl/dev-ci/iroh bins/linux/amd64/iroh
441+
431442
- name: Cleanup Docker
432443
continue-on-error: true
433444
run: |
@@ -445,12 +456,14 @@ jobs:
445456
tags: n0computer/iroh-test:latest
446457
target: iroh
447458
platforms: linux/amd64
448-
file: docker/Dockerfile
459+
file: docker/Dockerfile.ci
449460

450461
- name: Run Docker image & stats test
451462
run: |
452463
docker run -p 9090:9090 -p 4919:4919/udp -Pd n0computer/iroh-test:latest --rpc-addr 0.0.0.0:4919 start
453-
cargo run --bin iroh -- --rpc-addr 127.0.0.1:4919 stats
464+
# Give the server time to start
465+
sleep 3
466+
target/x86_64-unknown-linux-musl/dev-ci/iroh --rpc-addr 127.0.0.1:4919 stats
454467
455468
codespell:
456469
runs-on: ubuntu-latest

.github/workflows/docker.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
uses: docker/build-push-action@v6
8989
with:
9090
context: .
91-
push: true
91+
push: ${{ github.event.inputs.publish }}
9292
tags: n0computer/iroh:latest,n0computer/iroh:${{ github.event.inputs.release_version }}
9393
target: iroh
9494
platforms: linux/amd64,linux/arm64/v8
@@ -98,7 +98,7 @@ jobs:
9898
uses: docker/build-push-action@v6
9999
with:
100100
context: .
101-
push: true
101+
push: ${{ github.event.inputs.publish }}
102102
tags: n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ github.event.inputs.release_version }}
103103
target: iroh-relay
104104
platforms: linux/amd64,linux/arm64/v8
@@ -108,7 +108,7 @@ jobs:
108108
uses: docker/build-push-action@v6
109109
with:
110110
context: .
111-
push: true
111+
push: ${{ github.event.inputs.publish }}
112112
tags: n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ github.event.inputs.release_version }}
113113
target: iroh-dns-server
114114
platforms: linux/amd64,linux/arm64/v8

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ jobs:
267267
docker:
268268
needs: build_release
269269
uses: './.github/workflows/docker.yaml'
270+
secrets: inherit
270271
with:
271272
release_version: ${{ needs.build_release.outputs.release_version }}
272273
base_hash: ${{ needs.build_release.outputs.base_hash }}

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ resolver = "2"
1717
[profile.release]
1818
debug = true
1919

20+
[profile.dev-ci]
21+
inherits = 'dev'
22+
opt-level = 1
23+
2024
[profile.optimized-release]
2125
inherits = 'release'
2226
debug = false

0 commit comments

Comments
 (0)