From 81b45caa0b4479e3cbc5dac8aa1533930bbf4bb2 Mon Sep 17 00:00:00 2001 From: earayu Date: Wed, 6 Nov 2024 20:57:41 +0800 Subject: [PATCH] feat: add docker cluster --- .../wescale_wesql_performance_docker.yml | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wescale_wesql_performance_docker.yml b/.github/workflows/wescale_wesql_performance_docker.yml index 82dbc3e5a3..479b0f8259 100644 --- a/.github/workflows/wescale_wesql_performance_docker.yml +++ b/.github/workflows/wescale_wesql_performance_docker.yml @@ -42,7 +42,7 @@ jobs: cd ./examples/wesql-server ./init_single_node_cluster.sh 2>&1 | tee init_script_logs.txt & - - name: Check Vitess Tablets + - name: Print WeScale Logs if: always() run: | # Attempt to connect and execute command, display logs if failed @@ -62,6 +62,7 @@ jobs: - name: Build mysql-tester run: | + pwd cd ./mysql-tester && \ mkdir bin && \ make build @@ -84,4 +85,33 @@ jobs: exit 1 else echo "Testcase is successful" - fi \ No newline at end of file + fi + + - name: Install Tmate + if: always() + run: sudo apt-get install tmate + + - name: Start Tmate session + if: always() + run: | + tmate -S /tmp/tmate.sock new-session -d + tmate -S /tmp/tmate.sock wait tmate-ready + echo "SSH access: $(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')" + echo "Web access: $(tmate -S /tmp/tmate.sock display -p '#{tmate_web}')" + + TIMEOUT=1800 # 30 minutes + INTERVAL=1 # 1 second + START_TIME=$(date +%s) + + while true; do + sleep "$INTERVAL" + CURRENT_TIME=$(date +%s) + ELAPSED_TIME=$((CURRENT_TIME - START_TIME)) + + # Check if timeout is reached + if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then + echo "Timeout reached while waiting for the container." + break + fi + done + continue-on-error: true \ No newline at end of file