Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

paritytech/bench-bot

Repository files navigation

bench-bot

⚠️ bench-bot has been deprecated in favor of https://github.com/paritytech/command-bot, which has a different execution model. A detailed comparison is provided in paritytech/pipeline-scripts#54.

Although development will stop in this repository, the open-source community might continue in forks such as https://github.com/AcalaNetwork/bench-bot and https://github.com/PureStake/bench-bot.

How to use

The bot runs commands in response to pull request comments (example). The form is:

/bench [action] [...args]

Environment variables and Github settings have to properly configured upfront for this interaction to work.

Configuration

Create a .env file in the root with the following:

APP_ID=<App id from Github App Settings>
BASE_BRANCH=<the default branch for merging into the PRs, e.g. master>
CLIENT_ID=<Client ID from Github App Settings>
CLIENT_SECRET=<Client ID from Github App Settings>
PRIVATE_KEY_PATH=<Path the the private key of the github app>
WEBHOOK_SECRET=<Webhook secret from Github App Settings>
WEBHOOK_PROXY_URL=<optional; webhook proxy for development>

During development it's recommended to use smee for WEBHOOK_PROXY_URL because it enables testing your bot's functionality locally, without having to SSH into the dedicated machine.

Linting and formatting

The commands yarn run format and yarn run lint are available for ensuring style consistency on this project's code.

Running

Locally

yarn && yarn start

Dedicated machine

Note: Before disrupting the production deployment, it's first recommended to check if some benchmark is running through pgrep -a cargo .

The run script is used to manage the application. Use run help for documentation about its options.

run bootstrap will take care of creating and installing everything from scratch. After install, you'll also need to set up environment variables which optionally can be done through a .env file in the bot's installation path.

Bot commands

  • run {start,stop,restart}: execute the relevant action for the bot.
  • run update [ref]: restart the bot with the branch or PR
    • For branch: ssh user@remote '/home/benchbot/bench-bot/run update master'
    • For PR: ssh user@remote '/home/benchbot/bench-bot/run update pull/number/head:branch' e.g. pull/1/head:master

Logs

See https://gitlab.parity.io/groups/parity/opstooling/-/wikis

Required Github settings

Permissions

  • Metadata: Read Only
  • Issues: Read/Write
  • Pull Requests: Read/Write
  • Contents: Read/Write

Event subscriptions

  • Issue comments

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published