Skip to main content

CLI to Post Benchmark Results to a Conbench Server

Project description

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.com
  • CONBENCH_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 format org/repo) or the URL (in the format https://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 benchmarked
  • CONBENCH_MACHINE_INFO_NAME: By default, the running machine host name (sent in machine_info.name when posting runs and benchmarks) will be obtained with platform.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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benchconnect-2023.2.8.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

benchconnect-2023.2.8-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file benchconnect-2023.2.8.tar.gz.

File metadata

  • Download URL: benchconnect-2023.2.8.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for benchconnect-2023.2.8.tar.gz
Algorithm Hash digest
SHA256 08a2b9fe6041265462ba0155fbffa0bdc7bb0a74f7f756ac5e6add232eb29613
MD5 455202b64defed394f26ba721acba504
BLAKE2b-256 a8e0b6ae5e08b4e42f21d46f3f13747787b6b529aa338c8cde9785cbff2fe77f

See more details on using hashes here.

File details

Details for the file benchconnect-2023.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for benchconnect-2023.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 51cf1cef9049bcded8a00ec036d9674990610f2a50f8ab71ef8fdd3e1e65501a
MD5 aca4854dec817d90d9089e3959badca9
BLAKE2b-256 ffd89f4a905fbd38ad9b45daeb2263f9dc63b36b5cd7399d995d024f2ea5c9f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page