From 9f409eec005aaf4f8024627166bd8bfeb5736915 Mon Sep 17 00:00:00 2001 From: saikumar-vs <112166980+saikumar-vs@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:30:24 +0530 Subject: [PATCH] PMM-13668 PMM-13678 Updates add PS 8.4 and MS 8.4 Support (#111) * Updates add PS 8.4 Support, Fix mysql_native_plugin for 8.4. Fix 8.0 and 57 URLS based on new GLIB versions * Updates and also Add support for MS version 8.4 and 8.0.40 * Updates keep defaults as 8.0 only for PS and MySQL for now. --- pmm_qa/client_container_ms_setup.sh | 18 +++++++++++++----- pmm_qa/client_container_ps_setup.sh | 18 +++++++++++++----- pmm_qa/ms_pmm_setup.yml | 2 +- pmm_qa/pmm-framework.py | 6 +++--- pmm_qa/product_version_download_helper | 10 +++++++--- pmm_qa/ps_pmm_setup.yml | 2 +- 6 files changed, 38 insertions(+), 18 deletions(-) diff --git a/pmm_qa/client_container_ms_setup.sh b/pmm_qa/client_container_ms_setup.sh index 292377d..c4004c2 100644 --- a/pmm_qa/client_container_ms_setup.sh +++ b/pmm_qa/client_container_ms_setup.sh @@ -17,12 +17,12 @@ fi if [ -z "$ms_version" ] then - export ms_version="8.0.33" + export ms_version="8.0" fi if [ -z "$ms_tarball" ] then - export ms_tarball="https://dev.mysql.com/get/Downloads/MySQL-8/mysql-8.0.33-linux-glibc2.28-x86_64.tar.gz" + export ms_tarball="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.40-linux-glibc2.17-x86_64-minimal.tar.xz" fi if [ -z "$query_source" ] @@ -49,9 +49,17 @@ dbdeployer unpack ${tar_ball_name} --sandbox-binary=~/ms${ms_version} --overwrit export db_version_sandbox=$(ls ~/ms${ms_version}) export SERVICE_RANDOM_NUMBER=$((1 + $RANDOM % 9999)) +# Initialize my_cnf_options +my_cnf_options="" + +# Check if ps_version is 8.4 or greater to enable the plugin to change the password +if [[ "$ms_version" =~ ^8\.[4-9]([0-9])? || "$ms_version" =~ ^[9-9][0-9]\. ]]; then + my_cnf_options="mysql-native-password=ON" +fi + if [[ "$number_of_nodes" == 1 ]];then if [[ ! -z $group_replication ]]; then - dbdeployer deploy --topology=group replication ${db_version_sandbox} --single-primary --sandbox-binary=~/ms${ms_version} --remote-access=% --bind-address=0.0.0.0 --force + dbdeployer deploy --topology=group replication ${db_version_sandbox} --single-primary --sandbox-binary=~/ms${ms_version} --remote-access=% --bind-address=0.0.0.0 --force ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'group-single-primary' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'msandbox'@'localhost' IDENTIFIED WITH mysql_native_password BY 'msandbox';" @@ -59,7 +67,7 @@ if [[ "$number_of_nodes" == 1 ]];then mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "SET GLOBAL innodb_monitor_enable=all;" mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%statements%';" else - dbdeployer deploy single ${db_version_sandbox} --sandbox-binary=~/ms${ms_version} --port=$MS_PORT --remote-access=% --bind-address=0.0.0.0 --force + dbdeployer deploy single ${db_version_sandbox} --sandbox-binary=~/ms${ms_version} --port=$MS_PORT --remote-access=% --bind-address=0.0.0.0 --force ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'single' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'msandbox'@'localhost' IDENTIFIED WITH mysql_native_password BY 'msandbox';" @@ -91,7 +99,7 @@ if [[ "$number_of_nodes" == 1 ]];then pmm-admin add mysql --query-source=$query_source --username=msandbox --password=msandbox --environment=dev --cluster=dev-cluster --replication-set=repl1 ms-single-${SERVICE_RANDOM_NUMBER} 127.0.0.1:$node_port fi else - dbdeployer deploy multiple ${db_version_sandbox} --sandbox-binary=~/ms${ms_version} --nodes $number_of_nodes --force --remote-access=% --bind-address=0.0.0.0 + dbdeployer deploy multiple ${db_version_sandbox} --sandbox-binary=~/ms${ms_version} --nodes $number_of_nodes --force --remote-access=% --bind-address=0.0.0.0 ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'multiple' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'msandbox'@'localhost' IDENTIFIED WITH mysql_native_password BY 'msandbox';" diff --git a/pmm_qa/client_container_ps_setup.sh b/pmm_qa/client_container_ps_setup.sh index 0b3f84f..3b25f4e 100644 --- a/pmm_qa/client_container_ps_setup.sh +++ b/pmm_qa/client_container_ps_setup.sh @@ -17,12 +17,12 @@ fi if [ -z "$ps_version" ] then - export ps_version=8 + export ps_version=8.0 fi if [ -z "$ps_tarball" ] then - export ps_tarball=https://downloads.percona.com/downloads/Percona-Server-LATEST/Percona-Server-8.0.29-21/binary/tarball/Percona-Server-8.0.29-21-Linux.x86_64.glibc2.17-minimal.tar.gz + export ps_tarball="https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.40-31/binary/tarball/Percona-Server-8.0.40-31-Linux.x86_64.glibc2.35-minimal.tar.gz" fi if [ -z "$query_source" ] @@ -53,15 +53,23 @@ export db_version_sandbox=$(ls ~/ps${ps_version}) export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') export SERVICE_RANDOM_NUMBER=$((1 + $RANDOM % 9999)) +# Initialize my_cnf_options +my_cnf_options="" + +# Check if ps_version is 8.4 or greater to enable the plugin to change the password +if [[ "$ps_version" =~ ^8\.[4-9]([0-9])? || "$ps_version" =~ ^[9-9][0-9]\. ]]; then + my_cnf_options="mysql-native-password=ON" +fi + if [[ "$number_of_nodes" == 1 ]];then if [[ ! -z $group_replication ]]; then - dbdeployer deploy --topology=group replication ${db_version_sandbox} --single-primary --sandbox-binary=~/ps${ps_version} --remote-access=% --bind-address=0.0.0.0 --force + dbdeployer deploy --topology=group replication ${db_version_sandbox} --single-primary --sandbox-binary=~/ps${ps_version} --remote-access=% --bind-address=0.0.0.0 --force ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'group-single-primary' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'msandbox'@'localhost' IDENTIFIED WITH mysql_native_password BY 'msandbox';" mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'GRgrO9301RuF';" else - dbdeployer deploy single ${db_version_sandbox} --sandbox-binary=~/ps${ps_version} --port=${PS_PORT} --remote-access=% --bind-address=0.0.0.0 --force + dbdeployer deploy single ${db_version_sandbox} --sandbox-binary=~/ps${ps_version} --port=${PS_PORT} --remote-access=% --bind-address=0.0.0.0 --force ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'single' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` mysql -h 127.0.0.1 -u msandbox -pmsandbox --port $node_port -e "ALTER USER 'msandbox'@'localhost' IDENTIFIED WITH mysql_native_password BY 'msandbox';" @@ -115,7 +123,7 @@ if [[ "$number_of_nodes" == 1 ]];then pmm-admin add mysql --query-source=$query_source --username=msandbox --password=msandbox --environment=dev --cluster=dev-cluster --replication-set=repl1 ps-single-${SERVICE_RANDOM_NUMBER} 127.0.0.1:$node_port fi else - dbdeployer deploy multiple ${db_version_sandbox} --sandbox-binary=~/ps${ps_version} --nodes $number_of_nodes --force --remote-access=% --bind-address=0.0.0.0 + dbdeployer deploy multiple ${db_version_sandbox} --sandbox-binary=~/ps${ps_version} --nodes $number_of_nodes --force --remote-access=% --bind-address=0.0.0.0 ${my_cnf_options:+--my-cnf-options="$my_cnf_options"} export db_sandbox=$(dbdeployer sandboxes | awk -F' ' '{print $1}') node_port=`dbdeployer sandboxes --header | grep ${db_version_sandbox} | grep 'multiple' | awk -F'[' '{print $2}' | awk -F' ' '{print $1}'` for j in `seq 1 $number_of_nodes`; do diff --git a/pmm_qa/ms_pmm_setup.yml b/pmm_qa/ms_pmm_setup.yml index 26951a9..62915e5 100644 --- a/pmm_qa/ms_pmm_setup.yml +++ b/pmm_qa/ms_pmm_setup.yml @@ -44,7 +44,7 @@ - docker cp ./pmm3-client-setup.sh {{ ms_container }}:/ - name: Get Product tarball URL based on the version - shell: cat product_version_download_helper | grep -v pxc | grep mysql | grep "\-{{ ms_version }}" | head -1 | awk -F'# ' '{print $3}' + shell: awk -F'# ' '/-{{ ms_version | regex_escape }}/ && /ms/ {print $3; exit}' product_version_download_helper register: tarball when: lookup('env', 'MS_TARBALL') == '' diff --git a/pmm_qa/pmm-framework.py b/pmm_qa/pmm-framework.py index 73c8ed6..aaa6190 100755 --- a/pmm_qa/pmm-framework.py +++ b/pmm_qa/pmm-framework.py @@ -19,17 +19,17 @@ "TARBALL": ""} }, "MYSQL": { - "versions": ["8.0"], + "versions": ["8.4", "8.0"], "configurations": {"QUERY_SOURCE": "perfschema", "SETUP_TYPE": "", "CLIENT_VERSION": "3-dev-latest", "TARBALL": ""} }, "PS": { - "versions": ["5.7", "8.0"], + "versions": ["5.7", "8.4", "8.0"], "configurations": {"QUERY_SOURCE": "perfschema", "SETUP_TYPE": "", "CLIENT_VERSION": "3-dev-latest", "TARBALL": ""} }, "SSL_MYSQL": { - "versions": ["5.7", "8.0"], + "versions": ["5.7", "8.4", "8.0"], "configurations": {"QUERY_SOURCE": "perfschema", "SETUP_TYPE": "", "CLIENT_VERSION": "3-dev-latest", "TARBALL": ""} }, diff --git a/pmm_qa/product_version_download_helper b/pmm_qa/product_version_download_helper index d41657f..f774f47 100644 --- a/pmm_qa/product_version_download_helper +++ b/pmm_qa/product_version_download_helper @@ -16,11 +16,15 @@ psmdb # 6.0.2 # https://downloads.percona.com/downloads/percona-distribution-mon psmdb # 7.0.2 # https://downloads.percona.com/downloads/percona-server-mongodb-7.0/percona-server-mongodb-7.0.2-1/binary/tarball/percona-server-mongodb-7.0.2-1-x86_64.glibc2.17.tar.gz -ps # 8.0.33 # https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.33-25/binary/tarball/Percona-Server-8.0.33-25-Linux.x86_64.glibc2.17-minimal.tar.gz +ps # 8.4.3 # https://downloads.percona.com/downloads/Percona-Server-8.4/Percona-Server-8.4.3-3/binary/tarball/Percona-Server-8.4.3-3-Linux.x86_64.glibc2.35-minimal.tar.gz -ps # 5.7.43 # https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.43-47/binary/tarball/Percona-Server-5.7.43-47-Linux.x86_64.glibc2.17-minimal.tar.gz +ps # 8.0.40 # https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.40-31/binary/tarball/Percona-Server-8.0.40-31-Linux.x86_64.glibc2.35-minimal.tar.gz -ms # 8.0.33 # https://dev.mysql.com/get/Downloads/MySQL-8/mysql-8.0.33-linux-glibc2.28-x86_64.tar.gz +ps # 5.7.44 # https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.44-48/binary/tarball/Percona-Server-5.7.44-48-Linux.x86_64.glibc2.35-minimal.tar.gz + +ms # 8.4 # https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-8.4.3-linux-glibc2.17-x86_64-minimal.tar.xz + +ms # 8.0.40 # https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.40-linux-glibc2.17-x86_64-minimal.tar.xz proxysql # 2.6.2 # https://downloads.percona.com/downloads/proxysql2/proxysql2-2.6.2/binary/debian/jammy/x86_64/proxysql2_2.6.2-1.1.jammy_amd64.deb diff --git a/pmm_qa/ps_pmm_setup.yml b/pmm_qa/ps_pmm_setup.yml index 967a189..8213c33 100644 --- a/pmm_qa/ps_pmm_setup.yml +++ b/pmm_qa/ps_pmm_setup.yml @@ -43,7 +43,7 @@ - docker cp ./pmm3-client-setup.sh {{ ps_container }}:/ - name: Get Product tarball URL based on the version - shell: cat product_version_download_helper | grep -v pxc | grep ps | grep "\-{{ ps_version }}" | head -1 | awk -F'# ' '{print $3}' + shell: awk -F'# ' '/-{{ ps_version | regex_escape }}/ && !/pxc/ && /ps/ {print $3; exit}' product_version_download_helper register: tarball when: lookup('env', 'PS_TARBALL') == ''