From e2e1fe54f89333863d8bb1ff72aab539f89daf7e Mon Sep 17 00:00:00 2001 From: Braydon Kains <93549768+braydonk@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:19:56 -0400 Subject: [PATCH] update sles15 sap image family (#1743) --- integration_test/gce/gce_testing.go | 11 +++++------ .../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 | 17 ++++++++++++++++- .../applications/jvm/sles/install | 11 ++++++++--- .../applications/kafka/sles/install | 9 +++++++++ .../applications/postgresql/sles/install | 9 +++++++++ .../applications/solr/sles/install | 9 +++++++++ .../applications/tomcat/sles/install | 16 +++++++++++++--- .../applications/wildfly/sles/install | 9 +++++++++ .../applications/zookeeper/sles/install | 9 +++++++++ project.yaml | 2 +- 16 files changed, 142 insertions(+), 22 deletions(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index 8c7b532c56..1eb2e4ee11 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -989,10 +989,9 @@ 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. - _, zypperErr := RunRemotely(ctx, logger, vm, "sudo zypper --non-interactive --gpg-auto-import-keys refresh && sudo zypper --non-interactive install timezone-java") + // 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 --force coreutils") return zypperErr }, backoffPolicy) if err != nil { @@ -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 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..f67d949aff 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 [[ "$SUSE_VERSION" == 15 ]] && (( $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..1f8523ea57 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,27 @@ 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 +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 # 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/postgresql/sles/install b/integration_test/third_party_apps_test/applications/postgresql/sles/install index a9e7702132..94ea5e8125 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,15 @@ 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 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 + sudo zypper --non-interactive --no-gpg-checks ref sudo zypper --no-gpg-checks in -y postgresql14-server postgresql14-contrib postgresql14 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 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