From 6ef9e85b796efdc4f2ad22114c9532facba55bfa Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 7 Jun 2023 10:35:18 +0200 Subject: [PATCH 01/13] Add goth test_e2e_outbound_perf This test deploys an outbound-test image (see assets/test_e2e_outbound_perf) which runs outbound diagnostics at parameters specified in the python test. Then the correct results are asserted in the test. Payment / invoicing are omitted from testing because other integration tests already cover those and this test is already rather long. --- .../test_e2e_outbound_perf/image/.gitignore | 2 + .../test_e2e_outbound_perf/image/Dockerfile | 14 + .../test_e2e_outbound_perf/image/Makefile | 7 + .../image/entrypoint.sh | 3 + .../image/manifest.json | 47 + .../image/outbound-bench/.gitignore | 3 + .../image/outbound-bench/Cargo.lock | 1318 +++++++++++++++++ .../image/outbound-bench/Cargo.toml | 15 + .../image/outbound-bench/src/main.rs | 232 +++ .../test_e2e_outbound_perf/image/output.json | 0 .../outbound_certificate.cert | 29 + .../outbound_signature.sha256.base64 | 1 + goth_tests/e2e/vm/test_e2e_outbound_perf.py | 135 ++ goth_tests/poetry.lock | 8 +- goth_tests/pyproject.toml | 2 +- 15 files changed, 1811 insertions(+), 5 deletions(-) create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/.gitignore create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Dockerfile create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Makefile create mode 100755 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/.gitignore create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.lock create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.toml create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_certificate.cert create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_signature.sha256.base64 create mode 100644 goth_tests/e2e/vm/test_e2e_outbound_perf.py diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/.gitignore b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/.gitignore new file mode 100644 index 0000000000..2190a1b62b --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/.gitignore @@ -0,0 +1,2 @@ +docker-outbound-* +key.pem \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Dockerfile b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Dockerfile new file mode 100644 index 0000000000..0f07be59ea --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:22.04 + +RUN apt update \ + && apt install -y libssl-dev ca-certificates \ + && update-ca-certificates \ + && apt install -y iperf3 + +COPY outbound-bench/target/release/outbound-bench /usr/bin/outbound-bench +COPY entrypoint.sh /golem/entrypoints/entrypoint.sh + +RUN chmod +x /usr/bin/outbound-bench +RUN chmod +x /golem/entrypoints/entrypoint.sh + +VOLUME /golem/work /golem/output /golem/resource \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Makefile b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Makefile new file mode 100644 index 0000000000..0609fc0193 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/Makefile @@ -0,0 +1,7 @@ +build: + cargo build --release --manifest-path=outbound-bench/Cargo.toml + docker build -t outbound-test-v5 . + gvmkit-build outbound-test-v5 + +push: build + gvmkit-build outbound-test-v5 --push \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh new file mode 100755 index 0000000000..352b99dd8f --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "/usr/bin/outbound-bench --addr $1 --port-echo $2 --port-sink $3 --port-iperf $4 --mib-per-sec $5 --requests-count $6 --stages $7" > /golem/output/output.json \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json new file mode 100644 index 0000000000..20b9d0cda5 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json @@ -0,0 +1,47 @@ +{ + "version": "0.1.0", + "createdAt": "2023-06-01T12:00:00.000000Z", + "expiresAt": "2100-01-01T00:01:00.000000Z", + "metadata": { + "name": "outbound testing utility", + "description": "Used by the test_e2e_outbound_perf goth test in yagna", + "version": "0.1.0" + }, + "payload": [ + { + "platform": { + "arch": "x86_64", + "os": "linux" + }, + "urls": [ + "http://yacn2.dev.golem.network:8000/docker-outbound-test-v5-latest-3b2d8f2052.gvmi" + ], + "hash": "sha3:9fbc07c722a966302ed4af7d6f4efaa5a33e886ba051fe83a3a0e203" + } + ], + "compManifest": { + "version": "0.1.0", + "script": { + "commands": [ + "run .*outbound-bench.*", + "run .*iperf3.*", + "run .*entrypoint.sh.*", + "transfer .*output.json" + ], + "match": "regex" + }, + "net": { + "inet": { + "out": { + "protocols": [ + "http", + "https" + ], + "unrestricted": { + "urls": true + } + } + } + } + } +} \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/.gitignore b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/.gitignore new file mode 100644 index 0000000000..974a0e84a1 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/.gitignore @@ -0,0 +1,3 @@ +target/ +output.json +iperf.log \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.lock b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.lock new file mode 100644 index 0000000000..0abb9839b9 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.lock @@ -0,0 +1,1318 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80672091db20273a15cf9fdd4e47ed43b5091ec9841bf4c6145c9dfbbcae09ed" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1458a1df40e1e2afebb7ab60ce55c1fa8f431146205aa5f4887e0b111c27636" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "h2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "outbound-bench" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "rand", + "reqwest", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustix" +version = "0.37.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.toml b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.toml new file mode 100644 index 0000000000..5f17dba732 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/Cargo.toml @@ -0,0 +1,15 @@ +[workspace] + +[package] +name = "outbound-bench" +version = "0.1.0" +edition = "2021" + +[dependencies] +clap = { version = "4.3.4", features = ["derive"] } +rand = "0.8.5" +serde = { version = "1.0.164", features = ["derive"] } +serde_json = "1" +tokio = { version = "1.28.2", features = ["full"] } +reqwest = "0.11.18" +anyhow = "1.0.71" \ No newline at end of file diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs new file mode 100644 index 0000000000..ceb1e399dd --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs @@ -0,0 +1,232 @@ +use std::{ + error::Error, + io::{Read, Write}, + net::TcpStream, + process, thread, + time::{Duration, Instant}, +}; + +use clap::Parser; +use rand::{seq::SliceRandom, RngCore}; +use serde_json::Value; +use tokio::task::JoinSet; + +fn test_roundtrip(mib_per_s: f32, stream: &impl Fn() -> TcpStream) -> anyhow::Result { + let mib: usize = (mib_per_s * 10.0) as usize; + let mut data = vec![0u8; mib * 1024 * 1024]; + rand::thread_rng().fill_bytes(&mut data); + + let mut stream = stream(); + + let mut sender = stream.try_clone()?; + let data_send = data.clone(); + let send_handle = thread::spawn(move || sender.write_all(&data_send)); + + let mut data_recv = vec![0u8; data.len()]; + let read_handle = thread::spawn(move || -> anyhow::Result<_> { + stream.read_exact(&mut data_recv)?; + Ok(data_recv) + }); + + let timeout_s = (mib as f32) / mib_per_s; + thread::sleep(Duration::from_secs_f32(timeout_s)); + + if !read_handle.is_finished() { + return Ok(false); + } + + let recv_data = read_handle.join().unwrap()?; + + send_handle.join().unwrap()?; + + Ok(recv_data == data) +} + +fn test_stress(mib_per_s: f32, stream: &impl Fn() -> TcpStream) -> anyhow::Result { + let mut data = vec![0u8; (mib_per_s * 1024.0 * 1024.0) as usize * 8]; + rand::thread_rng().fill_bytes(&mut data); + + let mut stream = stream(); + + let tries = 4; + for _ in 0..tries { + stream.write_all(&data)?; + thread::sleep(Duration::from_secs(10)); + } + + Ok(true) +} + +fn test_iperf3(mib_per_s: f32, host: &str, port: u16) -> anyhow::Result { + let mut iperf3 = process::Command::new("iperf3") + .arg("-p") + .arg(port.to_string()) + .arg("--json") + .arg("-c") + .arg(host) + .arg("-t") + .arg("5") + .arg("--logfile") + .arg("iperf.log") + .spawn()?; + + iperf3.wait()?; + + let log_text = std::fs::read_to_string("iperf.log")?; + + let mut first_json = String::new(); + let mut lines = log_text.lines(); + first_json.push_str(lines.next().unwrap()); + for line in lines { + if line.starts_with('{') { + break; + } else { + first_json.push_str(line); + } + } + + let json: Value = serde_json::from_str(&first_json)?; + + let bits_per_second = move || -> Option { + json.as_object()? + .get("end")? + .as_object()? + .get("sum_sent")? + .as_object()? + .get("bits_per_second")? + .as_f64() + }() + .ok_or(anyhow::anyhow!("malformed json"))?; + + Ok(bits_per_second as f32 >= mib_per_s * 1024.0 * 1024.0 * 8.0) +} + +fn test_many_reqs(total_reqs: usize, max_secs: f32) -> anyhow::Result { + let requests = [ + "https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/walltime-info.json?now=1528962473468.679.0000000000873", + "http://worldtimeapi.org/api/timezone", + "https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam", + "http://www.7timer.info/bin/api.pl?lon=113.17&lat=23.09&product=astro&output=xml", + ]; + + let mut requests_to_run = Vec::new(); + for request in requests { + for _ in 0..(total_reqs / requests.len()) { + requests_to_run.push(request); + } + } + while requests_to_run.len() < total_reqs { + requests_to_run.push(requests[0]); + } + + requests_to_run.shuffle(&mut rand::thread_rng()); + + let started_at = Instant::now(); + let result = tokio::runtime::Runtime::new() + .unwrap() + .block_on(async move { + let mut set = JoinSet::new(); + for url in requests_to_run { + set.spawn(reqwest::get(url)); + } + + while let Some(res) = set.join_next().await { + res??; + } + + Ok::<(), Box>(()) + }); + + Ok(result.is_ok() && started_at.elapsed().as_secs_f32() < max_secs) +} + +#[derive(Parser, Debug)] +#[command(author = "Golem Factory", version = "0.1.0", about = None, long_about = None)] +struct Args { + #[arg(long, help = "host running the server", default_value_t = String::from("127.0.0.1"))] + addr: String, + #[arg(long, help = "port with the echo service", default_value_t = 2235)] + port_echo: u16, + #[arg(long, help = "port with the sink service", default_value_t = 2236)] + port_sink: u16, + #[arg(long, help = "port with the iperf3 service", default_value_t = 2237)] + port_iperf: u16, + #[arg( + long, + help = "throughput for the throughput, iperf3 and stress tests", + default_value_t = 1.0 + )] + mib_per_sec: f32, + #[arg( + long, + help = "number of requests for the requests tests", + default_value_t = 20 + )] + requests_count: usize, + #[arg(long, help = "only do first tests", default_value_t = 4)] + stages: usize, +} + +#[derive(serde::Serialize)] +struct Output { + roundtrip: Result, + many_reqs: Result, + iperf3: Result, + stress: Result, +} + +fn main() { + let Args { + addr, + port_echo, + port_sink, + port_iperf, + mib_per_sec, + requests_count, + stages, + } = Args::parse(); + + let stream_echo = || TcpStream::connect(format!("{addr}:{port_echo}")).unwrap(); + let stream_sink = || TcpStream::connect(format!("{addr}:{port_sink}")).unwrap(); + + let test_roundtrip_result = if stages >= 1 { + let result = test_roundtrip(mib_per_sec, &stream_echo); + eprintln!("{:?}", result); + result + } else { + Err(anyhow::anyhow!("skipped")) + }; + + let test_many_reqs_result = if stages >= 2 { + let result = test_many_reqs(requests_count, requests_count as f32); + eprintln!("{:?}", result); + result + } else { + Err(anyhow::anyhow!("skipped")) + }; + + let test_iperf3_result = if stages >= 3 { + let result = test_iperf3(mib_per_sec, &addr, port_iperf); + eprintln!("{:?}", result); + result + } else { + Err(anyhow::anyhow!("skipped")) + }; + + let test_stress_result = if stages >= 4 { + let result = test_stress(mib_per_sec, &stream_sink); + eprintln!("{:?}", result); + result + } else { + Err(anyhow::anyhow!("skipped")) + }; + + let output = Output { + roundtrip: test_roundtrip_result.map_err(|e| e.to_string()), + many_reqs: test_many_reqs_result.map_err(|e| e.to_string()), + iperf3: test_iperf3_result.map_err(|e| e.to_string()), + stress: test_stress_result.map_err(|e| e.to_string()), + }; + + println!("{}", serde_json::to_string(&output).unwrap()); +} diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_certificate.cert b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_certificate.cert new file mode 100644 index 0000000000..f77bb5a66f --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_certificate.cert @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIE6DCCA9CgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgYMxCzAJBgNVBAYTAlBM +MRMwEQYDVQQIDApNYWxvcG9sc2thMQ8wDQYDVQQKDAZGb28gQ28xFTATBgNVBAsM +DEZvbyBJbnRlciBIUTESMBAGA1UEAwwJRm9vIEludGVyMSMwIQYJKoZIhvcNAQkB +FhRvZmZpY2VAaW50ZXIuZm9vLmNvbTAgFw0yMjA4MTAxMjA1MjJaGA8yMTIyMDcx +NzEyMDUyMlowgY8xCzAJBgNVBAYTAkNaMRAwDgYDVQQIDAdCb2hlbWlhMQ8wDQYD +VQQHDAZQcmFndWUxEzARBgNVBAoMCkZvbyBSZXEgQ28xEzARBgNVBAsMCkZvbyBS +ZXEgSFExEDAOBgNVBAMMB0ZvbyBSZXExITAfBgkqhkiG9w0BCQEWEm9mZmljZUBy +ZXEuZm9vLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbEu3AR +1V7cNu1z1N/CqQa7wfkRftMIwDj8Y22CIi6m87IA7smE4V4xMeAkJ0GKtO2WZInm +rNVDJPoeuqcKV+tk3wLStX8ut2Nl8u/+1CrTtrWB5Z/N6O6701vUU375DWVyrG+h +Z9zcmbLVAdi/azBuUWbqcU/NnxByJOFyWXBPMpBGKAcOJTgniQQ2NYURWh5frUo0 +w1xwgviZk596kHo1t57kkx3q9eRxygpKmnKmMgR9pYk8ZSZrOtW+c5ayEau2TmSQ +j+OA9Zu3Ec93IyS4bIbH6QChmB0I+ai8U97HLaR0UeEGeeiQZ9nKlyImOyIpuvuw +PevrGXfqUDheTcUCAwEAAaOCAVQwggFQMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEB +BAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVuU1NMIEdlbmVyYXRlZCBTZXJ2ZXIg +Q2VydGlmaWNhdGUwHQYDVR0OBBYEFKIuFI+TpSYHsit9mHqczL8a12+gMIG2BgNV +HSMEga4wgauAFPCS+f1ciYIsWn/tB8xFYkLcgSvIoYGOpIGLMIGIMQswCQYDVQQG +EwJQTDETMBEGA1UECAwKTWFsb3BvbHNrYTEPMA0GA1UEBwwGS3Jha293MQ8wDQYD +VQQKDAZGb28gQ28xEjAQBgNVBAsMCUZvbyBDbyBIUTEPMA0GA1UEAwwGRm9vIENv +MR0wGwYJKoZIhvcNAQkBFg5vZmZpY2VAZm9vLmNvbYICEAAwDgYDVR0PAQH/BAQD +AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQCKh/he +NHlFPyvWZZX48eCd54FFCsk4znR+oBY1aW1jw+7AFqKxqEfecdJR+uC+s0KVcaRQ +Z6Fq50icTEK7+Tf4s4Lc//+NJ/vPB1wVk5mQwvroTSqfn9tCucE/x0kAII/4BjYz +JQCrfyrUiCmPh0MoA6wCDb6ZLCC7NQfVAn7dY4uoZ3Nl4wMoH8jRUhXhtJ670OzF +ZBsisHpJKtRibd9Cocr4twoMAMnwi/y45f8H/2VoEvsJw0CcM0+qPQejJcr1xyMP +1fLBcMLyixcP5f1/9sYTaAczNE4yMQxOCKhgfpWpa5chUSazGdgjPf4DZ/ARA+0X +02c+thLU+W1GdmHS +-----END CERTIFICATE----- diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_signature.sha256.base64 b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_signature.sha256.base64 new file mode 100644 index 0000000000..a5e342a242 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/outbound_signature.sha256.base64 @@ -0,0 +1 @@ +mHzoxwa1CZgIWBeHauoUKZPvTuifVVS4CNGI6/Lqf2jErYNUs+RxVZZ7KSmaahjmXRdTwzbO15r1PFGbbVaCmywZ45EENRi57gzyD1654Z8YRsz/paEjFWQkGmIkAFTwUlZQ7xwTp26yCusKtmIn6jnDXQXNvTaCUQgQ2Hyaz0Fva7r+pT3YW1nufeG9enY650UIuamltrzOwXrqE6tOFDUgk5b0u60nUwkC2vmVqjCynKR+0Tp5GDpv560GHIvHbdBC4SZnPDpmgAo642sQ/27Gh54XlIHrK+fFN0q+y5ACbALuARL5BtTJoKnJGpAGs31Oq5xPcTftDWV70GKiqA== \ No newline at end of file diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py new file mode 100644 index 0000000000..73dd03dbd3 --- /dev/null +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -0,0 +1,135 @@ +"""End to end tests for requesting VM tasks using goth REST API client.""" + +import json +import logging +import os +import base64 +from pathlib import Path +from typing import List + +import pytest + +from goth.address import ( + PROXY_HOST, + YAGNA_REST_URL, +) +from goth.configuration import load_yaml, Override +from goth.node import node_environment +from goth.runner import Runner +from goth.runner.container.payment import PaymentIdPool +from goth.runner.container.yagna import YagnaContainerConfig +from goth.runner.probe import RequestorProbe + +from goth_tests.helpers.activity import vm_exe_script_outbound +from goth_tests.helpers.negotiation import DemandBuilder, negotiate_agreements +from goth_tests.helpers.probe import ProviderProbe + +logger = logging.getLogger("goth.test.outbound_perf") + +def vm_exe_script(runner: Runner, addr: str, output_file: str): + """VM exe script builder.""" + """Create a VM exe script for running a outbound task.""" + + output_path = Path(runner.web_root_path) / output_file + if output_path.exists(): + os.remove(output_path) + + web_server_addr = f"http://{runner.host_address}:{runner.web_server_port}" + + return [ + {"deploy": {}}, + {"start": {}}, + {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '0']}}, + { + "transfer": { + "from": f"container:/golem/output/output.json", + "to": f"{web_server_addr}/upload/{output_file}", + } + }, + ] + +@pytest.mark.asyncio +async def test_e2e_outbound_perf( + common_assets: Path, + default_config: Path, + config_overrides: List[Override], + log_dir: Path, +): + """Test successful flow requesting a task using outbound network feature. X.509 cert negotiation scenario.""" + + goth_config = load_yaml(default_config, config_overrides) + + runner = Runner( + base_log_dir=log_dir, + compose_config=goth_config.compose_config, + web_root_path=Path(__file__).parent / "assets", + ) + + async with runner(goth_config.containers): + server_addr = None + for info in runner.get_container_info().values(): + if 'outbound-test' in info.aliases: + server_addr = info.address + break + assert(server_addr is not None, "Can't find container `outbound-test`") + logger.info("outbound-test container found at %s", server_addr) + + requestor = runner.get_probes(probe_type=RequestorProbe)[0] + provider = runner.get_probes(probe_type=ProviderProbe)[0] + + manifest = open(f"{runner.web_root_path}/test_e2e_outbound_perf/image/manifest.json").read() + signature = open(f"{runner.web_root_path}/test_e2e_outbound_perf/outbound_signature.sha256.base64").read() + certificate = open(f"{runner.web_root_path}/test_e2e_outbound_perf/outbound_certificate.cert").read() + + # Market + demand = ( + DemandBuilder(requestor) + .props_from_template(task_package = None) + .property("golem.srv.comp.payload", base64.b64encode(manifest.encode()).decode()) + .property("golem.srv.comp.payload.sig", signature) + .property("golem.srv.comp.payload.sig.algorithm", "sha256") + .property("golem.srv.comp.payload.cert", base64.b64encode(certificate.encode()).decode()) + .constraints("(&(golem.runtime.name=vm))") + .build() + ) + + agreement_providers = await negotiate_agreements( + requestor, + demand, + [provider], + lambda proposal: proposal.properties.get("golem.runtime.name") == "vm", + ) + + agreement_id, provider = agreement_providers[0] + + # Activity + + output_file = "output.json" + output_path = Path(runner.web_root_path) / "upload" / output_file + + exe_script = vm_exe_script(runner, server_addr, output_file) + print(exe_script) + + num_commands = len(exe_script) + + logger.info("Running activity on %s", provider.name) + activity_id = await requestor.create_activity(agreement_id) + await provider.wait_for_exeunit_started() + batch_id = await requestor.call_exec(activity_id, json.dumps(exe_script)) + await requestor.collect_results( + activity_id, batch_id, num_commands, timeout=300 + ) + await requestor.destroy_activity(activity_id) + await provider.wait_for_exeunit_finished() + + assert output_path.is_file() + assert len(output_path.read_text()) > 0 + + output_text = open(output_path).read() + logger.info('Received %s', output_text) + output_json = json.loads(output_text) + logger.info('Parsed as %s', output_json) + assert 'Ok' in output_json['roundtrip'] + assert 'Ok' in output_json['many_reqs'] + assert 'Ok' in output_json['iperf3'] + assert 'Ok' in output_json['stress'] diff --git a/goth_tests/poetry.lock b/goth_tests/poetry.lock index 44758276e0..c1506b5538 100644 --- a/goth_tests/poetry.lock +++ b/goth_tests/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -757,8 +757,8 @@ ya-aioclient = "^0.6" [package.source] type = "git" url = "https://github.com/golemfactory/goth.git" -reference = "master" -resolved_reference = "7decfb8717e75070dceafbb48c5069c0ea5bc4c9" +reference = "da45f6c803481286627ec0fe9a079639e2d9b8bc" +resolved_reference = "da45f6c803481286627ec0fe9a079639e2d9b8bc" [[package]] name = "h11" @@ -2315,4 +2315,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8.0" -content-hash = "d5b6c5a1bfbc18bb35d60c6d8d0f03f16145e9ca99dc35a8a98b54042713848a" +content-hash = "f5fd5988ef511813721584e4ab771e78d0acc33f640760145ddefa0f05965732" diff --git a/goth_tests/pyproject.toml b/goth_tests/pyproject.toml index e0e9fd090b..25a2d4f753 100644 --- a/goth_tests/pyproject.toml +++ b/goth_tests/pyproject.toml @@ -23,7 +23,7 @@ pytest-asyncio = "^0.20.2" pytest-rerunfailures = "^10.3" #goth = "^0.11" # to use development goth version uncomment below -goth = { git = "https://github.com/golemfactory/goth.git", rev = "d2951a62e2a7cf0712f7f4a66c4a080777841611" } +goth = { git = "https://github.com/golemfactory/goth.git", rev = "da45f6c803481286627ec0fe9a079639e2d9b8bc" } [tool.poetry.dev-dependencies] black = "^20.8b1" From 52f50ec559adb139881489cfcc2e6460d2b0eb8b Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Tue, 20 Jun 2023 10:01:16 +0200 Subject: [PATCH 02/13] Refactor test_e2e_outbound_perf --- .../image/outbound-bench/src/main.rs | 51 +++++++++++-------- .../test_e2e_outbound_perf/image/output.json | 0 2 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs index ceb1e399dd..00bfb11be8 100644 --- a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/outbound-bench/src/main.rs @@ -12,7 +12,9 @@ use serde_json::Value; use tokio::task::JoinSet; fn test_roundtrip(mib_per_s: f32, stream: &impl Fn() -> TcpStream) -> anyhow::Result { - let mib: usize = (mib_per_s * 10.0) as usize; + const MAX_TIME_SECS: f32 = 10.0; + + let mib: usize = (mib_per_s * MAX_TIME_SECS) as usize; let mut data = vec![0u8; mib * 1024 * 1024]; rand::thread_rng().fill_bytes(&mut data); @@ -28,8 +30,7 @@ fn test_roundtrip(mib_per_s: f32, stream: &impl Fn() -> TcpStream) -> anyhow::Re Ok(data_recv) }); - let timeout_s = (mib as f32) / mib_per_s; - thread::sleep(Duration::from_secs_f32(timeout_s)); + thread::sleep(Duration::from_secs_f32(MAX_TIME_SECS)); if !read_handle.is_finished() { return Ok(false); @@ -57,6 +58,27 @@ fn test_stress(mib_per_s: f32, stream: &impl Fn() -> TcpStream) -> anyhow::Resul Ok(true) } +/// make iperf3 output conform to actual JSON +/// +/// iperf3 --json actually outputs several json objects +/// concatenated, which will be (correctly) rejected by serde_json +/// due to trailing input. This function takes the first of the several +/// objects which contains everything we care about. +fn sanitize_iper3_output(text: &str) -> String { + let mut first_json = String::new(); + let mut lines = text.lines(); + first_json.push_str(lines.next().unwrap()); + for line in lines { + if line.starts_with('{') { + break; + } else { + first_json.push_str(line); + } + } + + first_json +} + fn test_iperf3(mib_per_s: f32, host: &str, port: u16) -> anyhow::Result { let mut iperf3 = process::Command::new("iperf3") .arg("-p") @@ -73,19 +95,9 @@ fn test_iperf3(mib_per_s: f32, host: &str, port: u16) -> anyhow::Result { iperf3.wait()?; let log_text = std::fs::read_to_string("iperf.log")?; + let json_text = sanitize_iper3_output(&log_text); - let mut first_json = String::new(); - let mut lines = log_text.lines(); - first_json.push_str(lines.next().unwrap()); - for line in lines { - if line.starts_with('{') { - break; - } else { - first_json.push_str(line); - } - } - - let json: Value = serde_json::from_str(&first_json)?; + let json: Value = serde_json::from_str(&json_text)?; let bits_per_second = move || -> Option { json.as_object()? @@ -110,13 +122,8 @@ fn test_many_reqs(total_reqs: usize, max_secs: f32) -> anyhow::Result { ]; let mut requests_to_run = Vec::new(); - for request in requests { - for _ in 0..(total_reqs / requests.len()) { - requests_to_run.push(request); - } - } - while requests_to_run.len() < total_reqs { - requests_to_run.push(requests[0]); + for i in 0..total_reqs { + requests_to_run.push(requests[i % requests.len()]); } requests_to_run.shuffle(&mut rand::thread_rng()); diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/output.json deleted file mode 100644 index e69de29bb2..0000000000 From 29212ee1aba0981bf23b1977f04f79d77ffc2370 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Tue, 20 Jun 2023 10:06:38 +0200 Subject: [PATCH 03/13] change dev entrypoint.sh to the intended one --- .../e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh index 352b99dd8f..aa02812eda 100755 --- a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/bash -echo "/usr/bin/outbound-bench --addr $1 --port-echo $2 --port-sink $3 --port-iperf $4 --mib-per-sec $5 --requests-count $6 --stages $7" > /golem/output/output.json \ No newline at end of file +/usr/bin/outbound-bench --addr $1 --port-echo $2 --port-sink $3 --port-iperf $4 --mib-per-sec $5 --requests-count $6 --stages $7 > /golem/output/output.json \ No newline at end of file From 4c57fa56d5b154939a22c2c556f5a912cd4a5c7d Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 21 Jun 2023 07:40:39 +0200 Subject: [PATCH 04/13] bump goth --- goth_tests/poetry.lock | 6 +++--- goth_tests/pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/goth_tests/poetry.lock b/goth_tests/poetry.lock index c1506b5538..fde259ce10 100644 --- a/goth_tests/poetry.lock +++ b/goth_tests/poetry.lock @@ -757,8 +757,8 @@ ya-aioclient = "^0.6" [package.source] type = "git" url = "https://github.com/golemfactory/goth.git" -reference = "da45f6c803481286627ec0fe9a079639e2d9b8bc" -resolved_reference = "da45f6c803481286627ec0fe9a079639e2d9b8bc" +reference = "866e75a0812957ff9f5155534c0e433e401dcff4" +resolved_reference = "866e75a0812957ff9f5155534c0e433e401dcff4" [[package]] name = "h11" @@ -2315,4 +2315,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8.0" -content-hash = "f5fd5988ef511813721584e4ab771e78d0acc33f640760145ddefa0f05965732" +content-hash = "773c92afa2ee6be899339462b1d018e597e3d936bf30df7f7411b69332db2b92" diff --git a/goth_tests/pyproject.toml b/goth_tests/pyproject.toml index 25a2d4f753..66b526d732 100644 --- a/goth_tests/pyproject.toml +++ b/goth_tests/pyproject.toml @@ -23,7 +23,7 @@ pytest-asyncio = "^0.20.2" pytest-rerunfailures = "^10.3" #goth = "^0.11" # to use development goth version uncomment below -goth = { git = "https://github.com/golemfactory/goth.git", rev = "da45f6c803481286627ec0fe9a079639e2d9b8bc" } +goth = { git = "https://github.com/golemfactory/goth.git", rev = "866e75a0812957ff9f5155534c0e433e401dcff4" } [tool.poetry.dev-dependencies] black = "^20.8b1" From 146c71261b5ae6b915bad33412f3f4259db4a43e Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Mon, 26 Jun 2023 10:18:16 +0200 Subject: [PATCH 05/13] dummy From b38cf604bcc5a9e28e6e58ee214666b9ef9f9b7e Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Jun 2023 14:25:59 +0200 Subject: [PATCH 06/13] foobar --- .../provider/rules.json | 8 +++++ goth_tests/e2e/vm/test_e2e_outbound_perf.py | 30 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 goth_tests/e2e/vm/assets/test_e2e_outbound_perf/provider/rules.json diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/provider/rules.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/provider/rules.json new file mode 100644 index 0000000000..6e14eefd91 --- /dev/null +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/provider/rules.json @@ -0,0 +1,8 @@ +{ + "outbound": { + "enabled": true, + "everyone": "all", + "audited-payload": {}, + "partner": {} + } +} \ No newline at end of file diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py index 73dd03dbd3..da436a5aaa 100644 --- a/goth_tests/e2e/vm/test_e2e_outbound_perf.py +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -57,6 +57,31 @@ async def test_e2e_outbound_perf( ): """Test successful flow requesting a task using outbound network feature. X.509 cert negotiation scenario.""" + # Test external api request just one Requestor and one Provider + nodes = [ + {"name": "requestor", "type": "Requestor", "address": "d1d84f0e28d6fedf03c73151f98df95139700aa7" }, + {"name": "provider-1", "type": "VM-Wasm-Provider", "address": "63fc2ad3d021a4d7e64323529a55a9442c444da0", "use-proxy": True}, + ] + + assets_root = Path(__file__).parent / "assets" + node_types = [ + {"name": "Requestor", "class": "goth.runner.probe.RequestorProbe"}, + { + "name": "VM-Wasm-Provider", + "class": "goth_tests.helpers.probe.ProviderProbe", + "mount": [ + {"read-only": "assets/provider/presets.json", "destination": "/root/.local/share/ya-provider/presets.json"}, + {"read-only": "assets/provider/hardware.json", "destination": "/root/.local/share/ya-provider/hardware.json"}, + {"read-write": "~/.local/share/ya-provider/vm-images", "destination": "/root/.local/share/ya-provider/exe-unit/cache"}, + {"read-write": f"{assets_root}/test_e2e_rule_partner_outbound/provider/rules.json", "destination": "/root/.local/share/ya-provider/rules.json"}, + ], + "privileged-mode": True, + }, + ] + + config_overrides.append(("nodes", nodes)) + config_overrides.append(("node-types", node_types)) + goth_config = load_yaml(default_config, config_overrides) runner = Runner( @@ -78,17 +103,12 @@ async def test_e2e_outbound_perf( provider = runner.get_probes(probe_type=ProviderProbe)[0] manifest = open(f"{runner.web_root_path}/test_e2e_outbound_perf/image/manifest.json").read() - signature = open(f"{runner.web_root_path}/test_e2e_outbound_perf/outbound_signature.sha256.base64").read() - certificate = open(f"{runner.web_root_path}/test_e2e_outbound_perf/outbound_certificate.cert").read() # Market demand = ( DemandBuilder(requestor) .props_from_template(task_package = None) .property("golem.srv.comp.payload", base64.b64encode(manifest.encode()).decode()) - .property("golem.srv.comp.payload.sig", signature) - .property("golem.srv.comp.payload.sig.algorithm", "sha256") - .property("golem.srv.comp.payload.cert", base64.b64encode(certificate.encode()).decode()) .constraints("(&(golem.runtime.name=vm))") .build() ) From 1d7eeaae0a16abebb7911a21d967bee4b152487e Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Jun 2023 14:49:05 +0200 Subject: [PATCH 07/13] foo --- .../provider/rules.json | 26 ++----------------- goth_tests/e2e/vm/test_e2e_outbound_perf.py | 2 +- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/goth_tests/e2e/vm/assets/test_e2e_rule_partner_outbound/provider/rules.json b/goth_tests/e2e/vm/assets/test_e2e_rule_partner_outbound/provider/rules.json index b306c3ca18..2cba3304b3 100644 --- a/goth_tests/e2e/vm/assets/test_e2e_rule_partner_outbound/provider/rules.json +++ b/goth_tests/e2e/vm/assets/test_e2e_rule_partner_outbound/provider/rules.json @@ -2,29 +2,7 @@ "outbound": { "enabled": true, "everyone": "none", - "audited-payload": { - "80c84b2701126669966f46c1159cae89c58fb088e8bf94b318358fa4ca33ee56d8948511a397e5aba6aa5b88fff36f2541a91b133cde0fb816e8592b695c04c3": { - "mode": "all", - "description": "" - }, - "55e451bd1a2f43570a25052b863af1d527fe6fd4bfd1482fdb241596432477f20eb2b2f3801fb5c6cd785f1a03c43ccf71fd8cdf0a974d1296be2326b0824673": { - "mode": "all", - "description": "Foo intermediate allowed all" - }, - "cb16a2ed213c1cf7e14faa7cf05743bc145b8555ec2eedb6b12ba0d31d17846d2ed4341b048f2e43b1ca5195a347bfeb0cd663c9e6002a4adb7cc7385112d3cc": { - "mode": "all", - "description": "" - } - }, - "partner": { - "80c84b2701126669966f46c1159cae89c58fb088e8bf94b318358fa4ca33ee56d8948511a397e5aba6aa5b88fff36f2541a91b133cde0fb816e8592b695c04c3": { - "mode": "all", - "description": "" - }, - "cb16a2ed213c1cf7e14faa7cf05743bc145b8555ec2eedb6b12ba0d31d17846d2ed4341b048f2e43b1ca5195a347bfeb0cd663c9e6002a4adb7cc7385112d3cc": { - "mode": "all", - "description": "" - } - } + "audited-payload": {}, + "partner": {} } } \ No newline at end of file diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py index da436a5aaa..15e74f87e7 100644 --- a/goth_tests/e2e/vm/test_e2e_outbound_perf.py +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -73,7 +73,7 @@ async def test_e2e_outbound_perf( {"read-only": "assets/provider/presets.json", "destination": "/root/.local/share/ya-provider/presets.json"}, {"read-only": "assets/provider/hardware.json", "destination": "/root/.local/share/ya-provider/hardware.json"}, {"read-write": "~/.local/share/ya-provider/vm-images", "destination": "/root/.local/share/ya-provider/exe-unit/cache"}, - {"read-write": f"{assets_root}/test_e2e_rule_partner_outbound/provider/rules.json", "destination": "/root/.local/share/ya-provider/rules.json"}, + {"read-write": f"{assets_root}/test_e2e_outbound_perf/provider/rules.json", "destination": "/root/.local/share/ya-provider/rules.json"}, ], "privileged-mode": True, }, From 7a5d7550f9057bb357a60ce7a431055ac39d2b5b Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Jun 2023 16:10:18 +0200 Subject: [PATCH 08/13] update manifest --- .../e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json index 20b9d0cda5..a42f1082ea 100644 --- a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json @@ -14,9 +14,9 @@ "os": "linux" }, "urls": [ - "http://yacn2.dev.golem.network:8000/docker-outbound-test-v5-latest-3b2d8f2052.gvmi" + "http://yacn2.dev.golem.network:8000/docker-docker-outbound-test-v6-latest-6cf4c3d3eb.gvmi" ], - "hash": "sha3:9fbc07c722a966302ed4af7d6f4efaa5a33e886ba051fe83a3a0e203" + "hash": "sha3:192dc5f794fbe98665b017723dcb79aeff0de7f61e6aec9ef61df838" } ], "compManifest": { From fcfae2063f5be0b3e4bf2ac9660ef5de84670fee Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Jun 2023 16:18:15 +0200 Subject: [PATCH 09/13] enable all test stages --- goth_tests/e2e/vm/test_e2e_outbound_perf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py index 15e74f87e7..d851c8e89f 100644 --- a/goth_tests/e2e/vm/test_e2e_outbound_perf.py +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -39,7 +39,7 @@ def vm_exe_script(runner: Runner, addr: str, output_file: str): return [ {"deploy": {}}, {"start": {}}, - {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '0']}}, + {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '4']}}, { "transfer": { "from": f"container:/golem/output/output.json", From 814e76a675e701913e92f6d0f0ee89b33a335d53 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Mon, 3 Jul 2023 09:44:10 +0200 Subject: [PATCH 10/13] correct image hash --- .../e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json index a42f1082ea..a290e91bea 100644 --- a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json @@ -16,7 +16,7 @@ "urls": [ "http://yacn2.dev.golem.network:8000/docker-docker-outbound-test-v6-latest-6cf4c3d3eb.gvmi" ], - "hash": "sha3:192dc5f794fbe98665b017723dcb79aeff0de7f61e6aec9ef61df838" + "hash": "sha3:6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7" } ], "compManifest": { From b0c9dc868742367e02d062560868540134410e9a Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Mon, 3 Jul 2023 09:44:22 +0200 Subject: [PATCH 11/13] set stages to 0 --- goth_tests/e2e/vm/test_e2e_outbound_perf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py index d851c8e89f..6139793582 100644 --- a/goth_tests/e2e/vm/test_e2e_outbound_perf.py +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -39,7 +39,7 @@ def vm_exe_script(runner: Runner, addr: str, output_file: str): return [ {"deploy": {}}, {"start": {}}, - {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '4']}}, + {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '0' ]}}, { "transfer": { "from": f"container:/golem/output/output.json", From 21334b3187b00cff5a14d2494475c2e3e2879e10 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Tue, 4 Jul 2023 09:55:47 +0200 Subject: [PATCH 12/13] update test image --- .../e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json index a290e91bea..e63fa100d1 100644 --- a/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json +++ b/goth_tests/e2e/vm/assets/test_e2e_outbound_perf/image/manifest.json @@ -14,9 +14,9 @@ "os": "linux" }, "urls": [ - "http://yacn2.dev.golem.network:8000/docker-docker-outbound-test-v6-latest-6cf4c3d3eb.gvmi" + "http://registry.golem.network/download/1b77dda5fb08fb22ab433cbe99eb532141209eca23f8f0eec4b3989320945914" ], - "hash": "sha3:6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7" + "hash": "sha3:a77d6b5a945e1b1067f9bab623f1ab1271eee77c97851cbd5539e050" } ], "compManifest": { From 00f6a08739f11a0d18c46a05c7eb7bbd6e6755a0 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Tue, 4 Jul 2023 09:56:03 +0200 Subject: [PATCH 13/13] cleanup --- goth_tests/e2e/vm/test_e2e_outbound_perf.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/goth_tests/e2e/vm/test_e2e_outbound_perf.py b/goth_tests/e2e/vm/test_e2e_outbound_perf.py index 6139793582..12ef09626b 100644 --- a/goth_tests/e2e/vm/test_e2e_outbound_perf.py +++ b/goth_tests/e2e/vm/test_e2e_outbound_perf.py @@ -39,7 +39,7 @@ def vm_exe_script(runner: Runner, addr: str, output_file: str): return [ {"deploy": {}}, {"start": {}}, - {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '0' ]}}, + {"run": {"entry_point": "/golem/entrypoints/entrypoint.sh", "args": [addr, '22235', '22236', '22237', '0.5', '10', '2']}}, { "transfer": { "from": f"container:/golem/output/output.json", @@ -72,7 +72,6 @@ async def test_e2e_outbound_perf( "mount": [ {"read-only": "assets/provider/presets.json", "destination": "/root/.local/share/ya-provider/presets.json"}, {"read-only": "assets/provider/hardware.json", "destination": "/root/.local/share/ya-provider/hardware.json"}, - {"read-write": "~/.local/share/ya-provider/vm-images", "destination": "/root/.local/share/ya-provider/exe-unit/cache"}, {"read-write": f"{assets_root}/test_e2e_outbound_perf/provider/rules.json", "destination": "/root/.local/share/ya-provider/rules.json"}, ], "privileged-mode": True, @@ -146,10 +145,10 @@ async def test_e2e_outbound_perf( assert len(output_path.read_text()) > 0 output_text = open(output_path).read() - logger.info('Received %s', output_text) output_json = json.loads(output_text) - logger.info('Parsed as %s', output_json) - assert 'Ok' in output_json['roundtrip'] - assert 'Ok' in output_json['many_reqs'] - assert 'Ok' in output_json['iperf3'] - assert 'Ok' in output_json['stress'] + + pass_set = [{'Ok': True}, {'Err': 'skipped'}] + assert output_json['roundtrip'] in pass_set + assert output_json['many_reqs'] in pass_set + assert output_json['iperf3'] in pass_set + assert output_json['stress'] in pass_set