Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
57 changes: 41 additions & 16 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,54 @@
"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",
Comment thread
ESadek-MO marked this conversation as resolved.
" checked-out commit.",
"The commit key indicates the earliest commit where the command(s)",
" will work.",
"The first 'command' in a sequence MUST ONLY set the ENV_PARENT",
Comment thread
ESadek-MO marked this conversation as resolved.
Outdated
" env var - the directory within which the environment directory",
" will be located. E.g. `ENV_PARENT=foo/` . Available as",
" {env_parent} in subsequent commands.",
"The environment will be detected as the most recently updated",
" environment in {env_parent}.",
"Commands are interpreted the same as build_command, with following",
Comment thread
ESadek-MO marked this conversation as resolved.
Outdated
" exceptions:",
" * Env vars limited to those set outside build time.",
" (e.g. {conf_dir} available but {build_dir} not)",
" * Are run in the same environment as the ASV install itself."
],
"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."
Comment thread
ESadek-MO marked this conversation as resolved.
Outdated
],
// 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