umccr / htsget-rs

A server implementation of the htsget protocol for bioinformatics in Rust
https://samtools.github.io/hts-specs/htsget.html
MIT License
37 stars 9 forks source link

Bencher should teardown all running docker containers after finishing #103

Open brainstorm opened 2 years ago

brainstorm commented 2 years ago

When re-running local benchmarks, the following error pops up:

docker: Error response from daemon: driver failed programming external connectivity on endpoint funny_shamir (cd4f2c17d628267d5e84b4b5f05ee7dbe3edddc4c049b43b7908490de6c3d165): Bind for 0.0.0.0:8082 failed: port is already allocated.

Perhaps use https://github.com/softprops/shiplift if killall-ing or docker rm containers is problematic.

brainstorm commented 1 year ago

Local-run cargo criterion (full benchmark) seems broken (on OSX):

(...)
     Running `target/debug/htsget-actix`
1.5.0: Pulling from ga4gh/htsget-refserver
Digest: sha256:b93ab0593f58165351a136f19661228aec203ccaa74d746bd309e8936d8038de
Status: Image is up to date for ga4gh/htsget-refserver:1.5.0
docker.io/ga4gh/htsget-refserver:1.5.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Server started on port 3000!
Requests/[LIGHT] simple request htsget-rs
                        time:   [4.7549 ms 4.8158 ms 4.8747 ms]
Benchmarking Requests/[LIGHT] simple request htsget-refserver: Warming up for 3.0000 s
Warning: Unable to complete 50 samples in 30.0s. You may wish to increase target time to 31.5s, enable flat sampling, or reduce sample count to 30.
Requests/[LIGHT] simple request htsget-refserver
                        time:   [23.088 ms 23.342 ms 23.631 ms]
Requests/[LIGHT] with region htsget-rs
                        time:   [7.6975 ms 7.8795 ms 8.1050 ms]
Requests/[LIGHT] with region htsget-refserver
                        time:   [440.78 ms 441.76 ms 442.91 ms]
Requests/[LIGHT] with two regions htsget-rs
                        time:   [13.135 ms 13.224 ms 13.331 ms]
Requests/[LIGHT] with two regions htsget-refserver
                        time:   [584.93 ms 586.43 ms 588.09 ms]
Requests/[LIGHT] with VCF htsget-rs
                        time:   [3.1029 ms 3.1603 ms 3.2216 ms]
Requests/[LIGHT] with VCF htsget-refserver
                        time:   [192.23 ms 192.56 ms 192.95 ms]
Benchmarking Requests/[HEAVY] with big VCF htsget-rs: Warming up for 3.0000 sthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Decode, source: Error("missing field `format`", line: 5, column: 3) }', htsget-actix/benches/request_benchmarks.rs:56:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Unexpected message FinishedBenchmarkGroup { group: "Requests" }', /Users/rvalls/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-criterion-1.1.0/src/bench_target.rs:306:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })', /Users/rvalls/.cargo/registry/src/github.com-1ecc6299db9ec823/criterion-0.4.0/src/benchmark_group.rs:380:18
stack backtrace:
(base) rvalls@m1 htsget-rs %    0:        0x100d375e0 - std::backtrace_rs::backtrace::libunwind::trace::hee662c1c0167d178
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x100d375e0 - std::backtrace_rs::backtrace::trace_unsynchronized::haad3b0d7e2f8079c
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x100d375e0 - std::sys_common::backtrace::_print_fmt::h6333bf3aef88e50d
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x100d375e0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h692ac13077ceb8f0
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x100d53d0c - core::fmt::write::h2751cbccee004a11
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/core/src/fmt/mod.rs:1208:17
   5:        0x100d31544 - std::io::Write::write_fmt::h39e3e97f09f50d0c
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/io/mod.rs:1682:15
   6:        0x100d373f4 - std::sys_common::backtrace::_print::h87b22929951efeac
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/sys_common/backtrace.rs:47:5
   7:        0x100d373f4 - std::sys_common::backtrace::print::h8a2d10a2e780b2d1
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/sys_common/backtrace.rs:34:9
   8:        0x100d38d04 - std::panicking::default_hook::{{closure}}::he84ff0c3d3267c35
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:267:22
   9:        0x100d38a5c - std::panicking::default_hook::h3b10e080e9eea325
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:286:9
  10:        0x100d39328 - std::panicking::rust_panic_with_hook::h43dae74d3692c33d
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:688:13
  11:        0x100d39148 - std::panicking::begin_panic_handler::{{closure}}::h2c58034d65e88690
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:579:13
  12:        0x100d37a48 - std::sys_common::backtrace::__rust_end_short_backtrace::h5cc80acf989e93d4
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/sys_common/backtrace.rs:137:18
  13:        0x100d38ea4 - rust_begin_unwind
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:575:5
  14:        0x100d7a774 - core::panicking::panic_fmt::h7fdc7e057596173e
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/core/src/panicking.rs:64:14
  15:        0x100d7aaac - core::result::unwrap_failed::h9aed63ef5a5e326e
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/core/src/result.rs:1790:5
  16:        0x1009b4a5c - <criterion::benchmark_group::BenchmarkGroup<M> as core::ops::drop::Drop>::drop::h189ba6b7f025b2e5
  17:        0x1009c0eec - core::ptr::drop_in_place<criterion::benchmark_group::BenchmarkGroup<criterion::measurement::WallTime>>::h1c1bc982b1e51eea
  18:        0x1009c624c - request_benchmarks::main::h68bf8afac4c87da9
  19:        0x1009ae928 - std::sys_common::backtrace::__rust_begin_short_backtrace::h458a79ed49edbac6
  20:        0x1009bf054 - std::rt::lang_start::{{closure}}::hf8aefd80c5ced510
  21:        0x100d2ca8c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h71154f804256c9bf
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/core/src/ops/function.rs:287:13
  22:        0x100d2ca8c - std::panicking::try::do_call::hde2cfaa758aa2d95
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:483:40
  23:        0x100d2ca8c - std::panicking::try::h91b17e4ad2310363
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:447:19
  24:        0x100d2ca8c - std::panic::catch_unwind::hf2ed83c872dae42b
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panic.rs:140:14
  25:        0x100d2ca8c - std::rt::lang_start_internal::{{closure}}::h49d31f1d6c865d5d
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/rt.rs:148:48
  26:        0x100d2ca8c - std::panicking::try::do_call::h9f3a9eca8c9f13dc
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:483:40
  27:        0x100d2ca8c - std::panicking::try::h6ee8b47ee8d4b3f3
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panicking.rs:447:19
  28:        0x100d2ca8c - std::panic::catch_unwind::h69b8ed7b216890fc
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/panic.rs:140:14
  29:        0x100d2ca8c - std::rt::lang_start_internal::h077a9761163a4430
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library/std/src/rt.rs:148:20
  30:        0x1009c62a0 - _main
thread panicked while panicking. aborting.
brainstorm commented 1 year ago

Cannot reproduce this last backtrace on WSL Ubuntu though 🤔