Skip to content

Commit

Permalink
Merge branch 'v2.x' into v2.x_refactor_read_only_action_with_simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Apr 21, 2023
2 parents 4bc48a8 + 4bf58c1 commit ef96909
Show file tree
Hide file tree
Showing 45 changed files with 2,866 additions and 480 deletions.
201 changes: 201 additions & 0 deletions .github/workflows/ci-basictests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@

name: CI-basictests

on:
push:
branches: [ "v2.x" ]
paths-ignore:
- '.github/**'
- '**.md'
pull_request:
branches: [ "v2.x" ]
paths-ignore:
- '.github/**'
- '**.md'
# schedule:
# - cron: '15 13 * * 3'
workflow_dispatch:

jobs:
build-n-test:
runs-on: ubuntu-22.04
steps:

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y python3-pymysql python3-structlog sysbench mycli
sudo pip3 install fastcov
wget https://github.com/openark/orchestrator/releases/download/v3.2.6/orchestrator-client_3.2.6_amd64.deb
sudo dpkg -i orchestrator-client_3.2.6_amd64.deb
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
wget https://repo.mysql.com/mysql-apt-config_0.8.24-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.24-1_all.deb
sudo apt-get update -y
sudo apt-cache policy mysql-shell
sudo apt-get install -y mysql-shell
sudo sed -i 's/8.0/5.7/' /etc/apt/sources.list.d/mysql.list
sudo sed -i 's/jammy/bionic/' /etc/apt/sources.list.d/mysql.list
sudo apt-get update -y
sudo apt-cache policy libmysqlclient-dev
sudo apt-get install -y --allow-downgrades libmysqlclient-dev=5.7*
- name: Checkout proxysql
uses: actions/checkout@v3
with:
repository: 'sysown/proxysql'
# ref: 'v2.x'
fetch-depth: 0
path: 'proxysql'

- name: Set GIT_VERSION
run: |
cd proxysql/
git fetch --tags --force
echo "GIT_VERSION=$(git describe --long --abbrev=7)" >> $GITHUB_ENV
- name: Fix paths
run: |
sudo ln -s ${{ github.workspace }}/proxysql /opt/proxysql
- name: Checkout jenkins_build_scripts
uses: actions/checkout@v3
with:
repository: 'proxysql/jenkins-build-scripts'
ref: 'kubernetes'
fetch-depth: 0
path: 'jenkins-build-scripts'
token: ${{ secrets.GH_TOKEN }}
submodules: 'false'

- name: Configure env.sh
run: |
cd jenkins-build-scripts
#git rm --cached proxysql_qa_test_suite
# configure paths
sed -i "s|JENKINS_SCRIPTS_PATH=.*|JENKINS_SCRIPTS_PATH=${{ github.workspace }}/jenkins-build-scripts|" env.sh
sed -i "s|WORKSPACE=.*|WORKSPACE=${{ github.workspace }}/proxysql|" env.sh
# select tests
sed -i "s|TEST_PY_INTERNAL=.*|TEST_PY_INTERNAL=0|" env.sh
sed -i "s|TEST_PY_BENCHMARK=.*|TEST_PY_BENCHMARK=1|" env.sh
sed -i "s|TEST_PY_CHUSER=.*|TEST_PY_CHUSER=1|" env.sh
sed -i "s|TEST_PY_STATS=.*|TEST_PY_STATS=0|" env.sh
sed -i "s|TEST_PY_TAP=.*|TEST_PY_TAP=0|" env.sh
sed -i "s|TEST_PY_TAPINT=.*|TEST_PY_TAPINT=0|" env.sh
sed -i "s|TEST_PY_FAILOVER=.*|TEST_PY_FAILOVER=1|" env.sh
#sed -i "s/TEST_PY_TAP_INCL=.*/TEST_PY_TAP_INCL=\"${{ matrix.testgroup }}\"/" env.sh
#sed -i "s|TEST_PY_TAP_EXCL=.*|TEST_PY_TAP_EXCL=\"\"|" env.sh
- name: Patch TAP-tests
run: |
# apply patches
for PATCH in $(cd jenkins-build-scripts/test-scripts/patches; find . -type f); do
if [[ $PATCH =~ \.patch ]]; then
patch proxysql/test/tap/${PATCH%.patch} jenkins-build-scripts/test-scripts/patches/${PATCH}
elif [[ ! -f jenkins-build-scripts/test-scripts/patches/${PATCH#./}.patch ]]; then
cp jenkins-build-scripts/test-scripts/patches/${PATCH#./} proxysql/test/tap/${PATCH#./}
fi
done
- name: Build
run: |
cd proxysql/
# fix compile issues
grep -rl "<curl/curl.h>" test/ | xargs sed -i 's|<curl/curl.h>|"curl/curl.h"|'
sed -i 's|-I/usr/include/mysql |-I/usr/include/mysql -I$(CURL_IDIR) |' test/tap/tests/Makefile
# build proxysql
sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make debug_clickhouse WITHGCOV=1'" docker-compose.yml
#cat docker-compose.yml
make ubuntu22-dbg
# build tap tests
sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make build_tap_test_debug WITHGCOV=1'" docker-compose.yml
#cat docker-compose.yml
#make ubuntu22-dbg
# remove irrelevant tests (failing)
cd test/tap/tests
rm -f *clickhouse*-t
#rm -f *cluster*-t
rm -f *binlog*-t
rm -f *mariadb*-t
rm -f reg_test_3992_fast_forward_malformed_packet*-t
#rm -f reg_test_3847_admin_lock-t
#rm -f set_testing-240-t
#rm -f test_com_reset_connection_com_change_user*-t
#rm -f max_connections_ff-t
#rm -f test_server_sess_status-t
# remove long running tests (passing)
#rm -f multiple_prepared_statements-t
#rm -f mysql-mirror1-t
- name: Run proxysql
run: |
set -x
set +e
cd ${{ github.workspace }}/jenkins-build-scripts
source ./env.sh
./cluster_start.bash
sleep 10
cd ${{ github.workspace }}/proxysql
mkdir -p ci_infra_logs/regular_infra/proxysql
cd src
mkdir coverage_reports
(./proxysql --clickhouse-server --sqlite3-server --idle-threads -f -c "$DOCKER_SCRIPT_PATH/conf/proxysql/proxysql.cnf" -D $REGULAR_INFRA_DATADIR &> $REGULAR_INFRA_DATADIR/proxysql.log) &
sleep 10
mysql -uadmin -padmin -h127.0.0.1 -P6032 -e "SELECT version();"
cd ${{ github.workspace }}/jenkins-build-scripts
./cluster_init.bash
sleep 10
- name: Run infra
run: |
cd ${{ github.workspace }}/jenkins-build-scripts
source ./env.sh
cd ${{ github.workspace }}/jenkins-build-scripts/infra-docker-hoster
#docker-compose up -d
./docker-compose-init.bash
cd ${{ github.workspace }}/jenkins-build-scripts/infra-mysql57
sed -i "s/\${INFRA}-\${CONTAINER}-1/\${INFRA}_\${CONTAINER}_1/" docker-compose-init.bash
./docker-compose-init.bash
- name: Basic tests
run: |
set +e
cd ${{ github.workspace }}/jenkins-build-scripts
source ./env.sh
env | sort
sudo -E ./test-scripts/bin/proxysql-tester.py
RC=$?
exit $RC
- name: Fix premissions
if: always()
run: |
sudo chmod -R 777 ${{ github.workspace }}/*
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ci-selftests-${{ env.GIT_VERSION }}-run#${{ github.run_number }}
path: |
proxysql/ci_gcov_logs/
proxysql/ci_infra_logs/
proxysql/ci_tests_logs/
88 changes: 88 additions & 0 deletions .github/workflows/ci-repltests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI-repltests

on:
push:
branches: [ "v2.x" ]
paths-ignore:
- '.github/**'
- '**.md'
pull_request:
branches: [ "v2.x" ]
paths-ignore:
- '.github/**'
- '**.md'
# schedule:
# - cron: '15 13 * * 3'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04
steps:

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y sysbench gettext
- name: Checkout proxysql
uses: actions/checkout@v3
with:
repository: 'sysown/proxysql'
# ref: 'v2.x'
fetch-depth: 0
path: 'proxysql'

- name: Checkout jenkins_build_scripts
uses: actions/checkout@v3
with:
repository: 'proxysql/jenkins-build-scripts'
ref: 'proxysql_repl_tests'
fetch-depth: 0
path: 'jenkins-build-scripts'
token: ${{ secrets.GH_TOKEN }}

- name: Set GIT_VERSION
run: |
cd proxysql/
git fetch --tags --force
echo "GIT_VERSION=$(git describe --long --abbrev=7)" >> $GITHUB_ENV
- name: Build
run: |
cd proxysql/
make ubuntu22-dbg
- name: Docker-hoster
run: |
cd jenkins-build-scripts/infra-docker-hoster
docker-compose up -d
- name: Replication-tests
run: |
set +e
cd jenkins-build-scripts
sed -i "s|#!/usr/bin/bash|#!/usr/bin/bash +e|" proxysql_repl_tests/bin/debezium-check.bash
sed -i "s|#!/usr/bin/bash|#!/usr/bin/bash +e|" proxysql_repl_tests/exec_repl_test.sh
sed -i "s|JENKINS_SCRIPTS_PATH=.*|JENKINS_SCRIPTS_PATH=${{ github.workspace }}/jenkins-build-scripts|" env.sh
sed -i "s|WORKSPACE=.*|WORKSPACE=${{ github.workspace }}/proxysql|" env.sh
cd proxysql_repl_tests
#./exec_repl_test.sh 5.7 no-ssl debezium
./exec_all_repl_tests.sh
RC=$?
#./docker-compose-destroy.bash
sudo chmod -R 777 ${{ github.workspace }}/*
exit $RC
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ci-selftests-${{ env.GIT_VERSION }}-run#${{ github.run_number }}
path: |
proxysql/src/
proxysql/ci_infra_logs/
20 changes: 10 additions & 10 deletions .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ jobs:
echo "BIN_PKG=$(ls -1 binaries/*[mb])" >> $GITHUB_ENV
echo "BIN_HASH=$(ls -1 binaries/*.id-hash)" >> $GITHUB_ENV
# - name: Deploy to Repo
# uses: easingthemes/ssh-deploy@main
# env:
# SSH_PRIVATE_KEY: ${{ secrets.REPO_PRIVATE_KEY }}
# ARGS: "-aic"
# SOURCE: ${{ env.BIN_PKG }}
# REMOTE_HOST: ${{ secrets.REPO_HOST }}
# REMOTE_USER: ${{ secrets.REPO_USER }}
# TARGET: ${{ secrets.REPO_TARGET }}/binaries-${{ env.GIT_VERSION }}/
# EXCLUDE: binaries/.gitignore
- name: Deploy to Repo
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.REPO_PRIVATE_KEY }}
ARGS: "-aic"
SOURCE: ${{ env.BIN_PKG }}
REMOTE_HOST: ${{ secrets.REPO_HOST }}
REMOTE_USER: ${{ secrets.REPO_USER }}
TARGET: ${{ secrets.REPO_TARGET }}/binaries-${{ env.GIT_VERSION }}/
EXCLUDE: binaries/.gitignore

- name: Push packages
env:
Expand Down
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ testgrouprep: build_deps_debug build_lib_testgrouprep build_src_testgrouprep
.PHONY: testreadonly
testreadonly: build_deps_debug build_lib_testreadonly build_src_testreadonly

.PHONY: testreplicationlag
testreplicationlag: build_deps_debug build_lib_testreplicationlag build_src_testreplicationlag

.PHONY: testall
testall: build_deps_debug build_lib_testall build_src_testall

Expand Down Expand Up @@ -151,13 +154,21 @@ build_src_testreadonly: build_deps build_lib_testreadonly
build_lib_testreadonly: build_deps_debug
cd lib && OPTZ="${O0} -ggdb -DDEBUG -DTEST_READONLY" CC=${CC} CXX=${CXX} ${MAKE}

.PHONY: build_src_testreplicationlag
build_src_testreplicationlag: build_deps build_lib_testreplicationlag
cd src && OPTZ="${O0} -ggdb -DDEBUG -DTEST_REPLICATIONLAG" CC=${CC} CXX=${CXX} ${MAKE}

.PHONY: build_lib_testreplicationlag
build_lib_testreplicationlag: build_deps_debug
cd lib && OPTZ="${O0} -ggdb -DDEBUG -DTEST_REPLICATIONLAG" CC=${CC} CXX=${CXX} ${MAKE}

.PHONY: build_src_testall
build_src_testall: build_deps build_lib_testall
cd src && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA -DTEST_GALERA -DTEST_GROUPREP -DTEST_READONLY" CC=${CC} CXX=${CXX} ${MAKE}
cd src && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA -DTEST_GALERA -DTEST_GROUPREP -DTEST_READONLY -DTEST_REPLICATIONLAG" CC=${CC} CXX=${CXX} ${MAKE}

.PHONY: build_lib_testall
build_lib_testall: build_deps_debug
cd lib && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA -DTEST_GALERA -DTEST_GROUPREP -DTEST_READONLY" CC=${CC} CXX=${CXX} ${MAKE}
cd lib && OPTZ="${O0} -ggdb -DDEBUG -DTEST_AURORA -DTEST_GALERA -DTEST_GROUPREP -DTEST_READONLY -DTEST_REPLICATIONLAG" CC=${CC} CXX=${CXX} ${MAKE}

.PHONY: build_tap_test
build_tap_test: build_src
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![CI-selftests](https://github.com/sysown/proxysql/actions/workflows/ci-selftests.yml/badge.svg)](https://github.com/sysown/proxysql/actions/workflows/ci-selftests.yml)
[![CI-repltests](https://github.com/sysown/proxysql/actions/workflows/ci-repltests.yml/badge.svg)](https://github.com/sysown/proxysql/actions/workflows/ci-repltests.yml)
[![CodeQL](https://github.com/sysown/proxysql/actions/workflows/codeql.yml/badge.svg)](https://github.com/sysown/proxysql/actions/workflows/codeql.yml)
[![Package-Build](https://github.com/sysown/proxysql/actions/workflows/package-build.yml/badge.svg)](https://github.com/sysown/proxysql/actions/workflows/package-build.yml)

Expand Down
6 changes: 6 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ endif
libinjection: libinjection/libinjection/src/libinjection.a


BIO_MATCH := $(shell ./libssl/verify-bio_st-match.sh \&>/dev/null; echo $$?)
ifneq ($(BIO_MATCH),0)
$(error Incompatible OpenSSL version: struct bio_st mismatch!)
endif

libssl/openssl/libssl.a:
cd libssl && rm -rf openssl-openssl-*/ openssl-3*/ || true
cd libssl && tar -zxf openssl-*.tar.gz
Expand All @@ -93,6 +98,7 @@ libssl/openssl/libssl.a:

libssl: libssl/openssl/libssl.a


MIN_VERSION := 4.9.0
GCC_VERSION := $(shell gcc -dumpversion)
SORTED_VERSIONS := $(shell echo -e "$(GCC_VERSION)\n$(MIN_VERSION)" | sort -V)
Expand Down
7 changes: 7 additions & 0 deletions deps/libssl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ In ProxySQL 2.1.1 , libssl was upgraded to version 1.1.1j

In ProxySQL 2.4.0 , libssl was upgraded from version 1.1.1j to 3.0.2

In ProxySQL 2.4.8 , libssl was upgraded from version 3.0.2 to 3.0.8

In ProxySQL 2.5.x , libssl was upgraded from version 3.0.8 to 3.1.0


Do not upgrade without extensive testing.

See note about `struct bio_st` in MySQL_Data_Stream.cpp .

Run `verify-bio_st-match.sh` to confirm compatibility.
2 changes: 1 addition & 1 deletion deps/libssl/openssl
Binary file not shown.
Loading

0 comments on commit ef96909

Please sign in to comment.