From 171bf30d382ce20d26f33ae6a0f0d97454efdf91 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 8 Feb 2024 10:05:05 +0100 Subject: [PATCH 1/2] Use mirrored inotify-tools --- CHANGELOG.md | 4 +- conf.py | 23 +++++------ upload_new_inotify-tools_version.sh | 61 +++++++++++++++++++++++++++++ vector/Dockerfile | 11 +++--- 4 files changed, 82 insertions(+), 17 deletions(-) create mode 100755 upload_new_inotify-tools_version.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index bb733d440..1f82c796a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ All notable changes to this project will be documented in this file. - java-base: Add JDK 21 ([#547]). - opa: Add version `0.61.0` ([#538]). - trino: Add version `438` ([#547]). -- vector: Switch from version `0.33.0` to `0.35.0` ([#547]). +- vector: Switch from version `0.33.0` to `0.35.0` ([#547], [#549]). ### Changed @@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file. - GH workflows: make preflight an independent manual workflow and update to version 1.7.2 ([#519]). - hadoop: Build from source ([#526]). - superset: Add patch that fixes saved queries export ([#539]). +- inotify-tools: Download from Nexus instead of using the EPEL 8 repository ([#549]). ### Removed @@ -56,6 +57,7 @@ All notable changes to this project will be documented in this file. [#542]: https://github.com/stackabletech/docker-images/pull/542 [#544]: https://github.com/stackabletech/docker-images/pull/544 [#547]: https://github.com/stackabletech/docker-images/pull/547 +[#549]: https://github.com/stackabletech/docker-images/pull/549 ## [23.11.0] - 2023-11-30 diff --git a/conf.py b/conf.py index fdf0fa41f..9580f5076 100644 --- a/conf.py +++ b/conf.py @@ -14,7 +14,7 @@ "python": "39", "statsd_exporter": "v0.24.0", "tini": "0.19.0", - "vector": "0.33.0", + "vector": "0.35.0", }, { "product": "2.6.3", @@ -22,7 +22,7 @@ "python": "39", "statsd_exporter": "v0.24.0", "tini": "0.19.0", - "vector": "0.33.0", + "vector": "0.35.0", }, { "product": "2.7.2", @@ -30,7 +30,7 @@ "python": "39", "statsd_exporter": "v0.24.0", "tini": "0.19.0", - "vector": "0.33.0", + "vector": "0.35.0", }, ], }, @@ -209,7 +209,8 @@ { "product": "0.35.0", "rpm_release": "1", - "stackable-base": "1.0.0" + "stackable-base": "1.0.0", + "inotify_tools": "3.14-19.el8", } ], }, @@ -261,7 +262,7 @@ "jackson_dataformat_xml": "2.14.2", "stax2_api": "4.2.1", "woodstox_core": "6.5.0", - "vector": "0.33.0", + "vector": "0.35.0", "jmx_exporter": "0.20.0", }, # required for a customer @@ -278,7 +279,7 @@ "jackson_dataformat_xml": "2.14.2", # https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.13/3.4.0 "stax2_api": "4.2.1", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.14.2 "woodstox_core": "6.5.0", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.14.2 - "vector": "0.33.0", + "vector": "0.35.0", "jmx_exporter": "0.20.0", }, { @@ -294,7 +295,7 @@ "jackson_dataformat_xml": "2.14.2", # https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.13/3.4.0 "stax2_api": "4.2.1", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.14.2 "woodstox_core": "6.5.0", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.14.2 - "vector": "0.33.0", + "vector": "0.35.0", "jmx_exporter": "0.20.0", }, { @@ -310,7 +311,7 @@ "jackson_dataformat_xml": "2.15.2", # https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.13/3.5.0 "stax2_api": "4.2.1", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.15.2 "woodstox_core": "6.5.1", # https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.15.2 - "vector": "0.33.0", + "vector": "0.35.0", "jmx_exporter": "0.20.0", }, ], @@ -325,21 +326,21 @@ { "product": "2.1.0", "python": "3.9", - "vector": "0.33.0", + "vector": "0.35.0", "statsd_exporter": "v0.24.0", "authlib": "0.15.4" # https://github.com/dpgaspar/Flask-AppBuilder/blob/v4.3.0/requirements-extra.txt#L10 }, { "product": "2.1.1", "python": "3.9", - "vector": "0.33.0", + "vector": "0.35.0", "statsd_exporter": "v0.24.0", "authlib": "0.15.4" # https://github.com/dpgaspar/Flask-AppBuilder/blob/v4.3.0/requirements-extra.txt#L10 }, { "product": "3.0.1", "python": "3.9", - "vector": "0.33.0", + "vector": "0.35.0", "statsd_exporter": "v0.24.0", "authlib": "0.15.4" # https://github.com/dpgaspar/Flask-AppBuilder/blob/v4.3.6/requirements-extra.txt#L7 }, diff --git a/upload_new_inotify-tools_version.sh b/upload_new_inotify-tools_version.sh new file mode 100755 index 000000000..e2ffc11c4 --- /dev/null +++ b/upload_new_inotify-tools_version.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +set -e + +VERSION=${1:?"Missing version number argument (arg 1)"} +NEXUS_USER=${2:?"Missing Nexus username argument (arg 2)"} + +ARCHITECTURES=( + x86_64 + aarch64 +) + +if [[ $VERSION =~ ^(.+)-(.+)\.el(.+)$ ]]; then + INOTIFY_TOOLS_VERSION=${BASH_REMATCH[1]} + PACKAGE_VERSION=${BASH_REMATCH[2]} + EPEL_VERSION=${BASH_REMATCH[3]} +else + echo 'VERSION must match the pattern "-.el", e.g. "3.14-19.el8".' + exit 1 +fi + +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 + +for arch in "${ARCHITECTURES[@]}"; do + file=inotify-tools-$VERSION.$arch.rpm + + echo "Downloading $file from dl.fedoraproject.org" + curl --fail -LOs "https://dl.fedoraproject.org/pub/epel/$EPEL_VERSION/Everything/$arch/Packages/i/$file" + + echo "Uploading $file to Nexus" + curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" \ + --upload-file "$file" \ + 'https://repo.stackable.tech/repository/packages/inotify-tools/' +done + +echo "Successfully uploaded new version $VERSION to Nexus" +echo "https://repo.stackable.tech/service/rest/repository/browse/packages/inotify-tools/" diff --git a/vector/Dockerfile b/vector/Dockerfile index 3358a12f8..59d7b4753 100644 --- a/vector/Dockerfile +++ b/vector/Dockerfile @@ -4,6 +4,8 @@ FROM stackable/image/stackable-base ARG PRODUCT ARG RPM_RELEASE +ARG INOTIFY_TOOLS +ARG TARGETARCH # https://github.com/hadolint/hadolint/wiki/DL4006 SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -13,11 +15,10 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] # This happens by writing a "shutdown file" in a shared volume # See https://github.com/stackabletech/airflow-operator/blob/23.4.1/rust/operator-binary/src/airflow_db_controller.rs#L269 for an example # The Vector container waits for this file to appear and this waiting happens using `inotifywait` which comes from the `inotify-tools` package -RUN rpm --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ - microdnf update && \ - microdnf --assumeyes install inotify-tools && \ - microdnf clean all && \ - rpm --install "https://repo.stackable.tech/repository/packages/vector/vector-${PRODUCT}-${RPM_RELEASE}.$(arch).rpm" && \ +RUN ARCH="${TARGETARCH/amd64/x86_64}" ARCH="${ARCH/arm64/aarch64}" && \ + rpm --install \ + "https://repo.stackable.tech/repository/packages/vector/vector-${PRODUCT}-${RPM_RELEASE}.${ARCH}.rpm" \ + "https://repo.stackable.tech/repository/packages/inotify-tools/inotify-tools-${INOTIFY_TOOLS}.${ARCH}.rpm" && \ mkdir /licenses && \ cp /usr/share/licenses/vector-${PRODUCT}/LICENSE /licenses/VECTOR_LICENSE && \ # Create the directory /stackable/vector/var. From 3f17c6f3589b4fcf131da369b44d39a8624ee0da Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 8 Feb 2024 10:12:31 +0100 Subject: [PATCH 2/2] Fix linter warnings --- upload_new_inotify-tools_version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload_new_inotify-tools_version.sh b/upload_new_inotify-tools_version.sh index e2ffc11c4..b17819f8b 100755 --- a/upload_new_inotify-tools_version.sh +++ b/upload_new_inotify-tools_version.sh @@ -11,8 +11,8 @@ ARCHITECTURES=( ) if [[ $VERSION =~ ^(.+)-(.+)\.el(.+)$ ]]; then - INOTIFY_TOOLS_VERSION=${BASH_REMATCH[1]} - PACKAGE_VERSION=${BASH_REMATCH[2]} + # INOTIFY_TOOLS_VERSION=${BASH_REMATCH[1]} + # PACKAGE_VERSION=${BASH_REMATCH[2]} EPEL_VERSION=${BASH_REMATCH[3]} else echo 'VERSION must match the pattern "-.el", e.g. "3.14-19.el8".'