libp2p-test-plans/ping/rust/Dockerfile

35 lines
1.2 KiB
Docker
Raw Normal View History

ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
FROM rust:1.62-bullseye as builder
WORKDIR /usr/src/testplan
RUN apt-get update && apt-get install -y cmake protobuf-compiler
ARG PLAN_PATH="./"
RUN mkdir -p ./plan/src
COPY ./plan/${PLAN_PATH}/src/main.rs ./plan/src/main.rs
COPY ./plan/${PLAN_PATH}/Cargo.toml ./plan/Cargo.toml
COPY ./plan/${PLAN_PATH}/Cargo.lock ./plan/Cargo.lock
RUN cd ./plan/ && cargo build # Initial build acts as a cache.
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
ARG GIT_TARGET=""
RUN if [ ! -z "${GIT_TARGET}" ]; then sed -i "s,^git.*,git = \"https://${GIT_TARGET}\"," ./plan/Cargo.toml; fi
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
ARG GIT_REF=""
RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s,^rev.*,rev = \"${GIT_REF}\"," ./plan/Cargo.toml; fi
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
COPY ./plan/${PLAN_PATH}/src/lib.rs ./plan/src/lib.rs
COPY ./plan/${PLAN_PATH}/src/bin/ ./plan/src/bin/
# Build the requested binary: Cargo will update lockfile on changed manifest (i.e. if one of the above `sed`s patched it).
ARG BINARY_NAME
RUN cd ./plan/ \
&& cargo build --bin=${BINARY_NAME} \
&& mv /usr/src/testplan/plan/target/debug/${BINARY_NAME} /usr/local/bin/testplan
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
FROM debian:bullseye-slim
COPY --from=builder /usr/local/bin/testplan /usr/local/bin/testplan
ping/rust: introduce rust cross-version test (#26) * ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-22 10:25:07 +00:00
EXPOSE 6060
ENV RUST_BACKTRACE=1
ENTRYPOINT ["testplan"]