diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a905c788..6e503c539 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ All notable changes to this project will be documented in this file. - java-base: Add needed tzdata-java package ([#425]). - testing-tools: Add java, tzdata-java, unzip ([#464], [#465], [#466]). +- zookeeper: add version 3.8.3 ([#470]). +- zookeeper: add upload script ([#470]). + ### Changed - Extract image tools their own [repository](https://github.com/stackabletech/image-tools) ([#437]) @@ -34,6 +37,8 @@ All notable changes to this project will be documented in this file. - pyspark-k8s: The PySpark image has been removed completely. Python is now installed with the Spark image ([#436]) - Removed all product specific changelogs and updated the root file ([#440]) +- zookeeper: removed versions 3.5.8, 3.6.3, 3.7.0, 3.8.0 ([#470]). + [#400]: https://github.com/stackabletech/docker-images/pull/400 [#419]: https://github.com/stackabletech/docker-images/pull/419 [#425]: https://github.com/stackabletech/docker-images/pull/425 @@ -49,6 +54,7 @@ All notable changes to this project will be documented in this file. [#464]: https://github.com/stackabletech/docker-images/pull/464 [#465]: https://github.com/stackabletech/docker-images/pull/465 [#466]: https://github.com/stackabletech/docker-images/pull/466 +[#470]: https://github.com/stackabletech/docker-images/pull/470 [#479]: https://github.com/stackabletech/docker-images/pull/479 ## [23.7.0] - 2023-07-14 diff --git a/conf.py b/conf.py index a9f7c7c64..3097544a6 100644 --- a/conf.py +++ b/conf.py @@ -391,14 +391,10 @@ "versions": [{"product": "0.2.0"}], }, { - # ZooKeeper must be at least 3.5.0 "name": "zookeeper", "versions": [ - {"product": "3.5.8", "java-base": "11", "jmx_exporter": "0.16.1"}, - {"product": "3.6.3", "java-base": "11", "jmx_exporter": "0.16.1"}, - {"product": "3.7.0", "java-base": "11", "jmx_exporter": "0.16.1"}, - {"product": "3.8.0", "java-base": "11", "jmx_exporter": "0.16.1"}, - {"product": "3.8.1", "java-base": "11", "jmx_exporter": "0.18.0"}, + {"product": "3.8.1", "java-base": "11", "jmx_exporter": "0.20.0"}, + {"product": "3.8.3", "java-base": "11", "jmx_exporter": "0.20.0"}, ], }, { diff --git a/zookeeper/Dockerfile b/zookeeper/Dockerfile index ea274b4b7..77b212c8e 100644 --- a/zookeeper/Dockerfile +++ b/zookeeper/Dockerfile @@ -18,7 +18,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN microdnf update && \ microdnf install tar gzip zip && \ - microdnf install openssl && \ microdnf clean all COPY --chown=stackable:stackable zookeeper/stackable /stackable @@ -27,13 +26,13 @@ COPY zookeeper/licenses /licenses USER stackable WORKDIR /stackable -RUN curl -L https://repo.stackable.tech/repository/packages/zookeeper/apache-zookeeper-${PRODUCT}-bin.tar.gz | tar -xzC . && \ - ln -s /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/zookeeper +RUN curl --fail -L "https://repo.stackable.tech/repository/packages/zookeeper/apache-zookeeper-${PRODUCT}-bin.tar.gz" | tar -xzC . && \ + ln -s "/stackable/apache-zookeeper-${PRODUCT}-bin" /stackable/zookeeper -RUN curl https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar \ - -o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar && \ - chmod +x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar && \ - ln -s /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar /stackable/jmx/jmx_prometheus_javaagent.jar +RUN curl --fail "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" \ + -o "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" && \ + chmod +x "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" && \ + ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar # === # Mitigation for CVE-2021-44228 (Log4Shell) diff --git a/zookeeper/upload_new_zookeeper_version.sh b/zookeeper/upload_new_zookeeper_version.sh new file mode 100755 index 000000000..ad08f3852 --- /dev/null +++ b/zookeeper/upload_new_zookeeper_version.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +VERSION=${1:?"Missing version number argument (arg 1)"} +NEXUS_USER=${2:?"Missing Nexus username argument (arg 2)"} + +read -r -s -p "Nexus Password: " NEXUS_PASSWORD +echo "" + +# https://stackoverflow.com/questions/4632028/how-to-create-a-temporary-directory +# Find the directory name of the script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# the temp directory used, within $DIR +WORK_DIR=$(mktemp -d -p "$DIR") + +# check if tmp dir was created +if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then + echo "Could not create temp dir" + exit 1 +fi + +# deletes the temp directory +function cleanup { + rm -rf "$WORK_DIR" +} + +# register the cleanup function to be called on the EXIT signal +trap cleanup EXIT + +cd "$WORK_DIR" || exit + +bin_file=apache-zookeeper-$VERSION-bin.tar.gz +download_url=https://archive.apache.org/dist/zookeeper + +echo "Downloading ZooKeeper (this can take a while, it is intentionally downloading from a slow mirror that contains all old versions)" +curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file" +curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file.asc" +curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file.sha512" + +# It is probably redundant to check both the checksum and the signature but it's cheap and why not +echo "Validating SHA512 Checksums" +if ! (sha512sum "$bin_file" | diff -Z - "$bin_file.sha512"); then + echo "ERROR: One of the SHA512 sums does not match" + exit 1 +fi + +echo "Validating signatures" +echo '--> NOTE: Make sure you have downloaded and added the KEYS file (https://archive.apache.org/dist/zookeeper/KEYS) to GPG: https://www.apache.org/info/verification.html' + +if ! (gpg --verify "$bin_file.asc" "$bin_file" 2> /dev/null); then + echo "ERROR: One of the signatures could not be verified" + exit 1 +fi + +echo "Uploading everything to Nexus" +EXIT_STATUS=0 +repo_url=https://repo.stackable.tech/repository/packages/zookeeper/ + +curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file" "$repo_url" || EXIT_STATUS=$? +curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file.asc" "$repo_url" || EXIT_STATUS=$? +curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file.sha512" "$repo_url" || EXIT_STATUS=$? + +if [ $EXIT_STATUS -ne 0 ]; then + echo "ERROR: Upload failed" + exit 1 +fi + +echo "Successfully uploaded version $VERSION of ZooKeeper to Nexus" +echo "https://repo.stackable.tech/service/rest/repository/browse/packages/zookeeper/"