crosvm/infra/README.recipes.md
Dennis Kempin b1abe58649 infra: Optimize cache usage among builders
Then 'builder' cache dir is set up by default to be a cache directory
for each builder, so luci will try to schedule a builder to run on
the same bot as before.
We can optimize that by sharing the cache among all linux builders.

BUG=b:238333690
TEST=lucicfg validate main.star

Change-Id: If4639658271881f1bf1ad001ae54f50645e8890a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3751828
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-07 23:00:04 +00:00

179 lines
11 KiB
Markdown

<!--- AUTOGENERATED BY `./recipes.py test train` -->
# Repo documentation for [crosvm](https://chromium.googlesource.com/crosvm/crosvm.git)
## Table of Contents
**[Recipe Modules](#Recipe-Modules)**
* [crosvm](#recipe_modules-crosvm) (Python3 ✅)
**[Recipes](#Recipes)**
* [build_chromeos](#recipes-build_chromeos) (Python3 ✅)
* [build_linux](#recipes-build_linux) (Python3 ✅)
* [build_windows](#recipes-build_windows) (Python3 ✅)
* [crosvm:examples/container_build_context](#recipes-crosvm_examples_container_build_context) (Python3 ✅)
* [crosvm:examples/host_build_context](#recipes-crosvm_examples_host_build_context) (Python3 ✅)
* [crosvm:examples/source_context](#recipes-crosvm_examples_source_context) (Python3 ✅)
* [health_check](#recipes-health_check) (Python3 ✅)
* [push_to_github](#recipes-push_to_github) (Python3 ✅)
* [update_chromeos_merges](#recipes-update_chromeos_merges) (Python3 ✅)
## Recipe Modules
### *recipe_modules* / [crosvm](/infra/recipe_modules/crosvm)
[DEPS](/infra/recipe_modules/crosvm/__init__.py#7): [depot\_tools/bot\_update][depot_tools/recipe_modules/bot_update], [depot\_tools/gclient][depot_tools/recipe_modules/gclient], [depot\_tools/git][depot_tools/recipe_modules/git], [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/cipd][recipe_engine/recipe_modules/cipd], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/file][recipe_engine/recipe_modules/file], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
#### **class [CrosvmApi](/infra/recipe_modules/crosvm/api.py#11)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
Crosvm specific functionality shared between recipes.
&emsp; **@property**<br>&mdash; **def [builder\_cache](/infra/recipe_modules/crosvm/api.py#43)(self):**
Dedicated cache directory for each builder.
Luci will try to run each builder on the same bot as previously to keep this cache present.
&emsp; **@property**<br>&mdash; **def [cargo\_home](/infra/recipe_modules/crosvm/api.py#24)(self):**
CARGO_HOME is cached between runs.
&emsp; **@property**<br>&mdash; **def [cargo\_target\_dir](/infra/recipe_modules/crosvm/api.py#29)(self):**
CARGO_TARGET_DIR is cleaned up between runs
&mdash; **def [container\_build\_context](/infra/recipe_modules/crosvm/api.py#62)(self):**
Prepares source and system to build crosvm via dev container.
Usage:
with api.crosvm.container_build_context():
api.crosvm.step_in_container("build crosvm", ["cargo build"])
&emsp; **@property**<br>&mdash; **def [dev\_container\_cache](/infra/recipe_modules/crosvm/api.py#39)(self):**
&mdash; **def [host\_build\_context](/infra/recipe_modules/crosvm/api.py#79)(self):**
Prepares source and system to build crosvm directly on the host.
This will install the required rust version via rustup. However no further dependencies
are installed.
Usage:
with api.crosvm.host_build_context():
api.step("build crosvm", ["cargo build"])
&emsp; **@property**<br>&mdash; **def [local\_bin](/infra/recipe_modules/crosvm/api.py#34)(self):**
Directory used to install local tools required by the build.
&mdash; **def [prepare\_git](/infra/recipe_modules/crosvm/api.py#124)(self):**
&emsp; **@property**<br>&mdash; **def [rustup\_home](/infra/recipe_modules/crosvm/api.py#19)(self):**
RUSTUP_HOME is cached between runs.
&mdash; **def [source\_context](/infra/recipe_modules/crosvm/api.py#52)(self):**
Updates the source to the revision to be tested and drops into the source directory.
Use when no build commands are needed.
&emsp; **@property**<br>&mdash; **def [source\_dir](/infra/recipe_modules/crosvm/api.py#14)(self):**
Where the crosvm source will be checked out.
&mdash; **def [step\_in\_container](/infra/recipe_modules/crosvm/api.py#110)(self, step_name, command):**
Runs a luci step inside the crosvm dev container.
## Recipes
### *recipes* / [build\_chromeos](/infra/recipes/build_chromeos.py)
[DEPS](/infra/recipes/build_chromeos.py#9): [crosvm](#recipe_modules-crosvm), [depot\_tools/depot\_tools][depot_tools/recipe_modules/depot_tools], [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/file][recipe_engine/recipe_modules/file], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [BuildAndTest](/infra/recipes/build_chromeos.py#76)(api, board):**
&mdash; **def [CleanUp](/infra/recipes/build_chromeos.py#89)(api):**
&mdash; **def [PrepareBuild](/infra/recipes/build_chromeos.py#61)(api):**
&mdash; **def [RunSteps](/infra/recipes/build_chromeos.py#94)(api, properties):**
&mdash; **def [SetupSource](/infra/recipes/build_chromeos.py#27)(api, workspace):**
### *recipes* / [build\_linux](/infra/recipes/build_linux.py)
[DEPS](/infra/recipes/build_linux.py#11): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipes/build_linux.py#40)(api, properties):**
&mdash; **def [get\_test\_args](/infra/recipes/build_linux.py#22)(api, properties):**
Returns architecture specific arguments for ./tools/run_tests
### *recipes* / [build\_windows](/infra/recipes/build_windows.py)
[DEPS](/infra/recipes/build_windows.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipes/build_windows.py#18)(api):**
### *recipes* / [crosvm:examples/container\_build\_context](/infra/recipe_modules/crosvm/examples/container_build_context.py)
[DEPS](/infra/recipe_modules/crosvm/examples/container_build_context.py#7): [crosvm](#recipe_modules-crosvm)
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipe_modules/crosvm/examples/container_build_context.py#12)(api):**
### *recipes* / [crosvm:examples/host\_build\_context](/infra/recipe_modules/crosvm/examples/host_build_context.py)
[DEPS](/infra/recipe_modules/crosvm/examples/host_build_context.py#7): [crosvm](#recipe_modules-crosvm), [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipe_modules/crosvm/examples/host_build_context.py#14)(api):**
### *recipes* / [crosvm:examples/source\_context](/infra/recipe_modules/crosvm/examples/source_context.py)
[DEPS](/infra/recipe_modules/crosvm/examples/source_context.py#12): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipe_modules/crosvm/examples/source_context.py#18)(api):**
### *recipes* / [health\_check](/infra/recipes/health_check.py)
[DEPS](/infra/recipes/health_check.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipes/health_check.py#18)(api):**
### *recipes* / [push\_to\_github](/infra/recipes/push_to_github.py)
[DEPS](/infra/recipes/push_to_github.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/file][recipe_engine/recipe_modules/file], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipes/push_to_github.py#20)(api):**
### *recipes* / [update\_chromeos\_merges](/infra/recipes/update_chromeos_merges.py)
[DEPS](/infra/recipes/update_chromeos_merges.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipes/update_chromeos_merges.py#16)(api):**
[depot_tools/recipe_modules/bot_update]: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/8a87603683bda769d437e48cc1a7494a2e237ead/recipes/README.recipes.md#recipe_modules-bot_update
[depot_tools/recipe_modules/depot_tools]: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/8a87603683bda769d437e48cc1a7494a2e237ead/recipes/README.recipes.md#recipe_modules-depot_tools
[depot_tools/recipe_modules/gclient]: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/8a87603683bda769d437e48cc1a7494a2e237ead/recipes/README.recipes.md#recipe_modules-gclient
[depot_tools/recipe_modules/git]: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/8a87603683bda769d437e48cc1a7494a2e237ead/recipes/README.recipes.md#recipe_modules-git
[recipe_engine/recipe_modules/buildbucket]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-buildbucket
[recipe_engine/recipe_modules/cipd]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-cipd
[recipe_engine/recipe_modules/context]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-context
[recipe_engine/recipe_modules/file]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-file
[recipe_engine/recipe_modules/path]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-path
[recipe_engine/recipe_modules/platform]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-platform
[recipe_engine/recipe_modules/properties]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-properties
[recipe_engine/recipe_modules/raw_io]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-raw_io
[recipe_engine/recipe_modules/step]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/README.recipes.md#recipe_modules-step
[recipe_engine/wkt/RecipeApi]: https://chromium.googlesource.com/infra/luci/recipes-py.git/+/7b42800366a15f34b28e62f6bcb1cddcb2206db0/recipe_engine/recipe_api.py#883