Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement holepunching - Initial implementation #830

Merged
merged 330 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
330 commits
Select commit Hold shift + click to select a range
c80c5b9
update deps
dignifiedquire Mar 13, 2023
94590ae
feat: begin impl Server side of derp, starting with the server side o…
ramfox Mar 13, 2023
5a733ff
fix(netcheck): reduce locking and improved task tracking
dignifiedquire Mar 17, 2023
d02f65b
simplify by removing the ability to not have a private key
dignifiedquire Mar 17, 2023
156560a
fix: improve binding and rebinding of sockets
dignifiedquire Mar 20, 2023
235c458
Merge pull request #831 from n0-computer/x-hp-fixes
dignifiedquire Mar 20, 2023
fee2b4e
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire Mar 20, 2023
c0118d0
magicsock: some cleanup
dignifiedquire Mar 20, 2023
3a44560
cleanup and improve endpoint
dignifiedquire Mar 20, 2023
1cc89c9
Merge pull request #865 from n0-computer/x-hp-endpoint-cleanup
dignifiedquire Mar 20, 2023
c502e57
impl: `Client` and `Clients`, how the server manages the different co…
ramfox Mar 20, 2023
64f40fe
impl derp `ServerActor` (#854)
ramfox Mar 20, 2023
4ec522e
impl derp Server (#866)
ramfox Mar 23, 2023
ebb5326
remove unneeded "Conn" trait
ramfox Mar 23, 2023
f19485a
http derp server `derp_connection_handler`
ramfox Mar 24, 2023
8867e17
temp - create client writer and client reader to handle reading and w…
ramfox Mar 24, 2023
53de779
Merge pull request #883 from n0-computer/ramfox/client_redo
dignifiedquire Mar 27, 2023
5f6868e
initial implementation of bin/derper
dignifiedquire Mar 27, 2023
12d98ff
place holder fixes to get things to compile
dignifiedquire Mar 27, 2023
5ef5caa
cleanup derp test
dignifiedquire Mar 27, 2023
573e6f8
use lower level service implementation
dignifiedquire Mar 27, 2023
16b8955
integrate derp server into derper
dignifiedquire Mar 27, 2023
72f3f9a
implement http and TLS setup
dignifiedquire Mar 27, 2023
c8b6dad
fix tls integration to actually run
dignifiedquire Mar 27, 2023
2545e92
adjust `derp::Client` and start impl on `derp::http::Client` (#889)
ramfox Mar 28, 2023
a37b3dc
derp: implement first pass at client dialing
dignifiedquire Mar 28, 2023
d789a61
add dial timeout
dignifiedquire Mar 28, 2023
f1f43a7
finish ping/pong
ramfox Mar 28, 2023
fc50936
derp http client `connect` method!
ramfox Mar 28, 2023
2c59eb3
add stun test
dignifiedquire Mar 29, 2023
d297a7b
Merge remote-tracking branch 'origin/ramfox/http_client_connect' into…
dignifiedquire Mar 29, 2023
83cbda8
Merge pull request #886 from n0-computer/x-hp-compile
dignifiedquire Mar 29, 2023
5bb990e
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire Mar 29, 2023
283eab9
derper: implement manual certificate loading
dignifiedquire Mar 29, 2023
1c0a763
refactor: move timer to own file
dignifiedquire Mar 29, 2023
3a87872
derper: fix hostname test
dignifiedquire Mar 29, 2023
c58abe4
start integration into magicsocket test
dignifiedquire Mar 29, 2023
6e4f39a
fix upgrade connection
dignifiedquire Mar 29, 2023
91f7389
debugging and handle incoming read_buf
dignifiedquire Mar 29, 2023
3e3a029
return ok on read end
dignifiedquire Mar 29, 2023
48f8446
fix no_v4_send val
dignifiedquire Mar 29, 2023
74ad08e
add `MeshKey` type
ramfox Mar 29, 2023
8a3ca4d
bring back add_valid_path
dignifiedquire Mar 29, 2023
40e1353
test proving two http derp clients can connect to an http derp server…
ramfox Mar 30, 2023
8ed9120
refactor `FrameType` to be enum
ramfox Mar 30, 2023
2e8c3b5
clean up `FrameType`
ramfox Mar 30, 2023
5386d74
use fake ips for mapping endpoints
dignifiedquire Mar 30, 2023
b48b271
Merge pull request #898 from n0-computer/ramfox/x-hp-magic-derp
dignifiedquire Mar 30, 2023
b570ed2
some small fixes
dignifiedquire Mar 30, 2023
9bc12c6
`handle_derp_read_result` `RecvMeta` fix
ramfox Mar 31, 2023
17230d2
fixup fake addr assignment
dignifiedquire Mar 31, 2023
91ebc6d
fixup best_addr_valid checks
dignifiedquire Mar 31, 2023
c6ab492
debugging and improved heartbeat loop
dignifiedquire Mar 31, 2023
1244426
remove heartbeat from endpoint
dignifiedquire Apr 1, 2023
6992999
remove and cleanup some unused props
dignifiedquire Apr 1, 2023
548371a
cleanup
dignifiedquire Apr 3, 2023
7621bee
Merge pull request #897 from n0-computer/x-hp-magic-derp
dignifiedquire Apr 3, 2023
4f3c5b4
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire Apr 3, 2023
767b065
fix some warnings
dignifiedquire Apr 3, 2023
990a1fd
implement default_interface for windows
dignifiedquire Apr 3, 2023
3a442fa
refactor: cleanup and move network related impls to the net module
dignifiedquire Apr 3, 2023
b8cf258
implement udp setting for netcheck
dignifiedquire Apr 3, 2023
9b3efa2
clippy fixes
ramfox Apr 3, 2023
59395cb
Merge pull request #922 from n0-computer/x-hp-net
dignifiedquire Apr 4, 2023
177d0ac
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire Apr 4, 2023
caf7ebb
refactor: move keys out of the mutex
dignifiedquire Apr 4, 2023
793c345
refactor conn part 1
dignifiedquire Apr 5, 2023
3178391
refactor conn part 2
dignifiedquire Apr 5, 2023
018003f
refactor conn part 3
dignifiedquire Apr 5, 2023
9ee9708
fix option panic
dignifiedquire Apr 5, 2023
cc38756
refactor conn part 3
dignifiedquire Apr 7, 2023
18191e8
fix netcheck cancelation
dignifiedquire Apr 7, 2023
f2d12f2
register futures for receiving
dignifiedquire Apr 7, 2023
59910ba
debugging and blocking fix
dignifiedquire Apr 9, 2023
9d381d2
debug, missing name
dignifiedquire Apr 9, 2023
9cf5866
some cleanup
dignifiedquire Apr 20, 2023
e2f2bce
endpoint: fix ping pong timings
dignifiedquire Apr 21, 2023
22ab14d
implement sanity check test
dignifiedquire Apr 21, 2023
480fd7c
simplify sending code
dignifiedquire Apr 22, 2023
a99e524
store waker, instead of future
dignifiedquire Apr 22, 2023
74ddf2a
rename
dignifiedquire Apr 22, 2023
930d764
improved derp channel send
dignifiedquire Apr 22, 2023
0ed0edd
simplify some logic
dignifiedquire Apr 23, 2023
17e776f
one lock less (stun receive)
dignifiedquire Apr 23, 2023
173404c
anothe rwlock bites the dust
dignifiedquire Apr 23, 2023
6822523
use async-lock to simplify locking
dignifiedquire Apr 23, 2023
c8ef740
improve locking in endpoint
dignifiedquire Apr 23, 2023
5739106
improve naming and derp sending
dignifiedquire Apr 23, 2023
b02a76a
more debugging, avoid ipv4 endpoint delay
dignifiedquire Apr 23, 2023
9c2d41d
start integration into iroh
dignifiedquire Apr 23, 2023
701b134
basic get test passes
dignifiedquire Apr 24, 2023
f03ca50
move recving of messages to actor
dignifiedquire Apr 24, 2023
17e7ecf
move sending to actor
dignifiedquire Apr 24, 2023
2e5facf
avoid cloning endpoints
dignifiedquire Apr 24, 2023
84a95ed
remove locking from endpoints
dignifiedquire Apr 24, 2023
58ec2c3
avoid blocking on ping sends
dignifiedquire Apr 24, 2023
00a6812
implement tracked endpoints
dignifiedquire Apr 25, 2023
059a4c6
refactor conn a little more
dignifiedquire Apr 25, 2023
795b31e
do not directly depend on conn::Inner in endpoint
dignifiedquire Apr 25, 2023
0e269ce
improve endpoint concolidation
dignifiedquire Apr 26, 2023
3873814
ensure dst_ip is set as expected
dignifiedquire Apr 26, 2023
a63bf61
send heartbeats on interval, not when sending out packets
dignifiedquire Apr 27, 2023
de2c18f
cleanup and improve backpressure
dignifiedquire Apr 27, 2023
ebb74b9
only store latest waker
dignifiedquire Apr 27, 2023
4c43c57
refactor netcheck to be loop based
dignifiedquire Apr 27, 2023
bc24c33
basic netcheck working again
dignifiedquire Apr 28, 2023
2b7a04b
bring back tests
dignifiedquire Apr 28, 2023
0b35321
cleanup
dignifiedquire Apr 28, 2023
8b4d6cb
fixup
dignifiedquire Apr 28, 2023
1f812fd
fix: avoid polling future after completion
dignifiedquire Apr 28, 2023
6c19faa
feat: implement ICMP pings
dignifiedquire May 1, 2023
f832736
netcheck: split up probe code
dignifiedquire May 1, 2023
8ef66f8
key: remove dead code
dignifiedquire May 1, 2023
295d4cf
add quinn test over rebindingconn
dignifiedquire May 1, 2023
cefc8ba
fix: remove derp route on peergone
dignifiedquire May 1, 2023
5b8a9c1
update deps
dignifiedquire May 3, 2023
bb036c8
Merge pull request #940 from n0-computer/x-hp-refactor-conn
dignifiedquire May 3, 2023
7717243
fix: do not use magicsock for rpc
dignifiedquire May 3, 2023
b84ed59
fix: show all listening addrs
dignifiedquire May 3, 2023
826cff0
wire up derpmap configuration and netcheck improvements
dignifiedquire May 3, 2023
07d919f
fix: use correct endpoint for derp connections
dignifiedquire May 3, 2023
05480a0
derper: refactor serving content & derp
dignifiedquire May 3, 2023
e60dc7f
derper: cleanup
dignifiedquire May 3, 2023
4f9cc86
deper: ensure upgrades are allowed on derp
dignifiedquire May 3, 2023
824c7e3
error debugging
dignifiedquire May 3, 2023
ded1daa
fix test setup bug...
dignifiedquire May 3, 2023
a137ff2
logging cleanup
dignifiedquire May 3, 2023
05b351c
integrate patched quinn and reduce allocations
dignifiedquire May 5, 2023
ef01668
improve performance in the hot path (#973)
dignifiedquire May 6, 2023
9a92eea
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire May 8, 2023
4bcad99
remove some stale refs from docs so cargo doc works (#977)
rklaehn May 8, 2023
db5ad3e
fix: avoid using tokio::block_in_place
dignifiedquire May 8, 2023
fd7e0fe
test: check that no packets have been lost
dignifiedquire May 8, 2023
6a1e405
fix: correct ipv4 and ipv6 port mappings on rebind and endpoints
dignifiedquire May 8, 2023
f0bde56
fix: store udpstate
dignifiedquire May 8, 2023
6c2f592
derp: wait for connection
dignifiedquire May 8, 2023
36f6585
fix, waiting for derp connection
dignifiedquire May 8, 2023
4855107
connect before cb
dignifiedquire May 8, 2023
4e8625a
test: all 10 rounds
dignifiedquire May 8, 2023
050e49f
fix: handle multiple transmit destinations
dignifiedquire May 8, 2023
b7e1595
fixup doc comment
dignifiedquire May 8, 2023
fd1be6f
Merge pull request #978 from n0-computer/x-hp-linux
dignifiedquire May 8, 2023
6fb17d1
fix: allow dialing by peer id only
dignifiedquire May 8, 2023
c6c997a
insert derp addr as potential endpoint
dignifiedquire May 8, 2023
68478b0
add local derp map config
dignifiedquire May 8, 2023
027f501
don't set derp addr as best addr
dignifiedquire May 8, 2023
93ca0e4
fix: endpoint update scheduler
dignifiedquire May 8, 2023
a2435ff
build `netcheck::ProbePlan` after adjusting settings
ramfox May 8, 2023
4a745ec
ref: naming heartbeats (#982)
flub May 9, 2023
0a067f5
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire May 9, 2023
fa0cb90
Merge pull request #985 from n0-computer/x-hp-netcheck
dignifiedquire May 9, 2023
a5e532e
Use derive_more custom debug to prevent msg content from being dumped…
rklaehn May 10, 2023
b3c22bd
feat: print local endpoints on provide
dignifiedquire May 10, 2023
1c943a8
Merge pull request #991 from n0-computer/x-hp-local-endpoints
dignifiedquire May 10, 2023
7896d37
fix: cleanup ping sending logic
dignifiedquire May 10, 2023
591b76d
debugging
dignifiedquire May 10, 2023
6c2b1cf
increase channel size for derp queue
dignifiedquire May 10, 2023
ef8cf89
fix netcheck sending report
dignifiedquire May 10, 2023
178f565
Merge pull request #993 from n0-computer/x-hp-connection-close
dignifiedquire May 10, 2023
49dbaea
ref: disable to unused code (#992)
flub May 10, 2023
d0755c7
fix: send early ping if needed
dignifiedquire May 10, 2023
e768990
cleanup debug impls + more clippy (#994)
dignifiedquire May 11, 2023
383943a
update to released quinn
dignifiedquire May 11, 2023
0861b9f
deps: update to released quic-rpc
dignifiedquire May 11, 2023
99ea386
Batched derp v1 (#996)
rklaehn May 11, 2023
3ec833c
save some bytes (#998)
rklaehn May 11, 2023
1422fb1
add metrics for magicsock
dignifiedquire May 11, 2023
96903e7
feat: add configuration for derp regions
dignifiedquire May 12, 2023
2f8aeb9
ref(Conn/PeerMap): Introduce QuicMappedAddress (#1001)
flub May 12, 2023
8df032b
ref: shut up clippy (#1002)
flub May 12, 2023
178ca53
Minimal fix for the disco bug (#1004)
rklaehn May 12, 2023
e525e92
start fixing tests & CI
dignifiedquire May 12, 2023
541fb87
ref(netcheck): statically declare udp bind addresses (#1007)
flub May 13, 2023
034492c
ref(clippy): let's keep it clippy clean (#1009)
flub May 15, 2023
f6287c1
fix(derp): remove client cleanup bug
ramfox May 15, 2023
10782be
test(derp): fix test
dignifiedquire May 15, 2023
3a292e5
feat: prefer configured port to be used for ipv4
dignifiedquire May 12, 2023
f76d650
fix: improve local addr output and start fixing cli tests
dignifiedquire May 12, 2023
e13f663
refactor: update connection logic to for magicsock
dignifiedquire May 12, 2023
a2a711c
test: fix cli addr test
dignifiedquire May 15, 2023
d3f4a26
docs: fixup cargo doc
dignifiedquire May 15, 2023
ee2bafb
Merge pull request #1005 from n0-computer/x-hp-tests-2
dignifiedquire May 15, 2023
3142912
ref: Move packet building into conn (#1016)
rklaehn May 16, 2023
4fc70f5
feat: Add iroh doctor utility (#986)
rklaehn May 16, 2023
5e997a4
fix(netcheck): Do not read from main Conn sockets (#1017)
flub May 16, 2023
f9175ca
derper: add stun logs
dignifiedquire May 16, 2023
96b882a
fix: process incoming IP packets in a seperate task (#1020)
dignifiedquire May 16, 2023
e54653f
add timeout for captive portal test (#1018)
rklaehn May 17, 2023
252a04b
ref(netcheck): Log and shut down stun listeners (#1022)
flub May 17, 2023
7c87b94
fix: format socket addr so that it does not need to be escaped (#1019)
rklaehn May 17, 2023
4437d7e
ref(netcheck): Bring back the ActorMessage (#1023)
flub May 17, 2023
dbe0228
feat(conn): improve shutdown of IO loop
dignifiedquire May 17, 2023
957ff57
Merge pull request #1026 from n0-computer/x-hp-cleanup-conn-loop
dignifiedquire May 17, 2023
9e25d98
X hp test fix (#1027)
rklaehn May 18, 2023
532873f
chore: update deps
dignifiedquire May 18, 2023
3f08e30
Refactor derp handling in conn (#1031)
dignifiedquire May 19, 2023
f9d9841
Drop conn (#1029)
rklaehn May 19, 2023
a01f88b
move constants and use tokio::mpsc where possible
dignifiedquire May 19, 2023
ff28875
refactor: move derp receiving into the derp actor
dignifiedquire May 19, 2023
c858f36
fix: ensure provider building waits for an endpoint update
dignifiedquire May 19, 2023
58538e0
fix: ensure endpoints are always discovered or timeout
dignifiedquire May 19, 2023
05474df
test: cli fixes
rklaehn May 19, 2023
8c63081
clippy (#1034)
flub May 19, 2023
726b3f6
Merge pull request #1033 from n0-computer/x-hp-conn-cleanup
dignifiedquire May 19, 2023
5f03510
ref(netcheck): make netcheck a long-running actor (#1028)
flub May 19, 2023
547662b
fix: better handling of ipv4 only setups
dignifiedquire May 19, 2023
e9266b9
update deps and cargo deny
dignifiedquire May 19, 2023
2742720
allow missing deny pieces for now
dignifiedquire May 19, 2023
a4ce8e4
Merge pull request #1036 from n0-computer/x-hp-cargo-deny-1
dignifiedquire May 19, 2023
5e15c03
ci: do not fail fast for cross
dignifiedquire May 19, 2023
1c99079
fixup
dignifiedquire May 19, 2023
07d7205
feat: reduce dependency bloat for derper
dignifiedquire May 19, 2023
34322a6
fix: avoid dualstack bindings
dignifiedquire May 19, 2023
a50568d
update to own version of rustls-acme
dignifiedquire May 22, 2023
983d6e1
Merge pull request #1039 from n0-computer/x-hp-derper-acme
dignifiedquire May 22, 2023
15f824b
Merge pull request #1038 from n0-computer/x-hp-android-fixes
dignifiedquire May 22, 2023
726cace
fix(netcheck): If no STUN sockets supplied allow bind to fail (#1041)
flub May 23, 2023
55d0211
ref(metrics): Document metrics and remove macro_use (#1045)
flub May 24, 2023
c4a1890
fix: use listen_addresses instead of local_address (#1044)
rklaehn May 24, 2023
648210c
fix: add entry in peer_map for unknown ping sender
rklaehn May 24, 2023
fba572d
chore: move CI to self hosted runners (#1040)
Arqu May 24, 2023
c34cdf7
Merge pull request #1047 from n0-computer/x-hp-fix-ping
dignifiedquire May 25, 2023
a548371
metrics(netcheck): Add the basic netcheck metrics (#1048)
flub May 25, 2023
3867b72
fix: handle hairpining timeout properly (#1049)
dignifiedquire May 25, 2023
b1fb4a6
ref(netcheck): Simplify and fix hairpinning (#1051)
flub May 30, 2023
b29fbf7
tests: Add logging to flaky google stun test (#1053)
flub May 30, 2023
7427ed0
X hp test fix (#1056)
rklaehn Jun 1, 2023
ae210a8
Switch spawning subcommands to the duct crate (#1058)
rklaehn Jun 1, 2023
fcc74b8
fix: make sure to use the config by default in iroh doctor report (#1…
rklaehn Jun 1, 2023
e27cc77
tests(ipv6): Do not run IPv6 tests if the host doesn't support IPv6 (…
flub Jun 2, 2023
4e1ba3e
fix(clippy): Clean up clippy again (#1061)
flub Jun 2, 2023
b80ef52
fix: use simulated time in timer tests
rklaehn Jun 2, 2023
8448cb6
tests: Add test utilities to configure logging (#1060)
flub Jun 2, 2023
71dcab1
ci: try latest cross (#1069)
dignifiedquire Jun 3, 2023
dcd477c
Merge remote-tracking branch 'origin/main' into x-hp
dignifiedquire Jun 5, 2023
43ff9a4
Use base32 encoding for both tickets and peer ids (#1072)
rklaehn Jun 5, 2023
3831e64
Add back the get --single functionality that has been lost during a r…
rklaehn Jun 6, 2023
a98fae8
Remove DataSource::File (#1074)
rklaehn Jun 6, 2023
bec1bbe
fix: online stun test (#1065)
rklaehn Jun 6, 2023
e0b2a9b
ref(ci): Do not use fail-fast strategy (#1076)
flub Jun 6, 2023
a89fccf
ref(ci): Do not output clippy in json format (#1080)
flub Jun 6, 2023
6df66f4
ref(ci): Deny warnings again (#1075)
flub Jun 6, 2023
4fb925a
fix(derper): small derper fixes (#1083)
flub Jun 6, 2023
36cd904
fix: update integration tests (#1082)
Arqu Jun 7, 2023
63a2529
refactor: remove BlobOrCollection (#1078)
rklaehn Jun 8, 2023
d9e3b7b
ref(build): Sort dependencies in Cargo.toml (#1081)
flub Jun 9, 2023
2f65bc1
feat: integration metrics and viz dump (#1089)
Arqu Jun 9, 2023
dd6eccb
ref(ci): Do not run cargo check separately and test all features (#1079)
flub Jun 9, 2023
daa7c0c
tests(netcheck): assume udp packets get lost (#1094)
flub Jun 9, 2023
e191500
derper: stun improvements (#1091)
dignifiedquire Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 72 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,36 @@ env:
RUSTFLAGS: -Dwarnings
MSRV: "1.65"


jobs:
build_and_test_nix:
name: Build and test (Nix)
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
name: [ubuntu-latest, macOS-arm-latest]
rust: [nightly, stable]
include:
# - name: ubuntu-arm-latest
# os: ubuntu-latest
# release-os: linux
# release-arch: aarch64
# runner: [self-hosted, linux, ARM64]
- name: ubuntu-latest
os: ubuntu-latest
release-os: linux
release-arch: amd64
runner: [self-hosted, linux, X64]
# - name: macOS-latest
# os: macOS-latest
# release-os: darwin
# release-arch: x86_64
# runner: [self-hosted, macOS, X64]
- name: macOS-arm-latest
os: macOS-latest
release-os: darwin
release-arch: aarch64
runner: [self-hosted, macOS, ARM64]

steps:
- name: Checkout
Expand All @@ -32,22 +53,23 @@ jobs:
with:
toolchain: ${{ matrix.rust }}

- name: check
run: cargo check --all --bins --tests

- name: tests
run: cargo test --all
run: cargo test --workspace --all-features --lib --bins --tests

build_and_test_windows:
name: Build and test (Windows)
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
name: [windows-latest]
rust: [nightly, stable]
target:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
include:
- name: windows-latest
os: windows
runner: [self-hosted, windows, x64]

steps:
- name: Checkout
Expand All @@ -56,21 +78,16 @@ jobs:
submodules: recursive

- name: Install ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}

run: |
rustup toolchain install ${{ matrix.rust }}
rustup toolchain default ${{ matrix.rust }}
rustup target add ${{ matrix.target }}
rustup set default-host ${{ matrix.target }}

- uses: msys2/setup-msys2@v2
- name: check
run: cargo check --all --bins --tests --target ${{ matrix.target }}

- name: check bench
if: matrix.rust == 'nightly'
run: cargo check --target ${{ matrix.target }} --benches

- name: tests
run: cargo test --all --target ${{ matrix.target }}
run: cargo test --workspace --all-features --lib --bins --tests --target ${{ matrix.target }}

build_release:
name: Build release binaries
Expand Down Expand Up @@ -170,8 +187,9 @@ jobs:

cross:
name: Cross compile
runs-on: ubuntu-latest
runs-on: [self-hosted, linux, X64]
strategy:
fail-fast: false
matrix:
target:
- i686-unknown-linux-gnu
Expand All @@ -184,18 +202,18 @@ jobs:
with:
submodules: recursive

- name: Install nightly
# See /~https://github.com/cross-rs/cross/issues/1222
uses: dtolnay/rust-toolchain@1.67
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable

- name: Install cross
run: cargo install cross
# See /~https://github.com/cross-rs/cross/issues/1222
run: cargo install cross --git /~https://github.com/cross-rs/cross

- name: check
run: cross check --all --target ${{ matrix.target }}

- name: test
run: cross test --all --target ${{ matrix.target }}
run: cross test --all --target ${{ matrix.target }} -- --test-threads=8

check_fmt_and_docs:
name: Checking fmt and docs
Expand All @@ -221,8 +239,10 @@ jobs:
with:
components: clippy

# TODO: We have a bunch of platform-dependent code so should
# probably run this job on the full platofrm matrix
- name: clippy check
run: cargo clippy --message-format=json --all-features --all-targets
run: cargo clippy --all-features --all-targets

msrv:
name: Minimal Supported Rust Version
Expand All @@ -235,7 +255,7 @@ jobs:

- name: Check MSRV all features
run: |
cargo +$MSRV check --workspace --all-targets --no-default-features
cargo +$MSRV check --workspace --all-targets --features cli

cargo_deny:
name: cargo deny
Expand Down Expand Up @@ -279,14 +299,16 @@ jobs:
- name: Copy binaries to right location
run: |
cp target/release/iroh chuck/netsim/bins/iroh
cp target/release/derper chuck/netsim/bins/derper
cp chuck/target/release/chuck chuck/netsim/bins/chuck

- name: Run tests
run: |
cd chuck/netsim
sudo kill -9 $(pgrep ovs)
sudo mn --clean
sudo python3 main.py --integration sims/standard/iroh.json
sudo python3 main.py --integration sims/iroh/iroh.json
sudo python3 main.py --integration --skip intg_derper__1_to_1_NAT_provide,intg_derper__1_to_1_NAT_both sims/integration

- name: Setup Environment (PR)
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -306,10 +328,29 @@ jobs:
cd chuck/netsim
python3 reports_csv.py --prom --commit ${{ env.LAST_COMMIT_SHA }} > report_prom.txt
python3 reports_csv.py --metro --commit ${{ env.LAST_COMMIT_SHA }} > report_metro.txt
python3 reports_csv.py --metro --integration --commit ${{ env.LAST_COMMIT_SHA }} > report_metro_integration.txt

- name: Dump report
run: |
export AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}
export AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}
export AWS_DEFAULT_REGION=us-west-2

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install --update

cd chuck/netsim

tar cvzf report.tar.gz report_prom.txt report_metro.txt report_metro_integration.txt logs/ report/ viz/
aws s3 cp ./report.tar.gz s3://${{secrets.S3_REPORT_BUCKET}}/intg_${{ env.LAST_COMMIT_SHA }}.tar.gz --no-progress

- name: Echo metrics
run: |
cd chuck/netsim
d=$(cat report_metro.txt)
metro_data=$(printf "%s\n " "$d")
echo "$metro_data"
d=$(cat report_metro_integration.txt)
metro_data=$(printf "%s\n " "$d")
echo "$metro_data"
8 changes: 7 additions & 1 deletion .github/workflows/netsim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- name: Copy binaries to right location
run: |
cp target/optimized-release/iroh chuck/netsim/bins/iroh
cp target/optimized-release/derper chuck/netsim/bins/derper
cp chuck/target/release/chuck chuck/netsim/bins/chuck

- name: Detect comment commands
Expand All @@ -92,6 +93,7 @@ jobs:
if [ -z "${c}" ];
then
sudo python3 main.py sims/iroh
sudo python3 main.py sims/integration
else
echo $c >> custom_sim.json
sudo python3 main.py custom_sim.json
Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:
cd chuck/netsim
python3 reports_csv.py --prom --commit ${{ env.LAST_COMMIT_SHA }} > report_prom.txt
python3 reports_csv.py --metro --commit ${{ env.LAST_COMMIT_SHA }} > report_metro.txt
python3 reports_csv.py --metro --integration --commit ${{ env.LAST_COMMIT_SHA }} > report_metro_integration.txt

- name: Dump report
run: |
Expand All @@ -170,7 +173,7 @@ jobs:

cd chuck/netsim

tar cvzf report.tar.gz report_prom.txt report.txt report_metro.txt logs/ report/
tar cvzf report.tar.gz report_prom.txt report.txt report_metro.txt report_metro_integration.txt logs/ report/ viz/
aws s3 cp ./report.tar.gz s3://${{secrets.S3_REPORT_BUCKET}}/${{ env.LAST_COMMIT_SHA }}.tar.gz --no-progress

instance=$(echo "${{ env.HEAD_REF }}" | tr -c '[:alnum:]' '_')
Expand All @@ -184,4 +187,7 @@ jobs:
cd chuck/netsim
d=$(cat report_metro.txt)
metro_data=$(printf "%s\n " "$d")
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{secrets.METRO_TOKEN}}" --data "$metro_data" ${{secrets.METRO_ENDPOINT}}
d=$(cat report_metro_integration.txt)
metro_data=$(printf "%s\n " "$d")
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{secrets.METRO_TOKEN}}" --data "$metro_data" ${{secrets.METRO_ENDPOINT}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
iroh.config.toml
Loading