From 95144b5594b6f80a71a85898ae373629c45a9588 Mon Sep 17 00:00:00 2001 From: braydonk Date: Thu, 27 Jun 2024 09:45:34 -0400 Subject: [PATCH 01/10] update sles15 sap image family --- project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.yaml b/project.yaml index dc5748692e..d540fdde66 100644 --- a/project.yaml +++ b/project.yaml @@ -164,7 +164,7 @@ targets: - suse-cloud:sles-15 exhaustive: - suse-sap-cloud:sles-15-sp2-sap - - suse-sap-cloud:sles-15-sp5-sap + - suse-sap-cloud:sles-15-sp6-sap - opensuse-cloud:opensuse-leap - opensuse-cloud=opensuse-leap-15-5-v20240516-x86-64 - opensuse-cloud=opensuse-leap-15-6-v20240612-x86-64 From a716b62f71fde5f3323f8ac5a04165c9049aaf70 Mon Sep 17 00:00:00 2001 From: braydonk Date: Tue, 2 Jul 2024 17:47:08 +0000 Subject: [PATCH 02/10] use another canary package for SP6 --- integration_test/gce/gce_testing.go | 32 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index 8c7b532c56..36ccdfde61 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -973,7 +973,7 @@ const ( // First it repeatedly runs registercloudguest, then it repeatedly tries installing a dummy package until it succeeds. // When that happens, the VM is ready to install packages. // See b/148612123 and b/196246592 for some history about this. -func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM) error { +func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM, testPackage string) error { backoffPolicy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewConstantBackOff(5*time.Second), 5), ctx) // 5 attempts. err := backoff.Retry(func() error { _, err := RunRemotely(ctx, logger, vm, "sudo /usr/sbin/registercloudguest --force") @@ -989,10 +989,19 @@ func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM) error { // --gpg-auto-import-keys is included to fix a rare flake where (due to // a policy being installed already) there is a new key that needs to // be imported. - // timezone-java was selected arbitrarily as a package that: + // This function accepts a package to use for install. + // By default, timezone-java is selected as it is a package that: // a) can be installed from the default repos, and // b) isn't installed already. - _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install timezone-java") + if testPackage == "" { + testPackage = "timezone-java" + } + _, zypperErr := RunRemotely( + ctx, + logger, + vm, + fmt.Sprintf("sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install %s", testPackage), + ) return zypperErr }, backoffPolicy) if err != nil { @@ -1271,7 +1280,14 @@ func attemptCreateInstance(ctx context.Context, logger *log.Logger, options VMOp } if IsSLESVM(vm) { - if err := prepareSLES(ctx, logger, vm); err != nil { + testPackage := "" + if IsSLESSP6(vm) { + // The default timezone-java package is not available in SP6. + // For SP6, we use another package with minimal dependencies + // that is quick to install. + testPackage = "abseil-cpp-devel" + } + if err := prepareSLES(ctx, logger, vm, testPackage); err != nil { return nil, fmt.Errorf("%s: %v", prepareSLESMessage, err) } } @@ -1314,6 +1330,10 @@ func IsSLESVM(vm *VM) bool { return vm.OS.ID == "sles" || vm.OS.ID == "sles_sap" } +func IsSLESSP6(vm *VM) bool { + return strings.Contains(vm.ImageSpec, "sles-15-sp6") +} + func IsSUSEVM(vm *VM) bool { return vm.OS.ID == "opensuse" || vm.OS.ID == "opensuse-leap" || IsSLESVM(vm) } @@ -1586,7 +1606,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" INSTALL_LOG="$(mktemp)" # This command produces a lot of console spam, so we only display that # output if there is a problem. - sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} + sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} sudo --preserve-env ${INSTALL_DIR}/google-cloud-sdk/install.sh -q &>"${INSTALL_LOG}" || \ EXIT_CODE=$? if [[ "${EXIT_CODE-}" ]]; then @@ -1600,7 +1620,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" # Upgrade to the latest version sudo ${INSTALL_DIR}/google-cloud-sdk/bin/gcloud components update --quiet -sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil +sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil ` // b/308962066: The GCloud CLI ARM Linux tarballs do not have bundled Python // and the GCloud CLI requires Python >= 3.8. Install Python311 for ARM VMs From 4b445af646335036d7b110c8ee6781f214f9cec9 Mon Sep 17 00:00:00 2001 From: braydonk Date: Wed, 3 Jul 2024 01:59:37 +0000 Subject: [PATCH 03/10] Revert "use another canary package for SP6" This reverts commit 42327203017c8e6037e928cd1129089ef30dabd7. --- integration_test/gce/gce_testing.go | 32 ++++++----------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index 36ccdfde61..8c7b532c56 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -973,7 +973,7 @@ const ( // First it repeatedly runs registercloudguest, then it repeatedly tries installing a dummy package until it succeeds. // When that happens, the VM is ready to install packages. // See b/148612123 and b/196246592 for some history about this. -func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM, testPackage string) error { +func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM) error { backoffPolicy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewConstantBackOff(5*time.Second), 5), ctx) // 5 attempts. err := backoff.Retry(func() error { _, err := RunRemotely(ctx, logger, vm, "sudo /usr/sbin/registercloudguest --force") @@ -989,19 +989,10 @@ func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM, testPackage st // --gpg-auto-import-keys is included to fix a rare flake where (due to // a policy being installed already) there is a new key that needs to // be imported. - // This function accepts a package to use for install. - // By default, timezone-java is selected as it is a package that: + // timezone-java was selected arbitrarily as a package that: // a) can be installed from the default repos, and // b) isn't installed already. - if testPackage == "" { - testPackage = "timezone-java" - } - _, zypperErr := RunRemotely( - ctx, - logger, - vm, - fmt.Sprintf("sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install %s", testPackage), - ) + _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install timezone-java") return zypperErr }, backoffPolicy) if err != nil { @@ -1280,14 +1271,7 @@ func attemptCreateInstance(ctx context.Context, logger *log.Logger, options VMOp } if IsSLESVM(vm) { - testPackage := "" - if IsSLESSP6(vm) { - // The default timezone-java package is not available in SP6. - // For SP6, we use another package with minimal dependencies - // that is quick to install. - testPackage = "abseil-cpp-devel" - } - if err := prepareSLES(ctx, logger, vm, testPackage); err != nil { + if err := prepareSLES(ctx, logger, vm); err != nil { return nil, fmt.Errorf("%s: %v", prepareSLESMessage, err) } } @@ -1330,10 +1314,6 @@ func IsSLESVM(vm *VM) bool { return vm.OS.ID == "sles" || vm.OS.ID == "sles_sap" } -func IsSLESSP6(vm *VM) bool { - return strings.Contains(vm.ImageSpec, "sles-15-sp6") -} - func IsSUSEVM(vm *VM) bool { return vm.OS.ID == "opensuse" || vm.OS.ID == "opensuse-leap" || IsSLESVM(vm) } @@ -1606,7 +1586,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" INSTALL_LOG="$(mktemp)" # This command produces a lot of console spam, so we only display that # output if there is a problem. - sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} + sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} sudo --preserve-env ${INSTALL_DIR}/google-cloud-sdk/install.sh -q &>"${INSTALL_LOG}" || \ EXIT_CODE=$? if [[ "${EXIT_CODE-}" ]]; then @@ -1620,7 +1600,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" # Upgrade to the latest version sudo ${INSTALL_DIR}/google-cloud-sdk/bin/gcloud components update --quiet -sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil +sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil ` // b/308962066: The GCloud CLI ARM Linux tarballs do not have bundled Python // and the GCloud CLI requires Python >= 3.8. Install Python311 for ARM VMs From 5df86967d75f72ac5af26683cc89e5f1f0165afc Mon Sep 17 00:00:00 2001 From: braydonk Date: Wed, 3 Jul 2024 02:04:38 +0000 Subject: [PATCH 04/10] force install a package that will always be around --- integration_test/gce/gce_testing.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index 8c7b532c56..283802296a 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -989,9 +989,8 @@ func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM) error { // --gpg-auto-import-keys is included to fix a rare flake where (due to // a policy being installed already) there is a new key that needs to // be imported. - // timezone-java was selected arbitrarily as a package that: - // a) can be installed from the default repos, and - // b) isn't installed already. + // To fix this, we force install a package. coreutils is arbitrarily + // chosen as it's all but guaranteed to be present. _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install timezone-java") return zypperErr }, backoffPolicy) @@ -1586,7 +1585,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" INSTALL_LOG="$(mktemp)" # This command produces a lot of console spam, so we only display that # output if there is a problem. - sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} + sudo tar -xf ` + gcloudPkg + ` -C ${INSTALL_DIR} sudo --preserve-env ${INSTALL_DIR}/google-cloud-sdk/install.sh -q &>"${INSTALL_LOG}" || \ EXIT_CODE=$? if [[ "${EXIT_CODE-}" ]]; then @@ -1600,7 +1599,7 @@ INSTALL_DIR="$(readlink --canonicalize .)" # Upgrade to the latest version sudo ${INSTALL_DIR}/google-cloud-sdk/bin/gcloud components update --quiet -sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil +sudo ln -s ${INSTALL_DIR}/google-cloud-sdk/bin/gsutil /usr/bin/gsutil ` // b/308962066: The GCloud CLI ARM Linux tarballs do not have bundled Python // and the GCloud CLI requires Python >= 3.8. Install Python311 for ARM VMs From a9c5aad2001193ea3110e45558e0a98828c44ee5 Mon Sep 17 00:00:00 2001 From: braydonk Date: Wed, 3 Jul 2024 13:09:13 +0000 Subject: [PATCH 05/10] well I need to actually make the change --- integration_test/gce/gce_testing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index 283802296a..1eb2e4ee11 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -991,7 +991,7 @@ func prepareSLES(ctx context.Context, logger *log.Logger, vm *VM) error { // be imported. // To fix this, we force install a package. coreutils is arbitrarily // chosen as it's all but guaranteed to be present. - _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install timezone-java") + _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install --force coreutils") return zypperErr }, backoffPolicy) if err != nil { From 88562f5654af15c1fc0cf6ad4f79ea74f5d49baa Mon Sep 17 00:00:00 2001 From: braydonk Date: Wed, 3 Jul 2024 18:16:37 +0000 Subject: [PATCH 06/10] hack fix for SLES postgres --- .../applications/postgresql/sles/install | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration_test/third_party_apps_test/applications/postgresql/sles/install b/integration_test/third_party_apps_test/applications/postgresql/sles/install index a9e7702132..e0047c230a 100644 --- a/integration_test/third_party_apps_test/applications/postgresql/sles/install +++ b/integration_test/third_party_apps_test/applications/postgresql/sles/install @@ -14,6 +14,14 @@ if [[ "${SUSE_VERSION}" == 12 ]]; then sudo zypper --no-gpg-checks in -y postgresql14-server=14.1-3.3.1 postgresql14-contrib=14.1-3.3.1 postgresql14-libs=14.1-1PGDG.sles12 postgresql14=14.1-3.3.1 elif [[ "${SUSE_VERSION}" == 15 ]]; then sudo zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-15-pg14.repo + + # VERSION_ID is taken from /etc/os-release, and is of the form .. + if [[ "$VERSION_ID" == "15.6" ]]; then + # TODO(b/350987619): There is currently no "15.6" repo for PostgreSQL 14. Since the automatic + # $releasever variable + sudo sed -i "s/\$releasever/15/g" /etc/zypp/repos.d/pgdg-14.repo + fi + sudo zypper --non-interactive --no-gpg-checks ref sudo zypper --no-gpg-checks in -y postgresql14-server postgresql14-contrib postgresql14 From d986df267bcc5bd183dbd0e547e3cc5b4e05bb20 Mon Sep 17 00:00:00 2001 From: braydonk Date: Fri, 5 Jul 2024 16:37:30 +0000 Subject: [PATCH 07/10] enable legacy module for Java 11 3pas --- .../applications/activemq/sles/install | 9 +++++++++ .../applications/couchbase/sles/install | 9 +++++---- .../applications/elasticsearch/sles/install | 11 ++++++++++- .../applications/flink/sles/install | 13 +++++++++++-- .../applications/hadoop/sles/install | 11 ++++++++++- .../applications/hbase/sles/install | 9 +++++++++ .../applications/jetty/sles/install | 12 +++++++++++- .../applications/jvm/sles/install | 11 ++++++++--- .../applications/kafka/sles/install | 9 +++++++++ .../applications/solr/sles/install | 9 +++++++++ .../applications/tomcat/sles/install | 16 +++++++++++++--- .../applications/wildfly/sles/install | 9 +++++++++ .../applications/zookeeper/sles/install | 9 +++++++++ 13 files changed, 122 insertions(+), 15 deletions(-) diff --git a/integration_test/third_party_apps_test/applications/activemq/sles/install b/integration_test/third_party_apps_test/applications/activemq/sles/install index ba701f6b58..bad6f83f45 100644 --- a/integration_test/third_party_apps_test/applications/activemq/sles/install +++ b/integration_test/third_party_apps_test/applications/activemq/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y \ curl java-11-openjdk java-11-openjdk-devel diff --git a/integration_test/third_party_apps_test/applications/couchbase/sles/install b/integration_test/third_party_apps_test/applications/couchbase/sles/install index 29a0a28573..41f81d404e 100644 --- a/integration_test/third_party_apps_test/applications/couchbase/sles/install +++ b/integration_test/third_party_apps_test/applications/couchbase/sles/install @@ -1,11 +1,12 @@ -set -e +set -e source /etc/os-release SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" -# SLES 15 SP5 has moved Java 8 to a legacy module -if [[ "${SUSE_VERSION}" == 15 ]]; then - sudo SUSEConnect --product sle-module-legacy/15.5/$(uname -m) +# SLES 15 SP5 moved Java 8 to a legacy module +if (( $SERVICE_PACK >= 5 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) fi if [[ "$(uname -m)" == aarch64 ]]; then diff --git a/integration_test/third_party_apps_test/applications/elasticsearch/sles/install b/integration_test/third_party_apps_test/applications/elasticsearch/sles/install index 5cac8bd773..7b080d71eb 100644 --- a/integration_test/third_party_apps_test/applications/elasticsearch/sles/install +++ b/integration_test/third_party_apps_test/applications/elasticsearch/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y curl java-11-openjdk insserv-compat sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch @@ -21,7 +30,7 @@ sudo chmod 0644 /etc/zypp/repos.d/elasticsearch.repo sudo zypper modifyrepo --enable elasticsearch sudo zypper install -y elasticsearch -sudo zypper modifyrepo --disable elasticsearch +sudo zypper modifyrepo --disable elasticsearch sudo chkconfig elasticsearch on diff --git a/integration_test/third_party_apps_test/applications/flink/sles/install b/integration_test/third_party_apps_test/applications/flink/sles/install index 4fdca55f85..0a4268c1ad 100644 --- a/integration_test/third_party_apps_test/applications/flink/sles/install +++ b/integration_test/third_party_apps_test/applications/flink/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y curl java-11-openjdk # https://github.com/GoogleCloudPlatform/ops-agent/blob/master/integration_test/README.md#vendored-dependencies @@ -11,7 +20,7 @@ sudo tar -xzf flink.tgz -C /opt/flink --strip-components 1 cat <= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y wget java-11-openjdk java-11-openjdk-devel sudo mkdir -p \ @@ -144,4 +153,4 @@ sudo -u hadoop bash -c "source /opt/hadoop/env && hdfs namenode -format" sudo systemctl daemon-reload sudo systemctl enable hadoop sudo systemctl restart hadoop -sleep 60 +sleep 60 diff --git a/integration_test/third_party_apps_test/applications/hbase/sles/install b/integration_test/third_party_apps_test/applications/hbase/sles/install index 2c2f7e857a..a70a3ef19f 100644 --- a/integration_test/third_party_apps_test/applications/hbase/sles/install +++ b/integration_test/third_party_apps_test/applications/hbase/sles/install @@ -1,6 +1,15 @@ set -e set -o pipefail +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y wget java-11-openjdk HBASE_VERSION=2.4.11 diff --git a/integration_test/third_party_apps_test/applications/jetty/sles/install b/integration_test/third_party_apps_test/applications/jetty/sles/install index fb1031faad..981b110824 100644 --- a/integration_test/third_party_apps_test/applications/jetty/sles/install +++ b/integration_test/third_party_apps_test/applications/jetty/sles/install @@ -1,12 +1,22 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + +sudo zypper install -y wget java-11-openjdk tzdata-java + # the other available stable versions of jetty # wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.46.v20220331/jetty-distribution-9.4.46.v20220331.tar.gz # wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/10.0.9/jetty-home-10.0.9.tar.gz JETTY_VERSION=11.0.15 -sudo zypper install -y wget java-11-openjdk tzdata-java sudo wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/"$JETTY_VERSION"/jetty-home-"$JETTY_VERSION".tar.gz sudo mkdir -p /opt/jetty diff --git a/integration_test/third_party_apps_test/applications/jvm/sles/install b/integration_test/third_party_apps_test/applications/jvm/sles/install index e588ce4f39..f3b35e3d38 100644 --- a/integration_test/third_party_apps_test/applications/jvm/sles/install +++ b/integration_test/third_party_apps_test/applications/jvm/sles/install @@ -2,6 +2,7 @@ set -e source /etc/os-release SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" if [[ "${ID}" == opensuse-leap && "${VERSION_ID}" == 15.[01] ]]; then if [[ "${VERSION_ID}" == 15.0 ]]; then @@ -14,11 +15,15 @@ sudo zypper -n refresh if [[ "$(uname -m)" == aarch64 ]]; then # GCP arm64 machines ship with Java 11 vs Java 8 support + # SLES 15 SP6 moved Java 11 to a legacy module + if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) + fi sudo zypper -n install java-11-openjdk java-11-openjdk-devel else - # SLES 15 SP5 has moved Java 8 to a legacy module - if [[ "${SUSE_VERSION}" == 15 ]]; then - sudo SUSEConnect --product sle-module-legacy/15.5/$(uname -m) + # SLES 15 SP5 moved Java 8 to a legacy module + if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 5 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) fi sudo zypper -n install java-1_8_0-openjdk java-1_8_0-openjdk-devel fi diff --git a/integration_test/third_party_apps_test/applications/kafka/sles/install b/integration_test/third_party_apps_test/applications/kafka/sles/install index 1f9b044b45..8182783054 100644 --- a/integration_test/third_party_apps_test/applications/kafka/sles/install +++ b/integration_test/third_party_apps_test/applications/kafka/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y curl java-11-openjdk sudo mkdir -p /opt/kafka/stage # https://github.com/GoogleCloudPlatform/ops-agent/blob/master/integration_test/README.md#vendored-dependencies diff --git a/integration_test/third_party_apps_test/applications/solr/sles/install b/integration_test/third_party_apps_test/applications/solr/sles/install index a601a53291..4a2de5c809 100644 --- a/integration_test/third_party_apps_test/applications/solr/sles/install +++ b/integration_test/third_party_apps_test/applications/solr/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y \ java-11-openjdk java-11-openjdk-devel curl lsof insserv-compat diff --git a/integration_test/third_party_apps_test/applications/tomcat/sles/install b/integration_test/third_party_apps_test/applications/tomcat/sles/install index 398e350cf1..d2a1b5ec4d 100644 --- a/integration_test/third_party_apps_test/applications/tomcat/sles/install +++ b/integration_test/third_party_apps_test/applications/tomcat/sles/install @@ -1,6 +1,16 @@ set -e -sudo zypper --non-interactive install curl java-11-openjdk -sudo zypper --non-interactive install tomcat + +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + +sudo zypper --non-interactive install curl java-11-openjdk +sudo zypper --non-interactive install tomcat sudo mkdir -p /etc/systemd/system/tomcat.service.d sudo cat >> /etc/systemd/system/tomcat.service.d/local.conf << EOF [Service] @@ -13,7 +23,7 @@ EOF mkdir -p /usr/share/tomcat/webapps/ROOT sudo touch /usr/share/tomcat/webapps/ROOT/index.html - + sudo systemctl daemon-reload sudo service tomcat restart sleep 60 diff --git a/integration_test/third_party_apps_test/applications/wildfly/sles/install b/integration_test/third_party_apps_test/applications/wildfly/sles/install index fbbfa8df59..434a5a611b 100644 --- a/integration_test/third_party_apps_test/applications/wildfly/sles/install +++ b/integration_test/third_party_apps_test/applications/wildfly/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y curl java-11-openjdk curl -L \ diff --git a/integration_test/third_party_apps_test/applications/zookeeper/sles/install b/integration_test/third_party_apps_test/applications/zookeeper/sles/install index f7d746b083..d921ad6567 100644 --- a/integration_test/third_party_apps_test/applications/zookeeper/sles/install +++ b/integration_test/third_party_apps_test/applications/zookeeper/sles/install @@ -1,5 +1,14 @@ set -e +source /etc/os-release +SUSE_VERSION="${VERSION_ID%%.*}" +SERVICE_PACK="${VERSION_ID##*.}" + +# SLES 15 SP6 moved Java 11 to a legacy module +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then + sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) +fi + sudo zypper install -y curl java-11-openjdk sudo mkdir -p /opt/zookeeper/stage From d157aae6c51be49ef6fd03bc9872581871014855 Mon Sep 17 00:00:00 2001 From: braydonk Date: Fri, 5 Jul 2024 16:47:26 +0000 Subject: [PATCH 08/10] missed a condition for couchbase legacy module init --- .../third_party_apps_test/applications/couchbase/sles/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/third_party_apps_test/applications/couchbase/sles/install b/integration_test/third_party_apps_test/applications/couchbase/sles/install index 41f81d404e..f67d949aff 100644 --- a/integration_test/third_party_apps_test/applications/couchbase/sles/install +++ b/integration_test/third_party_apps_test/applications/couchbase/sles/install @@ -5,7 +5,7 @@ SUSE_VERSION="${VERSION_ID%%.*}" SERVICE_PACK="${VERSION_ID##*.}" # SLES 15 SP5 moved Java 8 to a legacy module -if (( $SERVICE_PACK >= 5 )); then +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 5 )); then sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) fi From 6d2d1d8e296e89f072d5d548e80e099b2ba370d4 Mon Sep 17 00:00:00 2001 From: braydonk Date: Mon, 8 Jul 2024 13:30:35 +0000 Subject: [PATCH 09/10] only install tzdata on SP5 and below --- .../third_party_apps_test/applications/jetty/sles/install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration_test/third_party_apps_test/applications/jetty/sles/install b/integration_test/third_party_apps_test/applications/jetty/sles/install index 981b110824..1f8523ea57 100644 --- a/integration_test/third_party_apps_test/applications/jetty/sles/install +++ b/integration_test/third_party_apps_test/applications/jetty/sles/install @@ -9,7 +9,12 @@ if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK >= 6 )); then sudo SUSEConnect --product sle-module-legacy/${VERSION_ID}/$(uname -m) fi -sudo zypper install -y wget java-11-openjdk tzdata-java +sudo zypper install -y wget java-11-openjdk +if [[ "$SUSE_VERSION" == 15 ]] && (( $SERVICE_PACK <= 5 )); then + # This package is necessary on older service packs, but was + # removed in SP6. + sudo zypper install -y tzdata-java +fi # the other available stable versions of jetty # wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.46.v20220331/jetty-distribution-9.4.46.v20220331.tar.gz From b07ac2428a32dcc91580d05956e2d51d4b08a868 Mon Sep 17 00:00:00 2001 From: braydonk Date: Tue, 9 Jul 2024 15:06:33 +0000 Subject: [PATCH 10/10] complete unfinished comment --- .../third_party_apps_test/applications/postgresql/sles/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration_test/third_party_apps_test/applications/postgresql/sles/install b/integration_test/third_party_apps_test/applications/postgresql/sles/install index e0047c230a..94ea5e8125 100644 --- a/integration_test/third_party_apps_test/applications/postgresql/sles/install +++ b/integration_test/third_party_apps_test/applications/postgresql/sles/install @@ -18,7 +18,8 @@ elif [[ "${SUSE_VERSION}" == 15 ]]; then # VERSION_ID is taken from /etc/os-release, and is of the form .. if [[ "$VERSION_ID" == "15.6" ]]; then # TODO(b/350987619): There is currently no "15.6" repo for PostgreSQL 14. Since the automatic - # $releasever variable + # $releasever variable will sub in "15.6" on SP6 distros, this sed is necessary to force it + # back to the root 15 (not service pack specific) repo. sudo sed -i "s/\$releasever/15/g" /etc/zypp/repos.d/pgdg-14.repo fi