From 45443cc21eeebfc666d9c6b8d452c06b5827c2c2 Mon Sep 17 00:00:00 2001 From: Andreea Florescu Date: Wed, 30 Nov 2022 11:10:07 +0100 Subject: [PATCH] add hypervisor tag for agents By default we are now using the kvm hypervisor in tests. This can be overritten for the entire pipeline at the pipeline level by using the environment variable `AGENT_TAG_HYPERVISOR`. Fixes: https://github.com/rust-vmm/rust-vmm-ci/issues/115 Signed-off-by: Andreea Florescu --- .buildkite/autogenerate_pipeline.py | 10 ++++++++++ README.md | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.buildkite/autogenerate_pipeline.py b/.buildkite/autogenerate_pipeline.py index b82f7f9..4a29d7c 100755 --- a/.buildkite/autogenerate_pipeline.py +++ b/.buildkite/autogenerate_pipeline.py @@ -69,6 +69,14 @@ AARCH64_AGENT_TAGS = os.getenv('AARCH64_LINUX_AGENT_TAGS') DOCKER_PLUGIN_CONFIG = os.getenv('DOCKER_PLUGIN_CONFIG') TESTS_TO_SKIP = os.getenv('TESTS_TO_SKIP') TIMEOUTS_MIN = os.getenv('TIMEOUTS_MIN') +# This env allows setting the hypervisor on which the tests are running at the +# pipeline level. This will not override the hypervisor tag in case one is +# already specified in the test definition. +# Most of the repositories don't really need to run on KVM per se, but we are +# experiencing some timeouts mostly with the mshv hosts right now, and we are +# fixing the default to kvm to work around that problem. +# More details here: https://github.com/rust-vmm/community/issues/137 +DEFAULT_AGENT_TAG_HYPERVISOR = os.getenv('DEFAULT_AGENT_TAG_HYPERVISOR', 'kvm') PARENT_DIR = pathlib.Path(__file__).parent.resolve() @@ -298,6 +306,8 @@ class BuildkiteConfig: for platform in platforms: step_input = copy.deepcopy(test) step_input['platform'] = platform + if not step_input.get('hypervisor'): + step_input['hypervisor'] = DEFAULT_AGENT_TAG_HYPERVISOR step = BuildkiteStep() step_output = step.build(step_input) diff --git a/README.md b/README.md index 9086a72..b457525 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,12 @@ variables. https://github.com/buildkite-plugins/docker-buildkite-plugin. - `TESTS_TO_SKIP`: specifies a list of tests to be skipped. - `TIMEOUTS_MIN`: overrides the timeout value for specific tests. +- `DEFAULT_AGENT_TAG_HYPERVISOR`: sets the hypervisor on which all the tests in + the pipeline run. By default, the selected hypervisor is KVM because the + hosts running KVM at the time of this change showed better performance and + experienced timeouts less often. NOTE: This will not override the hypervisor + defined at the test step level. If a test already defines a hypervisor tag + that will remain intact. The variable `TESTS_TO_SKIP` is specified as a JSON list with the names of the tests to be skipped. The variable `TIMEOUTS_MIN` is a dictionary where