-
Notifications
You must be signed in to change notification settings - Fork 70
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
Adds MySQL 8.4 3rd Party Integration tests #1825
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,2 @@ | ||
set -e | ||
|
||
source /etc/os-release | ||
VERSION_ID=${VERSION_ID%%.*} | ||
|
||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | ||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | ||
sudo yum -y install https://repo.mysql.com/mysql80-community-release-el${VERSION_ID}.rpm | ||
|
||
if [ ${VERSION_ID} == 8 ]; then | ||
sudo yum -y module disable mysql | ||
fi | ||
sudo yum -y install mysql-community-server | ||
|
||
echo "default-authentication-plugin=mysql_native_password" | sudo tee -a /etc/my.cnf | ||
|
||
sudo service mysqld start | ||
|
||
password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysqld.log) | ||
|
||
cat <<EOF > config-user | ||
[client] | ||
user=root | ||
password='$password' | ||
EOF | ||
|
||
mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password | ||
|
||
# default socket path is different from originally set default (from debian/ubuntu), so we need to create a symlink | ||
sudo ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock | ||
|
||
sudo mkdir /var/log/mysql | ||
sudo chown mysql:mysql /var/log/mysql | ||
|
||
# Required to allow mysql to accept connections on 3307 | ||
if [ ${ID} == rocky ]; then | ||
sudo yum install -y policycoreutils-python-utils | ||
else | ||
sudo yum install -y policycoreutils-python | ||
fi | ||
sudo semanage port --add --type mysqld_port_t --proto tcp 3307 | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/my.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
sudo service mysqld restart | ||
# Centos/RHEL is not tested | ||
exit 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,2 @@ | ||
set -e | ||
|
||
sudo apt update | ||
sudo apt install -y wget | ||
|
||
wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb | ||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb | ||
sudo apt update | ||
sudo debconf-set-selections <<< 'mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)' | ||
|
||
source /etc/os-release | ||
|
||
sudo apt install -y mysql-server | ||
|
||
if [[ "${ID}" == debian && "${VERSION_ID}" == 9 ]]; then | ||
sudo apt install -y libmariadbclient18 | ||
elif [[ "${ID}" == ubuntu && "${VERSION_ID}" == 1[68].04 ]]; then | ||
sudo apt install -y libmysqlclient20 | ||
elif [[ "${ID}" == ubuntu ]]; then # 19.10 and later | ||
sudo apt install -y libmysqlclient21 | ||
fi | ||
|
||
sudo service mysql start | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
# Disable apparmor for mysql | ||
if [[ "${ID}" == ubuntu ]]; then | ||
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ | ||
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | ||
fi | ||
|
||
sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/conf.d/ | ||
|
||
sudo chmod uga+r /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /var/log/mysql/ | ||
|
||
sudo service mysql restart | ||
# Debian/Ubuntu is not tested | ||
exit 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,28 @@ minimum_supported_agent_version: | |
logging: 2.5.0 | ||
supported_operating_systems: linux | ||
platforms_to_skip: | ||
# MySQL is not currently supported on various distros. | ||
# MySQL is not currently supported on various distros. - ml-images:common-gpu-debian-11-py310 | ||
- debian-cloud:debian-11 | ||
- debian-cloud:debian-12 | ||
- debian-cloud:debian-12-arm64 | ||
- ml-images:common-gpu-debian-11-py310 | ||
- rocky-linux-cloud:rocky-linux-8 | ||
- rocky-linux-cloud:rocky-linux-8-optimized-gcp-arm64 | ||
- rocky-linux-cloud:rocky-linux-9 | ||
- rocky-linux-cloud:rocky-linux-9-arm64 | ||
- ubuntu-os-cloud:ubuntu-2004-lts | ||
- ubuntu-os-cloud:ubuntu-2004-lts-arm64 | ||
- ubuntu-os-cloud:ubuntu-2204-lts | ||
- ubuntu-os-cloud:ubuntu-2204-lts-arm64 | ||
- ubuntu-os-cloud:ubuntu-2404-lts-amd64 | ||
- ubuntu-os-cloud:ubuntu-2404-lts-arm64 | ||
- ubuntu-os-cloud:ubuntu-2410-amd64 | ||
- ubuntu-os-cloud:ubuntu-minimal-2410-amd64 | ||
- ubuntu-os-cloud:ubuntu-2410-arm64 | ||
- ubuntu-os-cloud:ubuntu-minimal-2410-arm64 | ||
- suse-cloud:sles-12 | ||
- suse-cloud:sles-15-arm64 | ||
supported_app_version: ["5.7", "8.0"] | ||
supported_app_version: ["5.7", "8.0", "8.4"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This bit will update our public docs; I would hold off making this change until we've finished adding the other (Debian, Ubuntu, RH, etc.) distros to the tests. (Those other distros can be added in follow-up PRs later since this one was just focused on SLES 15.) |
||
expected_metrics: | ||
- type: workload.googleapis.com/mysql.buffer_pool_data_pages | ||
value_type: INT64 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intended to work on openSUSE as well? If so then I'll try to put it through a manual test run since the presubmits don't run openSUSE; if not then openSUSE should be added to the skipped platforms. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
set -e | ||
|
||
source /etc/os-release | ||
VERSION_ID=${VERSION_ID%%.*} | ||
|
||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | ||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | ||
sudo yum -y install https://repo.mysql.com/mysql80-community-release-el${VERSION_ID}.rpm | ||
|
||
if [ ${VERSION_ID} == 8 ]; then | ||
sudo yum -y module disable mysql | ||
fi | ||
sudo yum -y install mysql-community-server | ||
|
||
echo "default-authentication-plugin=mysql_native_password" | sudo tee -a /etc/my.cnf | ||
|
||
sudo service mysqld start | ||
|
||
password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysqld.log) | ||
|
||
cat <<EOF > config-user | ||
[client] | ||
user=root | ||
password='$password' | ||
EOF | ||
|
||
mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password | ||
|
||
# default socket path is different from originally set default (from debian/ubuntu), so we need to create a symlink | ||
sudo ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock | ||
|
||
sudo mkdir /var/log/mysql | ||
sudo chown mysql:mysql /var/log/mysql | ||
|
||
# Required to allow mysql to accept connections on 3307 | ||
if [ ${ID} == rocky ]; then | ||
sudo yum install -y policycoreutils-python-utils | ||
else | ||
sudo yum install -y policycoreutils-python | ||
fi | ||
sudo semanage port --add --type mysqld_port_t --proto tcp 3307 | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/my.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
sudo service mysqld restart |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
set -e | ||
|
||
sudo apt update | ||
sudo apt install -y wget | ||
|
||
wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb | ||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb | ||
sudo apt update | ||
sudo debconf-set-selections <<< 'mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)' | ||
|
||
source /etc/os-release | ||
|
||
sudo apt install -y mysql-server | ||
|
||
if [[ "${ID}" == debian && "${VERSION_ID}" == 9 ]]; then | ||
sudo apt install -y libmariadbclient18 | ||
elif [[ "${ID}" == ubuntu && "${VERSION_ID}" == 1[68].04 ]]; then | ||
sudo apt install -y libmysqlclient20 | ||
elif [[ "${ID}" == ubuntu ]]; then # 19.10 and later | ||
sudo apt install -y libmysqlclient21 | ||
fi | ||
|
||
sudo service mysql start | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
# Disable apparmor for mysql | ||
if [[ "${ID}" == ubuntu ]]; then | ||
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ | ||
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | ||
fi | ||
|
||
sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/conf.d/ | ||
|
||
sudo chmod uga+r /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /var/log/mysql/ | ||
|
||
sudo service mysql restart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment