feat: add benchmark automation bot [WIP]#3557
Conversation
821b893 to
360a448
Compare
…rks on PRs Adds a GitHub bot that monitors PR comments for slash commands (/run tpch, /run micro, /help) and automatically runs benchmarks in Kubernetes, posting results back as PR comments. Includes CLI for manual benchmark runs, Docker image build/push, K8s job management, and deployment tooling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9c00b57 to
d43d71c
Compare
d43d71c to
51b5008
Compare
|
@Shekharrajak fyi |
|
will try to review it as soon as possible, it might be a bit too big for review. I would suggest one minor change, when bot comments it would be good if it mentions person who's triggered the bench in the comment. In my case i have github app notifications disabled for comments but still have notifications for mentions. would it make sense ? |
Thanks. I was thinking that we could create a similar PR in Ballista once we get this through review. |
milenkovicm
left a comment
There was a problem hiding this comment.
I think that makes sense @andygrove
I guess main comment I have is how to update authorised users, can't really tell from PR and no documentation section about it
| This path is mounted into the container as `/data/tpch` via a `hostPath` volume (see `k8s/comet-job-template.yaml`). | ||
|
|
||
| You must generate and place this data before running TPC-H benchmarks. Data generation scripts are | ||
| available in the [DataFusion Benchmarks](https://github.com/apache/datafusion-benchmarks) repository. |
There was a problem hiding this comment.
Was this repo retired or is going to be?
|
|
||
| ### TPC-H Data Prerequisite | ||
|
|
||
| The benchmark jobs expect TPC-H SF100 data to already exist on the Kubernetes nodes at `/mnt/bigdata/tpch`. |
There was a problem hiding this comment.
If the data is pre generated would it make sense to be able to retrieve that info as part of help or some other way?
| clones the Comet repo, checks out the PR, builds Comet (`make release`), and runs the requested benchmark. | ||
| 6. **Completion Tracking**: While jobs are running, the bot checks Kubernetes job status every 10 seconds. | ||
| On completion, a :rocket: reaction is added to the original comment. | ||
| 7. **Results Posting**: The benchmark container itself posts results as a PR comment using the GitHub API |
There was a problem hiding this comment.
Mentioning user who trigger benchmark would make sense in my opinion
| ## Authorization | ||
|
|
||
| Only DataFusion committers are authorized to trigger benchmarks. The list of authorized GitHub usernames | ||
| is maintained in `dev/benchmarking-bot/authorized_users.txt`. Unauthorized users receive a reply |
There was a problem hiding this comment.
If the user list is updated, how does the change get propagated to cluster ?
Its a bit big pr to trace it, but I hope pr author can't abuse file and add itself to it and run benchmarks
| export COMETBOT_DEPLOY_HOST=myhost | ||
| export COMETBOT_DEPLOY_USER=myuser | ||
| export COMETBOT_DEPLOY_DIR=/home/myuser/cometbot | ||
| ./deploy/deploy.sh |
There was a problem hiding this comment.
Should this script be run when list of authorised users is updated?
| # Start the bot | ||
| cometbot bot start --github-token <token> | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Maybe cli could be used to propagate authorised users update?
Closes #3556
Summary
I have been testing a version of this code for several weeks and it seems to work fairly well now, so I would like to get the code into OSS for transparency, and allow others to help make improvements.
It is just a first step. The benchmarks do run in k8s in a constrained environment, which is good, but the tests run in Spark local mode. It would be better to deploy as a real cluster in k8s later on.
There is currently an assumption that TPC-H 100GB data already exists on the k8s nodes. It would be better to generate the data using
tpchgen-clidirectly in the containers. It would also be nice to support different scale factors.There are likely many other improvements that can be made in the future.
Changes
cometbot) that monitors PR comments for slash commands (/run tpch,/run micro,/help) and automatically runs benchmarks in Kubernetes, posting results back as PR commentsDetails
The bot lives in
dev/benchmarking-bot/and includes:src/cometbot/bot.py): Polls GitHub for slash commands on open Comet PRssrc/cometbot/k8s.py): Builds Docker images, creates/manages Kubernetes jobssrc/cometbot/cli.py): Click-based CLI for manual benchmark runs and bot managementk8s/): Job and deployment manifestsdeploy/deploy.sh): Automated deployment to a remote host via SSHAll configuration is via
COMETBOT_*environment variables (registry, GitHub token, deploy host, etc.).