Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DelegatedConda with Delegated #5963

Merged
merged 14 commits into from
Jun 28, 2024
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 @@ -57,6 +59,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",
ESadek-MO marked this conversation as resolved.
Show resolved Hide 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",
ESadek-MO marked this conversation as resolved.
Show resolved Hide resolved
" 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",
ESadek-MO marked this conversation as resolved.
Show resolved Hide resolved
" 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."
ESadek-MO marked this conversation as resolved.
Show resolved Hide resolved
],
// 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
Loading