Skip to content

Commit 7c75a23

Browse files
authored
Merge c8ea42a into 22c98e8
2 parents 22c98e8 + c8ea42a commit 7c75a23

File tree

4 files changed

+403
-221
lines changed

4 files changed

+403
-221
lines changed

benchmarks/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ your
3434
[Conda package cache](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#specify-pkg-directories),
3535
if it is not already. You can achieve this by either:
3636

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

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

6778
## Writing benchmarks
6879

benchmarks/asv.conf.json

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,54 @@
33
"project": "scitools-iris",
44
"project_url": "https://github.com/SciTools/iris",
55
"repo": "..",
6-
"environment_type": "conda-delegated",
6+
"environment_type": "delegated",
77
"show_commit_url": "https://github.com/scitools/iris/commit/",
88
"branches": ["upstream/main"],
9-
"build_command": [
10-
"python setup.py build",
11-
"python -mpip wheel --no-deps -w {build_cache_dir} {build_dir}"
12-
],
139

1410
"benchmark_dir": "./benchmarks",
1511
"env_dir": ".asv/env",
1612
"results_dir": ".asv/results",
1713
"html_dir": ".asv/html",
18-
"plugins": [".asv_delegated_conda"],
14+
"plugins": [".asv_delegated"],
15+
16+
"delegated_env_commands_comment": [
17+
"The command(s) that create/update an environment correctly for the",
18+
" checked-out commit.",
19+
"The commit key indicates the earliest commit where the command(s)",
20+
" will work.",
21+
"The first 'command' in a sequence MUST ONLY set the ENV_PARENT",
22+
" env var - the directory within which the environment directory",
23+
" will be located. E.g. `ENV_PARENT=foo/` . Available as",
24+
" {env_parent} in subsequent commands.",
25+
"The environment will be detected as the most recently updated",
26+
" environment in {env_parent}.",
27+
"Commands are interpreted the same as build_command, with following",
28+
" exceptions:",
29+
" * Env vars limited to those set outside build time.",
30+
" (e.g. {conf_dir} available but {build_dir} not)",
31+
" * Are run in the same environment as the ASV install itself."
32+
],
33+
"delegated_env_commands": {
34+
"c8a663a0": [
35+
"ENV_PARENT={conf_dir}/.asv/env/nox312",
36+
"PY_VER=3.12 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
37+
],
38+
"d58fca7e": [
39+
"ENV_PARENT={conf_dir}/.asv/env/nox311",
40+
"PY_VER=3.11 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
41+
],
42+
"44fae030": [
43+
"ENV_PARENT={conf_dir}/.asv/env/nox310",
44+
"PY_VER=3.10 nox --envdir={env_parent} --session=tests --install-only --no-error-on-external-run --verbose"
45+
]
46+
},
1947

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

0 commit comments

Comments
 (0)