feat: add wescale wesql cluster workflow #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Ubuntu Docker Cluster" | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
setup: | |
name: "Ubuntu Docker Cluster" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Start MySQL Server | |
run: | | |
cd ./examples/wesql-server && ./start_mysql_server.sh | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
- name: Compile source | |
timeout-minutes: 30 | |
run: | | |
make failpoint-enable | |
make build | |
make failpoint-disable | |
- name: Start WeScale | |
run: | | |
cd ./examples/wesql-server | |
./init_single_node_cluster.sh 2>&1 | tee init_script_logs.txt & | |
# Store the background process ID - need to get the PID of the script, not tee | |
INIT_PID=$! | |
# Wait for WeScale to start (timeout after 5 minutes) | |
echo "Waiting for WeScale to be ready..." | |
timeout 30 bash -c 'until nc -z localhost 15306; do sleep 2; echo "Waiting for port 15306..."; done' | |
# Additional wait to ensure service is fully ready | |
sleep 10 | |
# Check if initialization script is still running | |
if ps -p $INIT_PID > /dev/null; then | |
echo "Initialization script is still running" | |
else | |
echo "Initialization script has completed" | |
fi | |
- name: Check Vitess Tablets | |
if: always() | |
run: | | |
# Install MySQL client | |
sudo apt-get update && sudo apt-get install -y mysql-client | |
# Attempt to connect and execute command, display logs if failed | |
if ! mysql -h127.0.0.1 -P15306 -uroot -ppasswd -e "show vitess_tablets"; then | |
echo "Failed to execute MySQL command" | |
echo "=== Initialization Script Logs ===" | |
cat ./examples/wesql-server/init_script_logs.txt | |
exit 1 | |
fi |