diff --git a/Dockerfile b/Dockerfile index ca7b4be646..fee75be6be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -295,7 +295,7 @@ RUN set -x; dnf -y update && \ dnf -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel \ gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros \ - expect rpm-sign zip tzdata-java + expect rpm-sign zip tzdata-java libzstd-devel ENV JAVA_HOME /usr/lib/jvm/java-${OPENJDK_MAJOR_VERSION}-openjdk/ COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk diff --git a/builds/fluent_bit.sh b/builds/fluent_bit.sh index 56263357cc..e6ad714a83 100755 --- a/builds/fluent_bit.sh +++ b/builds/fluent_bit.sh @@ -17,12 +17,29 @@ set -x -e DESTDIR=$1 mkdir -p $DESTDIR fluent_bit_dir=/opt/google-cloud-ops-agent/subagents/fluent-bit + +# Detect Rocky, CentOS, or RHEL 10 +EXTRA_CMAKE_FLAGS="" +if [ -f /etc/os-release ]; then + . /etc/os-release + case "$ID" in + rocky|centos|rhel) + if [ "${VERSION_ID%%.*}" = "10" ]; then + # 1. Set the CMake flag + EXTRA_CMAKE_FLAGS="-DFLB_PREFER_SYSTEM_LIB_ZSTD=On" + # 2. Export the environment variable for CMake to detect + export FLB_PREFER_SYSTEM_LIB_ZSTD=On + fi + ;; + esac +fi + cd submodules/fluent-bit mkdir -p build cd build + # CMAKE_INSTALL_PREFIX here will cause the binary to be put at # /usr/lib/google-cloud-ops-agent/bin/fluent-bit -# Additionally, -DFLB_SHARED_LIB=OFF skips building libfluent-bit.so cmake .. -DCMAKE_INSTALL_PREFIX=$fluent_bit_dir \ -DFLB_HTTP_SERVER=ON -DFLB_DEBUG=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWITHOUT_HEADERS=ON -DFLB_SHARED_LIB=OFF -DFLB_STREAM_PROCESSOR=OFF \ @@ -31,12 +48,12 @@ cmake .. -DCMAKE_INSTALL_PREFIX=$fluent_bit_dir \ -DFLB_CONFIG_YAML=OFF \ -DFLB_IN_SYSTEMD=On \ -DFLB_MSGPACK_TO_JSON_INIT_BUFFER_SIZE=1.5 -DFLB_MSGPACK_TO_JSON_REALLOC_BUFFER_SIZE=.10 \ - -DFLB_CONFIG_YAML=OFF + $EXTRA_CMAKE_FLAGS + make -j8 make DESTDIR="$DESTDIR" install -# We don't want fluent-bit's service or configuration, but there are no cmake -# flags to disable them. Prune after build. +# Prune after build rm "${DESTDIR}/lib/systemd/system/fluent-bit.service" || true rm "${DESTDIR}/usr/lib/systemd/system/fluent-bit.service" || true -rm -r "${DESTDIR}${fluent_bit_dir}/etc" +rm -r "${DESTDIR}${fluent_bit_dir}/etc" \ No newline at end of file diff --git a/dockerfiles/compile.go b/dockerfiles/compile.go index 092929fd2e..2bf8d14a07 100644 --- a/dockerfiles/compile.go +++ b/dockerfiles/compile.go @@ -111,7 +111,7 @@ var dockerfileArguments = []templateArguments{ dnf -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel \ gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros \ - expect rpm-sign zip tzdata-java + expect rpm-sign zip tzdata-java libzstd-devel ENV JAVA_HOME /usr/lib/jvm/java-${OPENJDK_MAJOR_VERSION}-openjdk/` + installJava, package_build: "RUN ./pkg/rpm/build.sh", diff --git a/integration_test/third_party_apps_test/applications/activemq/centos_rhel/install b/integration_test/third_party_apps_test/applications/activemq/centos_rhel/install index 40d4376f15..5d9614bea0 100644 --- a/integration_test/third_party_apps_test/applications/activemq/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/activemq/centos_rhel/install @@ -1,7 +1,14 @@ set -e +source /etc/os-release +MAJOR_VERSION_ID=${VERSION_ID%%.*} + +JAVA_VERSION=1.8.0 +if [[ "$ID" == "rocky" && "$MAJOR_VERSION_ID" == "10" ]]; then + JAVA_VERSION=21 +fi sudo yum install -y \ - curl java-1.8.0-openjdk java-1.8.0-openjdk-devel curl + curl java-${JAVA_VERSION}-openjdk java-${JAVA_VERSION}-openjdk-devel curl # https://github.com/GoogleCloudPlatform/ops-agent/blob/master/integration_test/README.md#vendored-dependencies curl -L -o \ @@ -37,4 +44,4 @@ sudo sed -i "s/$before/$after/g" /opt/activemq/bin/env sudo systemctl daemon-reload sudo systemctl enable activemq -sudo systemctl restart activemq +sudo systemctl restart activemq diff --git a/integration_test/third_party_apps_test/applications/aerospike/metadata.yaml b/integration_test/third_party_apps_test/applications/aerospike/metadata.yaml index 07d20cbba8..f1d0ed7a49 100644 --- a/integration_test/third_party_apps_test/applications/aerospike/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/aerospike/metadata.yaml @@ -165,6 +165,11 @@ platforms_to_skip: - rocky-linux-cloud:rocky-linux-9-optimized-gcp - rocky-linux-cloud:rocky-linux-9-arm64 - rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64 + # repo not available for rh10 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 - ubuntu-os-cloud:ubuntu-2404-lts-amd64 - ubuntu-os-cloud:ubuntu-2404-lts-arm64 - ubuntu-os-cloud:ubuntu-2504-amd64 # aerospike not available for 25.04 yet: https://download.aerospike.com/artifacts/aerospike-server-community/7.2.0/ diff --git a/integration_test/third_party_apps_test/applications/cassandra/metadata.yaml b/integration_test/third_party_apps_test/applications/cassandra/metadata.yaml index 64b082adda..cad52ae8e8 100644 --- a/integration_test/third_party_apps_test/applications/cassandra/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/cassandra/metadata.yaml @@ -52,6 +52,11 @@ platforms_to_skip: - debian-cloud:debian-13-arm64 # openjdk-11-jre not available on Debian 13. - debian-cloud:debian-12 # QueryLog() failed: cassandra_system not found, exhausted retries; QueryLog() failed: cassandra_debug not found, exhausted retries; QueryLog() failed: cassandra_gc not found, exhausted retries - debian-cloud:debian-12-arm64 # QueryLog() failed: cassandra_system not found, exhausted retries; QueryLog() failed: cassandra_debug not found, exhausted retries; QueryLog() failed: cassandra_gc not found, exhausted retries + # rocky-linux-10 - nothing provides (java-1.8.0-headless or java-11-headless) needed by cassandra-4.1.10-1.noarch from cassandra + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 supported_app_version: ["3.11", "4.0"] expected_metrics: - type: workload.googleapis.com/cassandra.client.request.count diff --git a/integration_test/third_party_apps_test/applications/couchdb/metadata.yaml b/integration_test/third_party_apps_test/applications/couchdb/metadata.yaml index 076df1a817..0856a53089 100644 --- a/integration_test/third_party_apps_test/applications/couchdb/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/couchdb/metadata.yaml @@ -68,6 +68,11 @@ platforms_to_skip: - rocky-linux-cloud:rocky-linux-9-optimized-gcp - rocky-linux-cloud:rocky-linux-9-arm64 - rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64 + # repo not available for rh10 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 - ubuntu-os-cloud:ubuntu-2404-lts-amd64 - ubuntu-os-cloud:ubuntu-2404-lts-arm64 - ubuntu-os-cloud:ubuntu-2504-amd64 diff --git a/integration_test/third_party_apps_test/applications/elasticsearch/centos_rhel/install b/integration_test/third_party_apps_test/applications/elasticsearch/centos_rhel/install index 7a72af71ab..51dbe501c8 100644 --- a/integration_test/third_party_apps_test/applications/elasticsearch/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/elasticsearch/centos_rhel/install @@ -7,7 +7,14 @@ case "$VERSION_ID" in 9*) sudo update-crypto-policies --set LEGACY;; esac -sudo yum install -y java-1.8.0-openjdk +MAJOR_VERSION_ID=${VERSION_ID%%.*} + +JAVA_VERSION=1.8.0 +if [[ "$ID" == "rocky" && "$MAJOR_VERSION_ID" == "10" ]]; then + JAVA_VERSION=21 +fi + +sudo yum install -y java-${JAVA_VERSION}-openjdk sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch @@ -26,7 +33,7 @@ sudo mv elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo sudo chown root:root /etc/yum.repos.d/elasticsearch.repo sudo chmod 0644 /etc/yum.repos.d/elasticsearch.repo -sudo yum install -y --enablerepo=elasticsearch elasticsearch +sudo yum install -y --enablerepo=elasticsearch elasticsearch sudo systemctl daemon-reload sudo systemctl enable elasticsearch diff --git a/integration_test/third_party_apps_test/applications/elasticsearch9/centos_rhel/install b/integration_test/third_party_apps_test/applications/elasticsearch9/centos_rhel/install index 3fe3ed4d63..734df459e2 100644 --- a/integration_test/third_party_apps_test/applications/elasticsearch9/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/elasticsearch9/centos_rhel/install @@ -7,7 +7,14 @@ case "$VERSION_ID" in 9*) sudo update-crypto-policies --set LEGACY;; esac -sudo yum install -y java-1.8.0-openjdk +MAJOR_VERSION_ID=${VERSION_ID%%.*} + +JAVA_VERSION=1.8.0 +if [[ "$ID" == "rocky" && "$MAJOR_VERSION_ID" == "10" ]]; then + JAVA_VERSION=21 +fi + +sudo yum install -y java-${JAVA_VERSION}-openjdk sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch diff --git a/integration_test/third_party_apps_test/applications/flink/centos_rhel/install b/integration_test/third_party_apps_test/applications/flink/centos_rhel/install index b8c6d91fb3..ca5276f162 100644 --- a/integration_test/third_party_apps_test/applications/flink/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/flink/centos_rhel/install @@ -1,7 +1,8 @@ set -e -sudo yum -y install \ - java-1.8.0-openjdk java-1.8.0-openjdk-devel curl +JAVA_VERSION=1.8.0 + +sudo yum install -y java-${JAVA_VERSION}-openjdk java-${JAVA_VERSION}-openjdk-devel curl # https://github.com/GoogleCloudPlatform/ops-agent/blob/master/integration_test/README.md#vendored-dependencies curl -L -o flink.tgz https://storage.googleapis.com/ops-agents-public-buckets-vendored-deps/mirrored-content/archive.apache.org/dist/flink/flink-1.14.4/flink-1.14.4-bin-scala_2.11.tgz @@ -12,7 +13,7 @@ sudo tar -xzf flink.tgz -C /opt/flink --strip-components 1 cat < config-user [client] @@ -24,12 +44,21 @@ 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 +# Update root password logic +if [[ "$MYSQL_VERSION" == "mysql84" ]]; then + # Use default plugin for MySQL 8.4+. + # If the first attempt fails (Access Denied), check if the password was already set to the target. + mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password || \ + mysql -u root -p'Ss123%321' -Bse "SELECT 1;" && echo "Password already set to Ss123%321" +else + # Use native password for older versions + mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password +fi # 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 ln -sf /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock -sudo mkdir /var/log/mysql +sudo mkdir -p /var/log/mysql sudo chown mysql:mysql /var/log/mysql # Required to allow mysql to accept connections on 3307 @@ -38,10 +67,11 @@ if [ ${ID} == rocky ]; then else sudo yum install -y policycoreutils-python fi -sudo semanage port --add --type mysqld_port_t --proto tcp 3307 + +# Add port 3307 to SELinux, ignoring error if it already exists +sudo semanage port --add --type mysqld_port_t --proto tcp 3307 || echo "Port 3307 already added to SELinux" # 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 < config-user -[client] -user=root -password='Ss123%321' -EOF +source /etc/os-release +MAJOR_VERSION_ID=${VERSION_ID%%.*} + +AUTH_FLAG="--default-authentication-plugin=mysql_native_password" +IDENTIFIED_WITH="IDENTIFIED WITH mysql_native_password" +SHOW_STATUS_CMD="SHOW MASTER STATUS;" +EXTRA_CONFIG="" + +if [[ "$MAJOR_VERSION_ID" == "10" ]]; then + AUTH_FLAG="" + IDENTIFIED_WITH="IDENTIFIED" + SHOW_STATUS_CMD="SHOW BINARY LOG STATUS;" + # Fix for 'Authentication requires secure connection' + EXTRA_CONFIG=", GET_SOURCE_PUBLIC_KEY=1" + + # Allow MySQL to connect to the second instance via SELinux + sudo setsebool -P mysql_connect_any 1 || echo "SELinux boolean already set or not available" + + sudo mkdir -p /var/lib/mysql2 + sudo chown mysql:mysql /var/lib/mysql2 + sudo rm -rf /var/lib/mysql2/* + sudo rm -f /var/log/mysql/error2.log +fi + +# Create a temporary init file to set the password immediately +echo "ALTER USER 'root'@'localhost' $IDENTIFIED_WITH BY 'Ss123%321';" > /tmp/mysql-init.sql + +# 1. Initialize second instance +sudo mysqld --defaults-group-suffix=2 --initialize-insecure $AUTH_FLAG + +# 2. Start with the init-file +nohup sudo mysqld --defaults-group-suffix=2 $AUTH_FLAG --init-file=/tmp/mysql-init.sql 2>/dev/null >/dev/null /dev/null >/dev/null config-user-2 +cat < config-user [client] user=root -password='$password' +password='Ss123%321' EOF -sudo mysql --defaults-extra-file=config-user-2 -S /var/run/mysqld/mysql2.sock -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password - # Create replication user -sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "CREATE USER 'repl'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';" +sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "CREATE USER IF NOT EXISTS 'repl'@'localhost' $IDENTIFIED_WITH BY 'password'; ALTER USER 'repl'@'localhost' $IDENTIFIED_WITH BY 'password';" sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost';" -# Dump data from replica source -sudo mysqldump --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock --all-databases --source-data > /tmp/dbdump.sql +# Dump data (Instance 2) +sudo mysqldump --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock --all-databases --source-data --ignore-table=mysql.slave_master_info --ignore-table=mysql.slave_relay_log_info --ignore-table=mysql.slave_worker_info > /tmp/dbdump.sql + +# Capture status +raw_status=$(sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "$SHOW_STATUS_CMD") +read -r logfile logpos <<< "$raw_status" -# Capture status to seed replica -raw_status=$(sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "SHOW MASTER STATUS;") -read -r logfile logpos <<< $raw_status +# --- REPLICATION PROTECTION ON INSTANCE 1 --- +sudo mysql --defaults-extra-file=config-user -Bse "STOP REPLICA IO_THREAD; STOP REPLICA; RESET REPLICA ALL;" -# Dump data from source into replica +# Load data into primary instance (Instance 1) sudo mysql --defaults-extra-file=config-user < /tmp/dbdump.sql -# Configure replication -sudo mysql --defaults-extra-file=config-user -Bse "STOP REPLICA;" -sudo mysql --defaults-extra-file=config-user -Bse "CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='repl', SOURCE_PORT=3307, SOURCE_PASSWORD='password', SOURCE_LOG_FILE='$logfile', SOURCE_LOG_POS=$logpos;" +# Force another stop/reset just in case the dump re-enabled something +sudo mysql --defaults-extra-file=config-user -Bse "STOP REPLICA IO_THREAD; STOP REPLICA; RESET REPLICA ALL;" +sleep 2 + +# Configure the new source (Added EXTRA_CONFIG for RHEL 10) +sudo mysql --defaults-extra-file=config-user -Bse "CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='repl', SOURCE_PORT=3307, SOURCE_PASSWORD='password', SOURCE_LOG_FILE='$logfile', SOURCE_LOG_POS=$logpos $EXTRA_CONFIG;" sudo mysql --defaults-extra-file=config-user -Bse "START REPLICA;" +# -------------------------------------------- -sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL log_slow_extra = 'ON'" +# Set global logs +sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL log_slow_extra = 'ON'" || echo "log_slow_extra not supported" sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL long_query_time = 0" sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL slow_query_log = 1" sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL general_log = 'ON'" sudo mysql --defaults-extra-file=config-user -Bse "select table_catalog, table_schema, table_name from information_schema.tables" + +# Cleanup +rm /tmp/mysql-init.sql \ No newline at end of file diff --git a/integration_test/third_party_apps_test/applications/mysql5.7/metadata.yaml b/integration_test/third_party_apps_test/applications/mysql5.7/metadata.yaml index 4746f35cd7..b4d3baacd1 100644 --- a/integration_test/third_party_apps_test/applications/mysql5.7/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/mysql5.7/metadata.yaml @@ -50,6 +50,11 @@ platforms_to_skip: - rocky-linux-cloud:rocky-linux-9-optimized-gcp - rocky-linux-cloud:rocky-linux-9-arm64 - rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64 + # repo not available for rh10 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 - debian-cloud:debian-11 - debian-cloud:debian-12 - debian-cloud:debian-12-arm64 diff --git a/integration_test/third_party_apps_test/applications/oracledb/metadata.yaml b/integration_test/third_party_apps_test/applications/oracledb/metadata.yaml index 31719c79ba..2e424f859d 100644 --- a/integration_test/third_party_apps_test/applications/oracledb/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/oracledb/metadata.yaml @@ -63,6 +63,10 @@ platforms_to_skip: - rocky-linux-cloud:rocky-linux-9-optimized-gcp - rocky-linux-cloud:rocky-linux-9-arm64 - rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 - suse-cloud:sles-12 - suse-cloud:sles-15 - suse-cloud:sles-15-arm64 diff --git a/integration_test/third_party_apps_test/applications/postgresql/centos_rhel/install b/integration_test/third_party_apps_test/applications/postgresql/centos_rhel/install index 1aa5bf5471..22383e703b 100644 --- a/integration_test/third_party_apps_test/applications/postgresql/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/postgresql/centos_rhel/install @@ -2,6 +2,10 @@ set -e source /etc/os-release ARCH=$(uname -m) + +# Default to 14 for RHEL 7, 8, and 9 +PG_VER=14 + case "${VERSION_ID}" in 7) sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-"${ARCH}"/pgdg-redhat-repo-latest.noarch.rpm @@ -13,24 +17,33 @@ case "${VERSION_ID}" in 9|9.*) sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-"${ARCH}"/pgdg-redhat-repo-latest.noarch.rpm ;; + 10|10.*) + # Upgrade to 16 for RHEL 10 to ensure stability on modern kernels/libraries + PG_VER=16 + sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-"${ARCH}"/pgdg-redhat-repo-latest.noarch.rpm + ;; *) echo -n "unknown version" exit 1 ;; esac -sudo yum install -y postgresql14-server postgresql14-contrib -sudo systemctl enable postgresql-14 +# Install the version determined above +sudo yum install -y postgresql${PG_VER}-server postgresql${PG_VER}-contrib +sudo systemctl enable postgresql-${PG_VER} -sudo /usr/pgsql-14/bin/postgresql-14-setup initdb -sudo service postgresql-14 restart +# Setup paths based on the dynamic version +DATA_ROOT=/var/lib/pgsql/${PG_VER} +CFG_ROOT=/var/lib/pgsql/${PG_VER} +# Initialize and start +sudo /usr/pgsql-${PG_VER}/bin/postgresql-${PG_VER}-setup initdb +sudo systemctl start postgresql-${PG_VER} + +# User setup sudo su postgres -c "psql postgres -c \"ALTER ROLE postgres WITH PASSWORD 'abc123';\"" sudo su postgres -c "psql postgres -c \"CREATE ROLE replica_user WITH REPLICATION LOGIN PASSWORD 'abc123';\"" -DATA_ROOT=/var/lib/pgsql/14 -CFG_ROOT=/var/lib/pgsql/14 - ### Everything following this comment is designed to set up a paused replica to get replication metrics sudo tee -a ${CFG_ROOT}/data/postgresql.conf << EOF wal_level = logical @@ -40,7 +53,7 @@ archive_command = 'test ! -f $DATA_ROOT/data/archive/%f && cp %p $DATA_ROOT/data archive_timeout = 10s EOF -sudo mkdir $DATA_ROOT/data/archive/ +sudo mkdir -p $DATA_ROOT/data/archive/ sudo chown postgres:postgres $DATA_ROOT/data/archive/ # allow replica connection from localhost @@ -48,7 +61,7 @@ sudo tee -a ${CFG_ROOT}/data/pg_hba.conf << EOF host replication replica_user localhost md5 EOF -sudo systemctl restart postgresql-14 +sudo systemctl restart postgresql-${PG_VER} # backup from primary to repl directory and configure replication sudo tee ${DATA_ROOT}/.pgpass << EOF @@ -56,7 +69,9 @@ sudo tee ${DATA_ROOT}/.pgpass << EOF EOF sudo chown postgres:postgres ${DATA_ROOT}/.pgpass sudo chmod 600 ${DATA_ROOT}/.pgpass -sudo PGPASSFILE=${DATA_ROOT}/.pgpass pg_basebackup -h localhost -U replica_user -X stream -C -S replica_2 -v -R -w -D ${DATA_ROOT}/repl/ + +# Use version-specific pg_basebackup +sudo PGPASSFILE=${DATA_ROOT}/.pgpass /usr/pgsql-${PG_VER}/bin/pg_basebackup -h localhost -U replica_user -X stream -C -S replica_2 -v -R -w -D ${DATA_ROOT}/repl/ sudo touch ${DATA_ROOT}/repl/pg_hba.conf sudo chown postgres:postgres ${DATA_ROOT}/repl/pg_hba.conf @@ -81,8 +96,8 @@ EOF sudo chown -R postgres:postgres ${DATA_ROOT}/repl # start the replica in the background -nohup sudo su postgres -c "/usr/pgsql-14/bin/postgres -D ${DATA_ROOT}/repl" 2>/dev/null >/dev/null /tmp/replica_postgres.log 2>&1 & # give it time to start, since we put it in the background sleep 5 # pause the replication so we see delay metrics populated -sudo su postgres -c "PGPASSWORD=abc123 psql postgres -h localhost -p 5434 -c \"SELECT pg_wal_replay_pause();\"" +sudo su postgres -c "PGPASSWORD=abc123 psql postgres -h localhost -p 5434 -c \"SELECT pg_wal_replay_pause();\"" \ No newline at end of file diff --git a/integration_test/third_party_apps_test/applications/rabbitmq/centos_rhel/install b/integration_test/third_party_apps_test/applications/rabbitmq/centos_rhel/install index c242f41f94..8e0ca0b1a9 100644 --- a/integration_test/third_party_apps_test/applications/rabbitmq/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/rabbitmq/centos_rhel/install @@ -1,10 +1,11 @@ set -e source /etc/os-release +MAJOR_VERSION_ID=${VERSION_ID%%.*} -# if os is rhel 9, crb is required to access epel +# if os is rhel 9 or 10, crb is required to access epel case "$VERSION_ID" in - 9*) sudo yum config-manager --set-enabled crb;; + 9*|10*) sudo yum config-manager --set-enabled crb;; esac sudo yum install -y curl epel-release @@ -17,12 +18,12 @@ if [[ "$(uname -m)" == aarch64 ]]; then else curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh --output erlang.rpm.sh chmod +x erlang.rpm.sh - sudo os=el dist=8 ./erlang.rpm.sh + sudo os=el dist=${MAJOR_VERSION_ID} ./erlang.rpm.sh fi curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh --output rabbitmq-server.rpm.sh chmod +x rabbitmq-server.rpm.sh -sudo os=el dist=8 ./rabbitmq-server.rpm.sh +sudo os=el dist=${MAJOR_VERSION_ID} ./rabbitmq-server.rpm.sh sudo yum makecache -y \ --disablerepo='*' --enablerepo='rabbitmq_rabbitmq-server' diff --git a/integration_test/third_party_apps_test/applications/rabbitmq/metadata.yaml b/integration_test/third_party_apps_test/applications/rabbitmq/metadata.yaml index 6551dfe564..e586c61542 100644 --- a/integration_test/third_party_apps_test/applications/rabbitmq/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/rabbitmq/metadata.yaml @@ -38,6 +38,10 @@ platforms_to_skip: - debian-cloud:debian-13-arm64 # rabbitmq-server not available on Debian 13 yet: http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu/dists/ # RabbitMQ is not supported on various distros. - suse-cloud:sles-12 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 supported_app_version: ["3.8", "3.9"] expected_metrics: - type: workload.googleapis.com/rabbitmq.consumer.count diff --git a/integration_test/third_party_apps_test/applications/redis/metadata.yaml b/integration_test/third_party_apps_test/applications/redis/metadata.yaml index 7f617c6ad4..5d07c8374f 100644 --- a/integration_test/third_party_apps_test/applications/redis/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/redis/metadata.yaml @@ -32,6 +32,11 @@ platforms_to_skip: - suse-cloud:sles-12 # File '/repositories/server:/monitoring/SLE_12/server:monitoring.repo' not found - suse-cloud:sles-15 # File '/repositories/server:database/SLE_15/server:database.repo' not found - suse-cloud:sles-15-arm64 + # redis repo not available for rh10 yet + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 supported_app_version: ["6.2"] expected_metrics: - type: workload.googleapis.com/redis.clients.blocked diff --git a/integration_test/third_party_apps_test/applications/solr/centos_rhel/install b/integration_test/third_party_apps_test/applications/solr/centos_rhel/install index 22408c2853..01138bbc3c 100644 --- a/integration_test/third_party_apps_test/applications/solr/centos_rhel/install +++ b/integration_test/third_party_apps_test/applications/solr/centos_rhel/install @@ -9,8 +9,13 @@ SELINUX=disabled SELINUXTYPE=targeted EOF +JAVA_VERSION=1.8.0 +if [[ "$ID" == "rocky" && "$MAJOR_VERSION_ID" == "10" ]]; then + JAVA_VERSION=21 +fi + sudo yum install -y \ - java-1.8.0-openjdk java-1.8.0-openjdk-devel curl lsof chkconfig + java-${JAVA_VERSION}-openjdk java-${JAVA_VERSION}-openjdk-devel curl lsof chkconfig # https://github.com/GoogleCloudPlatform/ops-agent/blob/master/integration_test/README.md#vendored-dependencies curl -L -o \ diff --git a/integration_test/third_party_apps_test/applications/vault/metadata.yaml b/integration_test/third_party_apps_test/applications/vault/metadata.yaml index d7c233f393..b216f183ea 100644 --- a/integration_test/third_party_apps_test/applications/vault/metadata.yaml +++ b/integration_test/third_party_apps_test/applications/vault/metadata.yaml @@ -68,6 +68,11 @@ configure_integration: |- ``` supported_operating_systems: linux platforms_to_skip: + # hashicorp repo not available for rh10 + - rocky-linux-cloud:rocky-linux-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + - rocky-linux-cloud:rocky-linux-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 - ubuntu-os-cloud:ubuntu-2510-amd64 # vault not available for 25.10 yet: https://www.hashicorp.com/en/official-packaging-guide - ubuntu-os-cloud:ubuntu-2510-arm64 # vault not available for 25.10 yet: https://www.hashicorp.com/en/official-packaging-guide supported_app_version: ["1.6+"] diff --git a/kokoro/config/build/presubmit/rockylinux10_aarch64.gcl b/kokoro/config/build/presubmit/rockylinux10_aarch64.gcl new file mode 100644 index 0000000000..06d59ecec9 --- /dev/null +++ b/kokoro/config/build/presubmit/rockylinux10_aarch64.gcl @@ -0,0 +1,10 @@ +import '../common.gcl' as common + +config build = common.build { + params { + environment { + DISTRO = 'rockylinux10' + PKGFORMAT = 'rpm' + } + } +} diff --git a/kokoro/config/build/presubmit/rockylinux10_x86_64.gcl b/kokoro/config/build/presubmit/rockylinux10_x86_64.gcl new file mode 100644 index 0000000000..06d59ecec9 --- /dev/null +++ b/kokoro/config/build/presubmit/rockylinux10_x86_64.gcl @@ -0,0 +1,10 @@ +import '../common.gcl' as common + +config build = common.build { + params { + environment { + DISTRO = 'rockylinux10' + PKGFORMAT = 'rpm' + } + } +} diff --git a/kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64.gcl b/kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64.gcl new file mode 100644 index 0000000000..b358e4788a --- /dev/null +++ b/kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.ops_agent_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'aarch64' + } + } +} diff --git a/kokoro/config/test/ops_agent/presubmit/rockylinux9_aarch64_uap_plugin.gcl b/kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64_uap_plugin.gcl similarity index 85% rename from kokoro/config/test/ops_agent/presubmit/rockylinux9_aarch64_uap_plugin.gcl rename to kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64_uap_plugin.gcl index c02cdf20e3..46cbf2e64d 100644 --- a/kokoro/config/test/ops_agent/presubmit/rockylinux9_aarch64_uap_plugin.gcl +++ b/kokoro/config/test/ops_agent/presubmit/rockylinux10_aarch64_uap_plugin.gcl @@ -3,7 +3,7 @@ import 'common.gcl' as common config build = common.ops_agent_test { params { environment { - TARGET = 'rockylinux9' + TARGET = 'rockylinux10' ARCH = 'aarch64' IS_OPS_AGENT_UAP_PLUGIN = 'true' } diff --git a/kokoro/config/test/ops_agent/presubmit/rockylinux9_x86_64_uap_plugin.gcl b/kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64.gcl similarity index 66% rename from kokoro/config/test/ops_agent/presubmit/rockylinux9_x86_64_uap_plugin.gcl rename to kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64.gcl index 9e50aba573..bb31a18cc7 100644 --- a/kokoro/config/test/ops_agent/presubmit/rockylinux9_x86_64_uap_plugin.gcl +++ b/kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64.gcl @@ -3,9 +3,8 @@ import 'common.gcl' as common config build = common.ops_agent_test { params { environment { - TARGET = 'rockylinux9' + TARGET = 'rockylinux10' ARCH = 'x86_64' - IS_OPS_AGENT_UAP_PLUGIN = 'true' } } } diff --git a/kokoro/config/test/ops_agent/presubmit/rockylinux8_x86_64_uap_plugin.gcl b/kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64_uap_plugin.gcl similarity index 85% rename from kokoro/config/test/ops_agent/presubmit/rockylinux8_x86_64_uap_plugin.gcl rename to kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64_uap_plugin.gcl index 02ff0be464..9ffa2dd218 100644 --- a/kokoro/config/test/ops_agent/presubmit/rockylinux8_x86_64_uap_plugin.gcl +++ b/kokoro/config/test/ops_agent/presubmit/rockylinux10_x86_64_uap_plugin.gcl @@ -3,7 +3,7 @@ import 'common.gcl' as common config build = common.ops_agent_test { params { environment { - TARGET = 'centos8' + TARGET = 'rockylinux10' ARCH = 'x86_64' IS_OPS_AGENT_UAP_PLUGIN = 'true' } diff --git a/kokoro/config/test/ops_agent/release/rockylinux10_aarch64.gcl b/kokoro/config/test/ops_agent/release/rockylinux10_aarch64.gcl new file mode 100644 index 0000000000..b358e4788a --- /dev/null +++ b/kokoro/config/test/ops_agent/release/rockylinux10_aarch64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.ops_agent_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'aarch64' + } + } +} diff --git a/kokoro/config/test/ops_agent/release/rockylinux10_x86_64.gcl b/kokoro/config/test/ops_agent/release/rockylinux10_x86_64.gcl new file mode 100644 index 0000000000..bb31a18cc7 --- /dev/null +++ b/kokoro/config/test/ops_agent/release/rockylinux10_x86_64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.ops_agent_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'x86_64' + } + } +} diff --git a/kokoro/config/test/third_party_apps/presubmit/rockylinux10_aarch64.gcl b/kokoro/config/test/third_party_apps/presubmit/rockylinux10_aarch64.gcl new file mode 100644 index 0000000000..7fc800327b --- /dev/null +++ b/kokoro/config/test/third_party_apps/presubmit/rockylinux10_aarch64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.third_party_apps_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'aarch64' + } + } +} diff --git a/kokoro/config/test/third_party_apps/presubmit/rockylinux10_x86_64.gcl b/kokoro/config/test/third_party_apps/presubmit/rockylinux10_x86_64.gcl new file mode 100644 index 0000000000..603d1437e2 --- /dev/null +++ b/kokoro/config/test/third_party_apps/presubmit/rockylinux10_x86_64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.third_party_apps_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'x86_64' + } + } +} diff --git a/kokoro/config/test/third_party_apps/release/rockylinux10_aarch64.gcl b/kokoro/config/test/third_party_apps/release/rockylinux10_aarch64.gcl new file mode 100644 index 0000000000..7fc800327b --- /dev/null +++ b/kokoro/config/test/third_party_apps/release/rockylinux10_aarch64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.third_party_apps_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'aarch64' + } + } +} diff --git a/kokoro/config/test/third_party_apps/release/rockylinux10_x86_64.gcl b/kokoro/config/test/third_party_apps/release/rockylinux10_x86_64.gcl new file mode 100644 index 0000000000..603d1437e2 --- /dev/null +++ b/kokoro/config/test/third_party_apps/release/rockylinux10_x86_64.gcl @@ -0,0 +1,10 @@ +import 'common.gcl' as common + +config build = common.third_party_apps_test { + params { + environment { + TARGET = 'rockylinux10' + ARCH = 'x86_64' + } + } +} diff --git a/project.yaml b/project.yaml index f99389a133..d6b2b9372b 100644 --- a/project.yaml +++ b/project.yaml @@ -157,6 +157,10 @@ targets: exhaustive: - rhel-cloud:rhel-9 - rocky-linux-cloud:rocky-linux-9-optimized-gcp + - rhel-sap-cloud:rhel-9-0-sap-ha + - rhel-sap-cloud:rhel-9-2-sap-ha + - rhel-sap-cloud:rhel-9-4-sap-ha + - rhel-sap-cloud:rhel-9-6-sap-ha aarch64: test_distros: representative: @@ -164,6 +168,30 @@ targets: exhaustive: - rhel-cloud:rhel-9-arm64 - rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64 + + rockylinux10: + os_versions: [centos-10*,rocky-10*,rhel-10*] + package_extension: + rpm + repo_name: + el10 + architectures: + x86_64: + test_distros: + representative: + - rocky-linux-cloud:rocky-linux-10 + exhaustive: + - rhel-cloud:rhel-10 + - centos-cloud:centos-stream-10 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp + aarch64: + test_distros: + representative: + - rocky-linux-cloud:rocky-linux-10-arm64 + exhaustive: + - rhel-cloud:rhel-10-arm64 + - centos-cloud:centos-stream-10-arm64 + - rocky-linux-cloud:rocky-linux-10-optimized-gcp-arm64 sles12: os_versions: [sles-12*] package_extension: