From 551d65b4e5e935ba36d7da931999a39080737980 Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Thu, 14 Jul 2022 20:41:59 -0700 Subject: [PATCH] [benchmarks] Replace runsc build benchmark. The runsc build benchmark has been broken for some time now, due to a dependency issue on a deprecated and removed library "zlib". The fact that the benchmark lives in the same WORKSPACE file as runsc itself complicates things such that it isn't worth maintaining. Replace this benchmark with one that builds a GRPC library with bazel instead. PiperOrigin-RevId: 461112203 --- .buildkite/pipeline.yaml | 4 ++-- .../benchmarks/build-grpc/Dockerfile.x86_64 | 24 +++++++++++++++++++ test/benchmarks/fs/bazel_test.go | 6 +++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 images/benchmarks/build-grpc/Dockerfile.x86_64 diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index ac9bebb23..0eb19843e 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -386,8 +386,8 @@ steps: label: ":bazel: ABSL build benchmarks" command: make -i benchmark-platforms BENCHMARKS_FILTER="ABSL/page_cache.clean" BENCHMARKS_SUITE=absl BENCHMARKS_TARGETS=test/benchmarks/fs:bazel_test BENCHMARKS_OPTIONS=-test.benchtime=1ns - <<: *benchmarks - label: ":go: runsc build benchmarks" - command: make -i benchmark-platforms BENCHMARKS_FILTER="Runsc/page_cache.clean/filesystem.bind" BENCHMARKS_SUITE=runsc BENCHMARKS_TARGETS=test/benchmarks/fs:bazel_test BENCHMARKS_OPTIONS=-test.benchtime=1ns + label: ":exploding_death_star: gRPC build benchmarks" + command: make -i benchmark-platforms BENCHMARKS_FILTER="GRPC/page_cache.clean/filesystem.bind" BENCHMARKS_SUITE=grpc-build BENCHMARKS_TARGETS=test/benchmarks/fs:bazel_test BENCHMARKS_OPTIONS=-test.benchtime=1ns - <<: *benchmarks label: ":metal: FFMPEG benchmarks" command: make -i benchmark-platforms BENCHMARKS_SUITE=ffmpeg BENCHMARKS_TARGETS=test/benchmarks/media:ffmpeg_test BENCHMARKS_OPTIONS=-test.benchtime=1ns diff --git a/images/benchmarks/build-grpc/Dockerfile.x86_64 b/images/benchmarks/build-grpc/Dockerfile.x86_64 new file mode 100644 index 000000000..317bdec5f --- /dev/null +++ b/images/benchmarks/build-grpc/Dockerfile.x86_64 @@ -0,0 +1,24 @@ +FROM ubuntu:18.04 + +RUN set -x \ + && apt-get update \ + && apt-get install -y \ + autoconf \ + build-essential \ + clang \ + curl \ + libtool \ + pkg-config \ + git \ + unzip \ + wget \ + && rm -rf /var/lib/apt/lists/* + + +RUN wget https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-installer-linux-x86_64.sh +RUN chmod +x bazel-4.2.1-installer-linux-x86_64.sh +RUN ./bazel-4.2.1-installer-linux-x86_64.sh + +RUN mkdir grpc && cd grpc \ + && git init && git remote add origin https://github.com/grpc/grpc.git \ + && git fetch --depth 1 origin a672e22bd1e10b3ff2a91aaae5aee3a65cc95bfe && git checkout FETCH_HEAD \ No newline at end of file diff --git a/test/benchmarks/fs/bazel_test.go b/test/benchmarks/fs/bazel_test.go index f02c40cf8..5391ad4cc 100644 --- a/test/benchmarks/fs/bazel_test.go +++ b/test/benchmarks/fs/bazel_test.go @@ -44,6 +44,12 @@ func BenchmarkBuildRunsc(b *testing.B) { runBuildBenchmark(b, "benchmarks/runsc", "/gvisor", "runsc:runsc") } +// Note: CleanCache versions of this test require running with root permissions. +// Note: This test takes on the order of 6m per permutation for runsc on kvm. +func BenchmarkBuildGRPC(b *testing.B) { + runBuildBenchmark(b, "benchmarks/build-grpc", "/grpc", ":grpc") +} + func runBuildBenchmark(b *testing.B, image, workdir, target string) { b.Helper() // Get a machine from the Harness on which to run.