-
Notifications
You must be signed in to change notification settings - Fork 13
59 lines (48 loc) · 1.81 KB
/
mysql-htap-maxscale-setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: MySQL HTAP MaxScale Test
on:
push:
branches: [ "main" ]
jobs:
htap-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y mysql-client
curl -LJO https://github.com/duckdb/duckdb/releases/latest/download/duckdb_cli-linux-amd64.zip
unzip duckdb_cli-linux-amd64.zip
chmod +x duckdb
sudo mv duckdb /usr/local/bin
- name: Launch HTAP cluster
run: |
cd devtools/htap-setup-mysql/maxscale
docker compose up -d --wait
sleep 10
- name: Verify HTAP setup
run: |
# Save SELECT count before executing the query
docker exec maxscale maxctrl api get servers/myduck-server data.attributes.statistics.total_connections | tee select_count_before.txt
# Execute READ statement
mysql -h127.0.0.1 -P14000 -ulol -plol -e "SELECT * FROM db01.test;"
# Save SELECT count after executing the query
docker exec maxscale maxctrl api get servers/myduck-server data.attributes.statistics.total_connections | tee select_count_after.txt
# Read counts from files
before_count=$(cat select_count_before.txt)
after_count=$(cat select_count_after.txt)
# Calculate the difference
diff=$((after_count - before_count))
# Verify that SELECT count increased by 1
if [ "$diff" -eq 1 ]; then
echo 'HTAP setup verification successful.'
else
echo 'HTAP setup verification failed.'
exit 1
fi
- name: Cleanup
if: always()
run: |
cd devtools/htap-setup-mysql/maxscale
docker compose down