[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
This commit is contained in:
parent
f255132aad
commit
334090575d
12
Makefile
12
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue