Skip to content
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

feat: add wescale wesql cluster workflow #554

Merged
merged 149 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
6f6eb57
feat: demo
newborn22 Oct 17, 2024
1a158fe
fix: fix s3 cmd
newborn22 Oct 17, 2024
59c005d
fix: fix bucket var name
newborn22 Oct 17, 2024
8254898
fix: fix s3 uri
newborn22 Oct 17, 2024
da808d2
fix: update api; uncomment s3 rb cmd
newborn22 Oct 17, 2024
a6bdd4a
fix: add inputs for wescale image tag
newborn22 Oct 17, 2024
a242179
fix: modify var ref
newborn22 Oct 17, 2024
98dae49
fix: generate yaml file
newborn22 Oct 17, 2024
7111b63
fix: fix var name error
newborn22 Oct 17, 2024
e487273
fix: fix file path
newborn22 Oct 17, 2024
a231d37
fix: fix sed cmd
newborn22 Oct 17, 2024
692e799
fix: fix var name
newborn22 Oct 17, 2024
e44c5b4
fix: create cluster
newborn22 Oct 17, 2024
4dea849
fix: fix configmap cmd
newborn22 Oct 17, 2024
b29dd20
fix: add debug log print
newborn22 Oct 17, 2024
56879b2
fix: add debug log
newborn22 Oct 17, 2024
2bda6ed
fix: add debug log
newborn22 Oct 17, 2024
47cfb9a
fix: add log
newborn22 Oct 17, 2024
4d81c80
fix: change pvc size
newborn22 Oct 17, 2024
828c981
fix: add log
newborn22 Oct 17, 2024
d919d93
fix: add lg
newborn22 Oct 17, 2024
43152b9
fix: pvc size
newborn22 Oct 17, 2024
1c9cf49
fix: add log
newborn22 Oct 17, 2024
ce3ffb8
fix: add lpg
newborn22 Oct 17, 2024
fae491f
fix: reduce cpu resource
newborn22 Oct 17, 2024
27073d2
fix: fix log
newborn22 Oct 17, 2024
f28a595
fix: add log
newborn22 Oct 17, 2024
547422f
fix: log
newborn22 Oct 17, 2024
98de448
fix:log
newborn22 Oct 17, 2024
eaadd90
fix: log
newborn22 Oct 17, 2024
ecadec2
fix: add log
newborn22 Oct 17, 2024
3c7e39b
fix: log
newborn22 Oct 17, 2024
23d149c
fix: log
newborn22 Oct 17, 2024
0063201
fix: minikube
newborn22 Oct 18, 2024
c64f02d
fix: add ngrok ssh
newborn22 Oct 18, 2024
81953e4
fix: replace ngrok with tmate
newborn22 Oct 18, 2024
7d78390
fix: wait for ssh login
newborn22 Oct 18, 2024
253a119
fix: fix synx error
newborn22 Oct 18, 2024
ab5398d
fix: change region to us
newborn22 Oct 18, 2024
b0e504d
fix: debug image
newborn22 Oct 18, 2024
bf4a4e7
fix: add env
newborn22 Oct 18, 2024
a516ceb
fix: change os
newborn22 Oct 21, 2024
910bf28
fix: apt to brew
newborn22 Oct 21, 2024
abbdf36
fix: brew install kind
newborn22 Oct 21, 2024
6c8d5c2
fix: kind create cluster
newborn22 Oct 21, 2024
7a1c49a
fix: brew install docker, kubectl
newborn22 Oct 21, 2024
cc521f6
fix: docker run wesql
newborn22 Oct 21, 2024
d5a2f16
fix: format
newborn22 Oct 21, 2024
f557883
fix: change region
newborn22 Oct 21, 2024
4ac8129
fix: single
newborn22 Oct 21, 2024
1057992
fix: format
newborn22 Oct 21, 2024
0af8204
fix: fix bug
newborn22 Oct 21, 2024
4bb959a
fix:fix
newborn22 Oct 21, 2024
7cb24d1
fix: format
newborn22 Oct 22, 2024
0775982
fix: fix
newborn22 Oct 22, 2024
197478f
fix: fix
newborn22 Oct 22, 2024
4c444da
feat: add wescale_wesql_performance_test2.yml
earayu Nov 2, 2024
0374f7f
feat: add wescale_wesql_performance_test2.yml
earayu Nov 2, 2024
f159a76
feat: test minikube
earayu Nov 5, 2024
7773d6b
feat: test minikube
earayu Nov 5, 2024
09b4e01
feat: test minikube
earayu Nov 5, 2024
14839ef
feat: test minikube
earayu Nov 5, 2024
e5e658e
feat: test minikube
earayu Nov 5, 2024
d7138c8
feat: test minikube
earayu Nov 5, 2024
be98169
feat: init k8s
earayu Nov 5, 2024
1053509
feat: init k8s
earayu Nov 5, 2024
46894a8
feat: init k8s
earayu Nov 5, 2024
553ffad
feat: init k8s
earayu Nov 5, 2024
bc62e6e
feat: init k8s
earayu Nov 5, 2024
35bfe19
feat: init k8s
earayu Nov 5, 2024
8599a7a
feat: init k8s
earayu Nov 5, 2024
5d1c097
feat: init k8s
earayu Nov 5, 2024
2019046
feat: init k8s
earayu Nov 5, 2024
b230f80
feat: init k8s
earayu Nov 5, 2024
85eac3a
feat: init k8s
earayu Nov 5, 2024
152f744
feat: init k8s
earayu Nov 5, 2024
dfe4783
feat: init k8s
earayu Nov 5, 2024
a6ec344
feat: init k8s
earayu Nov 5, 2024
143f19b
feat: init k8s
earayu Nov 5, 2024
e203165
feat: init k8s
earayu Nov 5, 2024
8b73e4c
feat: init k8s
earayu Nov 5, 2024
b0e6b4d
feat: init k8s
earayu Nov 5, 2024
02d4bfa
feat: init k8s
earayu Nov 5, 2024
14b8863
feat: init k8s
earayu Nov 5, 2024
2b29a1b
feat: init k8s
earayu Nov 5, 2024
b6afab1
feat: init k8s
earayu Nov 5, 2024
1b0c2d0
feat: init k8s
earayu Nov 5, 2024
71a614d
feat: init k8s
earayu Nov 5, 2024
6fe34e4
feat: init k8s
earayu Nov 5, 2024
d078457
feat: init k8s
earayu Nov 5, 2024
dcfbe14
feat: init k8s
earayu Nov 5, 2024
5b3959c
feat: init k8s
earayu Nov 5, 2024
be50790
feat: init k8s
earayu Nov 5, 2024
7514493
feat: update github actions
earayu Nov 6, 2024
d9b52ea
feat: add docker cluster
earayu Nov 6, 2024
d32f594
feat: add docker cluster
earayu Nov 6, 2024
20dac18
feat: add docker cluster
earayu Nov 6, 2024
9df3c76
fix: build img
newborn22 Nov 6, 2024
27ed2ba
feat: add docker cluster
earayu Nov 6, 2024
1bf03e9
fix: img
newborn22 Nov 6, 2024
aeaa62a
feat: add docker cluster
earayu Nov 6, 2024
b32cedd
feat: add docker cluster
earayu Nov 6, 2024
a360849
feat: add docker cluster
earayu Nov 6, 2024
1996fb8
feat: add docker cluster
earayu Nov 6, 2024
4ebb740
fix: img
newborn22 Nov 6, 2024
0f1bc83
fix: ssh
newborn22 Nov 6, 2024
6296f48
feat: add docker cluster
earayu Nov 6, 2024
2657090
feat: add docker cluster
earayu Nov 6, 2024
fc25000
feat: add docker cluster
earayu Nov 6, 2024
3870021
feat: add docker cluster
earayu Nov 6, 2024
e165383
feat: add docker cluster
earayu Nov 6, 2024
e1ebad7
feat: add docker cluster
earayu Nov 6, 2024
d4f7816
feat: add docker cluster
earayu Nov 6, 2024
6addb1c
feat: add docker cluster
earayu Nov 6, 2024
c5a0292
feat: add docker cluster
earayu Nov 6, 2024
4c0f9e2
feat: add docker cluster
earayu Nov 6, 2024
9d291b5
feat: add docker cluster
earayu Nov 6, 2024
7572046
feat: add docker cluster
earayu Nov 6, 2024
a1b0368
feat: add docker cluster
earayu Nov 6, 2024
3705140
feat: add docker cluster
earayu Nov 6, 2024
fedb29f
feat: add docker cluster
earayu Nov 6, 2024
d023dad
feat: add docker cluster
earayu Nov 6, 2024
821421f
feat: add docker cluster
earayu Nov 6, 2024
45d0cb6
feat: add docker cluster
earayu Nov 6, 2024
98a2e28
feat: add docker cluster
earayu Nov 6, 2024
b55cac6
feat: add docker cluster
earayu Nov 6, 2024
0f55989
feat: add docker cluster
earayu Nov 6, 2024
31726ba
feat: add docker cluster
earayu Nov 6, 2024
b74d15c
feat: add docker cluster
earayu Nov 6, 2024
2453d28
feat: add docker cluster
earayu Nov 6, 2024
0129b43
feat: add docker cluster
earayu Nov 6, 2024
3dd7442
feat: add docker cluster
earayu Nov 6, 2024
296ce62
feat: add docker cluster
earayu Nov 6, 2024
3cfd21a
feat: add docker cluster
earayu Nov 6, 2024
62bedb6
feat: add docker cluster
earayu Nov 6, 2024
bfd468f
fix: build img
newborn22 Nov 7, 2024
3a8e6e7
feat: update
earayu Nov 7, 2024
8ef37b1
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
0868d00
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
8fe0f8d
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
915162e
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
f04b048
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
842b393
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
6fb5f2d
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
5b65d6f
feat: update wescale_wesql_performance_docker.yml
earayu Nov 7, 2024
b13a8c5
feat: update wescale_wesql_performance_kind.yml
earayu Nov 7, 2024
1226138
feat: update wescale_wesql_performance_kind.yml
earayu Nov 7, 2024
8b8a43b
chore: disable github actions
earayu Nov 11, 2024
99df243
fix: delete useless yaml
newborn22 Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/cluster_endtoend_mtr_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: "MTR Test - Ubuntu Docker Cluster"
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- 'release-*'
tags:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-mtr
cancel-in-progress: true

jobs:
setup:
name: "MTR Test - Ubuntu Docker Cluster"
runs-on: ubuntu-latest

steps:
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT

- name: Checkout code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/setup-go@v3
with:
go-version: 1.20.1

- name: Compile source
if: steps.skip-workflow.outputs.skip-workflow == 'false'
timeout-minutes: 30
run: |
# install etcd
BUILD_CHROME=0 BUILD_JAVA=0 BUILD_CONSUL=0 BUILD_K3S=0 BUILD_ETCD=1 ./bootstrap.sh

make failpoint-enable
make build
make failpoint-disable

- name: Start MySQL-Server & WeScale
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
export PATH=$PATH:$(pwd)/bin
cd ./examples/wesql-server
./start_mysql_server.sh
./init_single_node_cluster.sh 2>&1 | tee init_script_logs.txt &

- name: Checkout mysql-tester code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
with:
repository: apecloud/mysql-tester
path: './mysql-tester'

- name: Build mysql-tester
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
cd ./mysql-tester && \
mkdir bin && \
make build

- name: Run MTR Tests
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
cd ./mysql-tester && \
eatmydata -- ./bin/mysql-tester -user root -port 15306 -path testcase/wesql-scale 2>&1 | tee -a output.txt

# check if any test failed
if grep -q -- 'level=error' ./mysql-tester/output.txt; then
echo "Testcase is failed"
exit 1
else
echo "Testcase is successful"
fi

- name: Print WeScale Logs
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
docker logs mysql-server
cat ./examples/wesql-server/init_script_logs.txt
155 changes: 0 additions & 155 deletions .github/workflows/cluster_endtoend_mysqltester.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/wescale_wesql_performance_kind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: "Kind Ubuntu K8s Cluster"

on:
# pull_request:
# types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
wescale_image_tag:
description: "WeScale Image Tag"
required: true
default: "0.3.0"
wesql_image_tag:
description: "WeSQL Server Image Tag"
required: true
default: "8.0.35-6.alpha10.20240918.g18ad68b.27"

jobs:
setup:
name: "Kind Ubuntu K8s Cluster"
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Install Kind
- name: Install Kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

# Step 3: Create Kind Cluster
- name: Create Kind Cluster
run: |
kind create cluster --name wescale-cluster

# Step 4: Verify Kubernetes is running
- name: Verify Kubernetes is running
run: |
kubectl get nodes
kubectl get pods -A

################################################################################################################
################################################################################################################
################################################################################################################

- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region us-east-2

- name: Create S3 Bucket
id: create_bucket
run: |
BUCKET_NAME="wescale-$(date +'%Y%m%d%H%M%S')"
echo "Bucket name: $BUCKET_NAME"
aws s3 mb s3://$BUCKET_NAME
echo "bucket_name=$BUCKET_NAME" >> $GITHUB_OUTPUT

# Step 5: Create Kubernetes ConfigMap and Secret
- name: Create ConfigMap and Secret in Kubernetes
run: |
export WESQL_OBJECTSTORE_BUCKET=${{ steps.create_bucket.outputs.bucket_name }}
export WESQL_OBJECTSTORE_REGION=us-east-2
export WESQL_OBJECTSTORE_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY_ID }}
export WESQL_OBJECTSTORE_SECRET_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}

kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: wesql-server-config
data:
MYSQL_CUSTOM_CONFIG: |
[mysqld]
objectstore_provider=aws
objectstore_region=${WESQL_OBJECTSTORE_REGION}
objectstore_bucket=${WESQL_OBJECTSTORE_BUCKET}
repo_objectstore_id=sysbench
branch_objectstore_id=main
datadir=/data/mysql/data
log-error=/data/mysql/log/mysqld-error.log
log-bin=binlog
gtid_mode=ON
enforce_gtid_consistency=ON
log_slave_updates=ON
binlog_format=ROW
skip_name_resolve=ON
EOF

kubectl create secret generic wesql-server-secret \
--namespace default \
--type Opaque \
--from-literal=WESQL_OBJECTSTORE_ACCESS_KEY=${WESQL_OBJECTSTORE_ACCESS_KEY} \
--from-literal=WESQL_OBJECTSTORE_SECRET_KEY=${WESQL_OBJECTSTORE_SECRET_KEY} \
--from-literal=MYSQL_ROOT_PASSWORD=passwd

- name: Generate Cluster YAML File And Create Cluster
run: |
kubectl apply -f https://raw.githubusercontent.com/wesql/deploy/refs/heads/main/artifact/wescale-ci.yaml

- name: Wait for WeSQL Server to be ready
run: |
kubectl wait --for=condition=available deployment/wesql-vtgate --timeout=300s
kubectl exec -it $(kubectl get pods -l app.kubernetes.io/name=wesql-vtgate -o jsonpath='{.items[0].metadata.name}') -- mysql -uroot -P15306 -ppasswd -e "SHOW DATABASES;"

- name: Print WeSQL Server ConfigMap and Secret
if: always()
run: |
kubectl get configmap wesql-server-config -o yaml
kubectl get secret wesql-server-secret -o yaml

- name: Print WeSQL Server Logs
if: always()
run: |
kubectl get pods

kubectl describe po mycluster-wesql-0-0

kubectl get pvc

kubectl get storageclass

kubectl logs mycluster-wesql-0-0

- name: Clean up
if: always()
run: |
echo "Deleting bucket: ${{ steps.create_bucket.outputs.bucket_name }}"
aws s3 rm s3://${{ steps.create_bucket.outputs.bucket_name }} --recursive
aws s3 rb s3://${{ steps.create_bucket.outputs.bucket_name }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ build-image:
tools/bin/failpoint-ctl:
GOBIN=$(shell pwd)/tools/bin go install github.com/pingcap/failpoint/failpoint-ctl@2eaa328

FAILPOINT_ENABLE := find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl enable
FAILPOINT_DISABLE := find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl disable
FAILPOINT_ENABLE := find $$PWD/go -type d | grep -vE "(\.git|tools|vtdataroot)" | xargs tools/bin/failpoint-ctl enable
FAILPOINT_DISABLE := find $$PWD/go -type d | grep -vE "(\.git|tools|vtdataroot)" | xargs tools/bin/failpoint-ctl disable

failpoint-enable: tools/bin/failpoint-ctl
# Converting gofail failpoints...
Expand Down
Loading
Loading