Skip to content

Commit

Permalink
e2e: Replace ephemeral peer with linkd
Browse files Browse the repository at this point in the history
Now that a binary exists which drives the core protocol and has all the
knobs exposed that the e2e network tests want to turn there is no need
anymore for the ad-hocish epehmeral peer implementation.

This concludes the first chapter of linkd's development as the declared
goal of gaining some confidence through at the integration layer for it
succeeded.

Signed-off-by: Alexander Simmerl <[email protected]>
  • Loading branch information
xla committed Sep 14, 2021
1 parent 1e0dd58 commit 05164e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions e2e/Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bootstrap: cargo run --bin ephemeral-peer -- --secret-key hIfobTmxKMemyXPOC8EmUNdufwi2MsKucEB9EikOyDE --listen 127.0.0.1:54321
peer: sleep 5; cargo run --bin ephemeral-peer -- --bootstrap [email protected]:54321
bootstrap: cd ../bins && echo -n "hIfobTmxKMemyXPOC8EmUNdufwi2MsKucEB9EikOyDE" | cargo run -p linkd -- --signer key --key-format base64 --protocol-listen 127.0.0.1:54321 --tmp-root
peer: sleep 5; cd ../bins && cargo run -p linkd -- --signer key --key-source ephemeral --tmp-root --protocol-listen localhost --bootstrap [email protected]:54321
29 changes: 18 additions & 11 deletions e2e/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ services:
- 'graphite-exporter'
build:
context: ../
dockerfile: e2e/ephemeral-peer.dockerfile
image: ephemeral-peer
dockerfile: e2e/linkd.dockerfile
image: linkd
init: true
ports:
- '12345:12345/udp'
command: |
ephemeral-peer
--secret-key hIfobTmxKMemyXPOC8EmUNdufwi2MsKucEB9EikOyDE
--listen 0.0.0.0:12345
--graphite graphite:9109
command: bash -c 'echo -n "hIfobTmxKMemyXPOC8EmUNdufwi2MsKucEB9EikOyDE" |
linkd
--signer key
--key-format base64
--protocol-listen 0.0.0.0:12345
--tmp-root
--metrics-provider graphite
--graphite-addr graphite:9109'
environment:
- 'RUST_LOG=${RUST_LOG:-debug}'
- 'TRACING_FMT=${TRACING_FMT:-compact}'
Expand All @@ -52,15 +55,19 @@ services:
passive-peer:
depends_on:
- 'bootstrap-peer'
image: ephemeral-peer
image: linkd
init: true
ports:
- '12346/udp'
command: |
ephemeral-peer
--listen 0.0.0.0:12346
linkd
--signer key
--key-source ephemeral
--protocol-listen 0.0.0.0:12346
--tmp-root
--bootstrap hyne66jefcpkobg91qzdy6ysetr8fn3p3d6myce61uwf7s67g3i79e@bootstrap:12345
--graphite graphite:9109
--metrics-provider graphite
--graphite-addr graphite:9109
environment:
- 'RUST_LOG=${RUST_LOG:-debug}'
- 'TRACING_FMT=${TRACING_FMT:-compact}'
Expand Down
11 changes: 6 additions & 5 deletions e2e/ephemeral-peer.dockerfile → e2e/linkd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ RUN --mount=type=bind,source=.,target=/build,rw \
--mount=type=cache,target=/cache \
set -eux pipefail; \
mkdir -p /cache/target; \
ln -s /cache/target target ; \
cargo build --release --package radicle-link-e2e --bin ephemeral-peer; \
mv target/release/ephemeral-peer /ephemeral-peer
ln -s /cache/target target; \
cd bins; \
cargo build --release --package linkd; \
mv target/release/linkd /linkd

FROM debian:buster-slim
RUN set -eux; \
Expand All @@ -21,5 +22,5 @@ RUN set -eux; \
; \
apt-get autoremove; \
rm -rf /var/lib/apt/lists/*
COPY --from=build /ephemeral-peer /usr/local/bin/ephemeral-peer
CMD ["ephemeral-peer"]
COPY --from=build /linkd /usr/local/bin/linkd
CMD ["linkd"]

0 comments on commit 05164e4

Please sign in to comment.