From 334090575d9f83329d15bf4e858630de32bcc634 Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Tue, 15 Mar 2022 13:19:32 -0700 Subject: [PATCH] [benchmarks] Fix issue with run-benchmark. make run-benchmark should not install a new runtime. Instead, just run the benchmark with the given RUNTIME. Move all of the logic to install the runtime to benchmark-platforms. PiperOrigin-RevId: 434838884 --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 23f7cd20b..27f6d043c 100644 --- a/Makefile +++ b/Makefile @@ -367,14 +367,13 @@ init-benchmark-table: ## Initializes a BigQuery table with the benchmark schema. @$(call run,//tools/parsers:parser,init --project=$(BENCHMARKS_PROJECT) --dataset=$(BENCHMARKS_DATASET) --table=$(BENCHMARKS_TABLE)) .PHONY: init-benchmark-table -# $(1) is the runtime name, $(2) are the arguments. +# $(1) is the runtime name. run_benchmark = \ - ($(call header,BENCHMARK $(1) $(2)); \ + ($(call header,BENCHMARK $(1)); \ set -euo pipefail; \ export T=$$(mktemp --tmpdir logs.$(1).XXXXXX); \ if test "$(1)" = "runc"; then $(call sudo,$(BENCHMARKS_TARGETS),-runtime=$(1) $(BENCHMARKS_ARGS)) | tee $$T; fi; \ - if test "$(1)" != "runc"; then $(call install_runtime,$(1),--profile $(2)); \ - $(call sudo,$(BENCHMARKS_TARGETS),-runtime=$(1) $(BENCHMARKS_ARGS) $(BENCHMARKS_PROFILE)) | tee $$T; fi; \ + if test "$(1)" != "runc"; then $(call sudo,$(BENCHMARKS_TARGETS),-runtime=$(1) $(BENCHMARKS_ARGS) $(BENCHMARKS_PROFILE)) | tee $$T; fi; \ if test "$(BENCHMARKS_UPLOAD)" = "true"; then \ $(call run,tools/parsers:parser,parse --debug --file=$$T --runtime=$(1) --suite_name=$(BENCHMARKS_SUITE) --project=$(BENCHMARKS_PROJECT) --dataset=$(BENCHMARKS_DATASET) --table=$(BENCHMARKS_TABLE) --official=$(BENCHMARKS_OFFICIAL)); \ fi; \ @@ -383,12 +382,13 @@ run_benchmark = \ benchmark-platforms: load-benchmarks $(RUNTIME_BIN) ## Runs benchmarks for runc and all platforms. @set -xe; for PLATFORM in $$($(RUNTIME_BIN) help platforms); do \ export PLATFORM; \ - $(call run_benchmark,$${PLATFORM},--platform=$${PLATFORM}); \ + $(call install_runtime,$${PLATFORM},--platform $${PLATFORM}); \ + $(call run_benchmark,$${PLATFORM}); \ done @$(call run_benchmark,runc) .PHONY: benchmark-platforms -run-benchmark: load-benchmarks $(RUNTIME_BIN) ## Runs single benchmark and optionally sends data to BigQuery. +run-benchmark: load-benchmarks ## Runs single benchmark and optionally sends data to BigQuery. @$(call run_benchmark,$(RUNTIME)) .PHONY: run-benchmark