-
Notifications
You must be signed in to change notification settings - Fork 6
feat(autobalancer): add autobalancer demo #138
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds demonstration scripts and configurations for AutoMQ's auto-balancer feature. The changes include automation scripts for traffic-based and scale-up scenarios, Prometheus monitoring configurations, and example experiment results.
Key Changes:
- Shell scripts for running auto-balancer experiments with various configurations
- Prometheus configuration files for monitoring 2-broker and 3-broker setups
- Experiment result logs and screenshots showing auto-balancer behavior
Reviewed changes
Copilot reviewed 91 out of 130 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| results/*.log | Experiment output logs showing failed test runs (missing docker-compose files) |
| traffic-based/scripts/*.sh | Multiple experiment and utility scripts for traffic-based auto-balancing demos |
| traffic-based/results/* | Example screenshots and metrics from successful demo runs |
| traffic-based/prometheus*.yml | Prometheus configurations for different broker counts |
| scale-up/scripts/*.sh | Setup and verification scripts for scale-up demos |
Note: I've reviewed the shell scripts and configuration files. The main concerns are around error handling, documentation, and the inclusion of log files showing failed experiments. The scripts appear functional but could benefit from improved error handling and clearer documentation in some areas.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "partition-${PARTITION}:${PAYLOAD}" | docker exec -i automq-server1-traffic bash -c " | ||
| unset KAFKA_JMX_OPTS | ||
| /opt/automq/kafka/bin/kafka-console-producer.sh \ | ||
| --bootstrap-server server1:9092 \ | ||
| --topic $TOPIC \ | ||
| --property 'parse.key=true' \ | ||
| --property 'key.separator=:' \ | ||
| --property 'partitioner.class=org.apache.kafka.clients.producer.UniformStickyPartitioner' \ | ||
| --producer-property linger.ms=100 \ | ||
| --producer-property batch.size=524288 \ | ||
| --producer-property compression.type=lz4 | ||
| " 2>&1 | grep -v "WARN" || true |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generate-partition-load.sh script interpolates the TOPIC CLI argument directly into a double-quoted bash -c string (--topic $TOPIC), which is then executed inside the container. Because TOPIC comes from untrusted command-line input, a crafted value containing shell metacharacters (e.g., mytopic; rm -rf /) could break out of the intended kafka-console-producer.sh invocation and execute arbitrary commands in the container. To prevent command injection, avoid building shell command strings with unescaped user input (e.g., pass the topic as a separate argument to docker exec/bash, or strictly validate and escape TOPIC to allow only safe characters).
|
Hi @woshigaopp The file path may need to be organized. Specifically, whether this example is open-source software or BYOC mode, it needs to be placed in the corresponding folder. |
add autobalancer demos