Max Inden 9d1116fd5d
feat(perf): implement libp2p perf protocol
Implementation of the libp2p perf protocol according to https://github.com/libp2p/specs/pull/478/.

//CC @MarcoPolo  as the author of the specification.

**Don't (yet) expect this to produce reliable performance metrics.**

Pull-Request: #3508.
2023-03-19 18:20:42 +00:00

23 lines
711 B
Docker

# syntax=docker/dockerfile:1.5-labs
FROM rust:1.67.0 as builder
# Run with access to the target cache to speed up builds
WORKDIR /workspace
ADD . .
RUN --mount=type=cache,target=./target \
--mount=type=cache,target=/usr/local/cargo/registry \
cargo build --release --package libp2p-perf
RUN --mount=type=cache,target=./target \
mv ./target/release/perf-server /usr/local/bin/perf-server
RUN --mount=type=cache,target=./target \
mv ./target/release/perf-client /usr/local/bin/perf-client
FROM debian:bullseye-slim
COPY --from=builder /usr/local/bin/perf-server /usr/local/bin/perf-server
COPY --from=builder /usr/local/bin/perf-client /usr/local/bin/perf-client
ENTRYPOINT [ "perf-server"]