From b08eb217940abb9fee436cfb4008619e59a3c8b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:54:37 +0000 Subject: [PATCH 1/5] deps: bump unsigned-varint from 0.7.1 to 0.7.2 Pull-Request: #4480. --- Cargo.lock | 4 ++-- protocols/gossipsub/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ca2844dd39..0e805693a81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6028,9 +6028,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 01902ae1a43..813924ecc81 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -36,7 +36,7 @@ regex = "1.9.5" serde = { version = "1", optional = true, features = ["derive"] } sha2 = "0.10.7" smallvec = "1.11.0" -unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] } +unsigned-varint = { version = "0.7.2", features = ["asynchronous_codec"] } void = "1.0.2" # Metrics dependencies From 3609423628d2dd84446b3bb23064f6740f8a4c78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:53:24 +0000 Subject: [PATCH 2/5] deps: bump trybuild from 1.0.83 to 1.0.84 Pull-Request: #4471. --- Cargo.lock | 4 ++-- swarm/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e805693a81..41f142cba5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5914,9 +5914,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "trybuild" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df60d81823ed9c520ee897489573da4b1d79ffbe006b8134f46de1a1aa03555" +checksum = "a5c89fd17b7536f2cf66c97cff6e811e89e728ca0ed13caeed610c779360d8b4" dependencies = [ "basic-toml", "glob", diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index b739aa8dabb..ca49d92031f 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -54,7 +54,7 @@ libp2p-yamux = { path = "../muxers/yamux" } # Using `path` here because this is quickcheck = { workspace = true } void = "1" once_cell = "1.18.0" -trybuild = "1.0.83" +trybuild = "1.0.84" [[test]] name = "swarm_derive" From ae3cef14cb542975095de07a43920f999338badd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 14:13:30 +0000 Subject: [PATCH 3/5] deps: bump serde_json from 1.0.105 to 1.0.106 Pull-Request: #4481. --- Cargo.lock | 4 ++-- misc/keygen/Cargo.toml | 2 +- protocols/request-response/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41f142cba5a..5f5c4fa3114 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5115,9 +5115,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" dependencies = [ "indexmap 2.0.0", "itoa", diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 0105c041b7e..a24a7fa83a8 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -13,7 +13,7 @@ publish = false clap = { version = "4.3.23", features = ["derive"] } zeroize = "1" serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.105" +serde_json = "1.0.106" libp2p-core = { workspace = true } base64 = "0.21.3" libp2p-identity = { workspace = true } diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 0db687592f7..33df77f0a13 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -20,7 +20,7 @@ libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } rand = "0.8" serde = { version = "1.0", optional = true} -serde_json = { version = "1.0.105", optional = true } +serde_json = { version = "1.0.106", optional = true } smallvec = "1.11.0" void = "1.0.2" log = "0.4.20" From ce8f38cc161f2a3bb4b74458baf7e53bba62fa6e Mon Sep 17 00:00:00 2001 From: Mario Camou Date: Mon, 11 Sep 2023 18:51:54 +0200 Subject: [PATCH 4/5] feat(misc/server): add `libp2p-lookup` to `rust-libp2p-server` As mentioned in #4444, we need to include https://github.com/mxinden/libp2p-lookup/ in the image so that we can enable a healthcheck when it starts up. Pull-Request: #4466. --- Cargo.lock | 2 +- Cargo.toml | 2 +- misc/server/CHANGELOG.md | 4 ++++ misc/server/Cargo.toml | 2 +- misc/server/Dockerfile | 8 ++++++-- misc/server/README.md | 6 ++++++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f5c4fa3114..e49ec51f6ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3155,7 +3155,7 @@ dependencies = [ [[package]] name = "libp2p-server" -version = "0.12.2" +version = "0.12.3" dependencies = [ "base64 0.21.3", "clap", diff --git a/Cargo.toml b/Cargo.toml index 155b25771e5..55258267fec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ libp2p-quic = { version = "0.9.2", path = "transports/quic" } libp2p-relay = { version = "0.16.1", path = "protocols/relay" } libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" } libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" } -libp2p-server = { version = "0.12.2", path = "misc/server" } +libp2p-server = { version = "0.12.3", path = "misc/server" } libp2p-swarm = { version = "0.43.4", path = "swarm" } libp2p-swarm-derive = { version = "0.33.0", path = "swarm-derive" } libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" } diff --git a/misc/server/CHANGELOG.md b/misc/server/CHANGELOG.md index 8bb5768822c..d7c8f71d033 100644 --- a/misc/server/CHANGELOG.md +++ b/misc/server/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.12.3] - unreleased +### Changed +- Add libp2p-lookup to Dockerfile to enable healthchecks. + ## [0.12.2] ### Fixed - Adhere to `--metrics-path` flag and listen on `0.0.0.0:8888` (default IPFS metrics port). diff --git a/misc/server/Cargo.toml b/misc/server/Cargo.toml index 32b815c407a..aa259ce8214 100644 --- a/misc/server/Cargo.toml +++ b/misc/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-server" -version = "0.12.2" +version = "0.12.3" authors = ["Max Inden "] edition = "2021" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/misc/server/Dockerfile b/misc/server/Dockerfile index 34f0c7d0bf9..72641cc3b2e 100644 --- a/misc/server/Dockerfile +++ b/misc/server/Dockerfile @@ -1,8 +1,12 @@ -FROM rust:1.66-bullseye as builder +FROM rust:1.72-bullseye as builder WORKDIR /usr/src/rust-libp2p-server # Run with access to the target cache to speed up builds WORKDIR /workspace + +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + cargo install --locked --root /usr/local libp2p-lookup --version 0.6.4 + ADD . . RUN --mount=type=cache,target=./target \ --mount=type=cache,target=/usr/local/cargo/registry \ @@ -12,5 +16,5 @@ RUN --mount=type=cache,target=./target \ mv ./target/release/libp2p-server /usr/local/bin/libp2p-server FROM gcr.io/distroless/cc -COPY --from=builder /usr/local/bin/libp2p-server /usr/local/bin/libp2p-server +COPY --from=builder /usr/local/bin/libp2p-server /usr/local/bin/libp2p-lookup /usr/local/bin/ CMD ["libp2p-server"] diff --git a/misc/server/README.md b/misc/server/README.md index ec4012562a2..0da1bd8abd9 100644 --- a/misc/server/README.md +++ b/misc/server/README.md @@ -33,3 +33,9 @@ Local peer id: PeerId("12D3KooWSa1YEeQVSwvoqAMhwjKQ6kqZQckhWPb3RWEGV3sZGU6Z") Listening on "/ip4/127.0.0.1/udp/4001/quic" [...] ``` + +The Docker container includes [libp2-lookup](https://github.com/mxinden/libp2p-lookup/) to enable adding a proper healthcheck for container startup, e.g. + +``` shell +docker run --health-cmd 'libp2p-lookup direct --address /ip4/127.0.0.1/tcp/4001/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa' /home/ipfs/.ipfs:/ipfs ghcr.io/libp2p/rust-libp2p-server --config /ipfs/config +``` From 240019f8099142354173d252bbb9d6fffd40be0f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 12 Sep 2023 06:53:38 +1000 Subject: [PATCH 5/5] deps: update webpki to `0.22.1` A simple update to our lockfile to help fix #4375. Pull-Request: #4483. --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e49ec51f6ab..23a5b4d29e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4882,7 +4882,7 @@ dependencies = [ "log", "ring", "sct 0.7.0", - "webpki 0.22.0", + "webpki 0.22.1", ] [[package]] @@ -5704,7 +5704,7 @@ checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.8", "tokio", - "webpki 0.22.0", + "webpki 0.22.1", ] [[package]] @@ -6286,9 +6286,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" dependencies = [ "ring", "untrusted",