Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ your
[Conda package cache](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#specify-pkg-directories),
if it is not already. You can achieve this by either:

- Temporarily reconfiguring `delegated_env_commands` and `delegated_env_parent`
- Temporarily reconfiguring `ENV_PARENT` in `delegated_env_commands`
in [asv.conf.json](asv.conf.json) to reference a location on the same file
system as the Conda package cache.
- Using an alternative Conda package cache location during the benchmark run,
e.g. via the `$CONDA_PKGS_DIRS` environment variable.
- Moving your Iris repo to the same file system as the Conda package cache.

### Environment variables
Expand All @@ -63,6 +65,15 @@ plan accordingly.
decorated with `@on_demand_benchmark` are included in the ASV run. Usually
coupled with the ASV `--bench` argument to only run the benchmark(s) of
interest. Is set during the benchmark runner `cperf` and `sperf` sub-commands.
* `ASV_COMMIT_ENVS` - optional - instruct the
[delegated environment management](#benchmark-environments) to create a
dedicated environment for each commit being benchmarked when set (to any
value). This means that benchmarking commits with different environment
requirements will not be delayed by repeated environment setup - especially
relevant given the [benchmark runner](bm_runner.py)'s use of
[--interleave-rounds](https://asv.readthedocs.io/en/stable/commands.html?highlight=interleave-rounds#asv-run),
or any time you know you will repeatedly benchmark the same commit. **NOTE:**
Iris environments are large so this option can consume a lot of disk space.

## Writing benchmarks

Expand Down
62 changes: 46 additions & 16 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,59 @@
"project": "scitools-iris",
"project_url": "https://github.com/SciTools/iris",
"repo": "..",
"environment_type": "conda-delegated",
"environment_type": "delegated",
"show_commit_url": "https://github.com/scitools/iris/commit/",
"branches": ["upstream/main"],
"build_command": [
"python setup.py build",
"python -mpip wheel --no-deps -w {build_cache_dir} {build_dir}"
],

"benchmark_dir": "./benchmarks",
"env_dir": ".asv/env",
"results_dir": ".asv/results",
"html_dir": ".asv/html",
"plugins": [".asv_delegated_conda"],
"plugins": [".asv_delegated"],

"delegated_env_commands_comment": [
"The command(s) that create/update an environment correctly for the",
"checked-out commit. Command(s) format follows `build_command`:",
" https://asv.readthedocs.io/en/stable/asv.conf.json.html#build-command-install-command-uninstall-command",

"The commit key indicates the earliest commit where the command(s)",
"will work.",

"Differences from `build_command`:",
" * See: https://asv.readthedocs.io/en/stable/asv.conf.json.html#build-command-install-command-uninstall-command",
" * Env vars limited to those set outside build time.",
" (e.g. `{conf_dir}` available but `{build_dir}` not)",
" * Run in the same environment as the ASV install itself.",

"Mandatory format for the first 'command' within each commit:",
" * `ENV_PARENT=path/to/parent/directory/of/env-directory`",
" * Can contain env vars (e.g. `{conf_dir}`)",
" * `ENV_PARENT` available as `{env_parent}` in subsequent commands",
" * The environment will be detected as the most recently updated",
" environment in `{env_parent}`."

],
"delegated_env_commands": {
"c8a663a0": [
"ENV_PARENT={conf_dir}/.asv/env/nox312",
"PY_VER=3.12 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
],
"d58fca7e": [
"ENV_PARENT={conf_dir}/.asv/env/nox311",
"PY_VER=3.11 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
],
"44fae030": [
"ENV_PARENT={conf_dir}/.asv/env/nox310",
"PY_VER=3.10 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
]
},

// The command(s) that create/update an environment correctly for the
// checked-out commit.
// Interpreted the same as build_command, with following exceptions:
// * No build-time environment variables.
// * Is run in the same environment as the ASV install itself.
"delegated_env_commands": [
"PY_VER=3.12 nox --envdir={conf_dir}/.asv/env/nox01 --session=tests --install-only --no-error-on-external-run --verbose"
"command_comment": [
"We know that the Nox command takes care of installation in each",
"environment, and in the case of Iris no specialised uninstall or",
"build commands are needed to get it working."
],
// The parent directory of the above environment.
// The most recently modified environment in the directory will be used.
"delegated_env_parent": "{conf_dir}/.asv/env/nox01"
"install_command": [],
"uninstall_command": [],
"build_command": []
}
Loading