benchconnect
A small Python package that creates a CLI for benchmark runners interacting with a Conbench server.
This is a light wrapper on top of benchadapt.BenchmarkResult, benchadapt.BenchmarkRun, and benchclients.ConbenchClient. If your code is already in Python, it may be simpler to use those classes directly.
Installation
With pipx:
pipx install benchconnect@git+https://github.com/conbench/conbench.git@main#subdirectory=benchconnect
Environment variables
benchconnect relies on a number of environment variables to obtain various metadata:
CONBENCH_URL: Required. The URL of the Conbench server without a trailing slash, e.g.https://conbench.example.comCONBENCH_EMAIL: The email to use for Conbench login. Only required if the server is private.CONBENCH_PASSWORD: The password to use for Conbench login. Only required if the server is private.CONBENCH_PROJECT_REPOSITORY: The repository name (in the formatorg/repo) or the URL (in the formathttps://github.com/org/repo)CONBENCH_PROJECT_PR_NUMBER: [recommended] The number of the GitHub pull request that is running this benchmark. Do not supply this for a runs on the default branch.CONBENCH_PROJECT_COMMIT: The 40-character commit SHA of the repo being benchmarkedCONBENCH_MACHINE_INFO_NAME: By default, the running machine host name (sent inmachine_info.namewhen posting runs and benchmarks) will be obtained withplatform.node(), but in circumstances where consistency is needed (e.g. running in CI or on cloud runners), a value for host name can be specified via this environment variable instead.
Usage
Benchmark run workflow
To submit a run of benchmark results to a Conbench server, benchconnect can open a run, modify submitted results to be a part of that run, and close it.
A minimal example:
benchconnect start run '{"run_reason": "test"}'
# pass one result or a whole set at a time, inline or from files
benchconnect submit result --path my-results/
benchconnect finish run
Additional metadata can be passed via JSON, e.g. name and github when
creating the run, or error_type and error_info when closing it.
Manual API
See the man pages:
benchconnect --help
benchconnect augment --help
benchconnect post --help
benchconnect put --help
The augment command takes JSON for a benchmark result (augment result)
or benchmark run (augment run) and fills in defaults for unspecified fields.
This is useful for filling in fields like machine_info consistently. Note
this is stateless, and will not make run_id and suite_id values correspond
across results, nor will the resulting JSON necessarily be complete enough to
post to a Conbench server correctly (it can't fill in things like run_reason
for you); please ensure data is correct before posting.
The post and put commands authenticate with a Conbench server (see man
pages for environment variables) and send JSON passed. Since they correspond
to the API, there are post result and post run methods, but only put run.
Release files for benchconnect 2023.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| benchconnect-2023.2.8.tar.gz | 13.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| benchconnect-2023.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.9 kB
Release files / benchconnect-2023.2.8.tar.gz
| Download URL | benchconnect-2023.2.8.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08a2b9fe6041265462ba0155fbffa0bdc7bb0a74f7f756ac5e6add232eb29613
|
|
BLAKE2b-256 checksum How to use checksums |
a8e0b6ae5e08b4e42f21d46f3f13747787b6b529aa338c8cde9785cbff2fe77f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / benchconnect-2023.2.8-py3-none-any.whl
| Download URL | benchconnect-2023.2.8-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51cf1cef9049bcded8a00ec036d9674990610f2a50f8ab71ef8fdd3e1e65501a
|
|
BLAKE2b-256 checksum How to use checksums |
ffd89f4a905fbd38ad9b45daeb2263f9dc63b36b5cd7399d995d024f2ea5c9f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|