From 7f7f29b9ac27d45485c07ba09e434ee74867b401 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 7 Feb 2025 10:38:34 +0100 Subject: [PATCH 1/5] fix(trino): Restore trino-storage patches --- .../451/001-cyclonedx-plugin.patch | 28 +++++++++++++++++++ .../455/001-cyclonedx-plugin.patch | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch create mode 100644 trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch diff --git a/trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch b/trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch new file mode 100644 index 000000000..390ae15b1 --- /dev/null +++ b/trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch @@ -0,0 +1,28 @@ +diff --git a/pom.xml b/pom.xml +index 7304dac..5ba854d 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -544,6 +544,23 @@ + + + ++ ++ org.cyclonedx ++ cyclonedx-maven-plugin ++ 2.8.0 ++ ++ application ++ 1.5 ++ ++ ++ ++ ++ makeBom ++ ++ package ++ ++ ++ + + + diff --git a/trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch b/trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch new file mode 100644 index 000000000..387997d5d --- /dev/null +++ b/trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch @@ -0,0 +1,28 @@ +diff --git a/pom.xml b/pom.xml +index 6471642..fc0f376 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -555,6 +555,23 @@ + + + ++ ++ org.cyclonedx ++ cyclonedx-maven-plugin ++ 2.8.0 ++ ++ application ++ 1.5 ++ ++ ++ ++ ++ makeBom ++ ++ package ++ ++ ++ + + + From 2bd4a5214bc7baf7a287b6a61ac8ca90c75b9ed0 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 7 Feb 2025 12:27:48 +0100 Subject: [PATCH 2/5] chore(trino): Split trino-storage-connector into separate build for easier patching with patchable --- conf.py | 4 +- trino-storage-connector/Dockerfile | 37 ++++ .../licenses/SNOWLIFT_TRINO_STORAGE_LICENSE | 201 ++++++++++++++++++ .../licenses/STACKABLE_LICENSE | 43 ++++ .../patches}/451/001-cyclonedx-plugin.patch | 0 .../patches}/455/001-cyclonedx-plugin.patch | 0 .../stackable/patches/apply_patches.sh | 44 ++++ .../upload_new_trino_storage_version.sh | 0 trino-storage-connector/versions.py | 14 ++ trino/Dockerfile | 39 +--- trino/versions.py | 6 +- 11 files changed, 347 insertions(+), 41 deletions(-) create mode 100644 trino-storage-connector/Dockerfile create mode 100644 trino-storage-connector/licenses/SNOWLIFT_TRINO_STORAGE_LICENSE create mode 100644 trino-storage-connector/licenses/STACKABLE_LICENSE rename {trino/stackable/patches/trino-storage => trino-storage-connector/stackable/patches}/451/001-cyclonedx-plugin.patch (100%) rename {trino/stackable/patches/trino-storage => trino-storage-connector/stackable/patches}/455/001-cyclonedx-plugin.patch (100%) create mode 100755 trino-storage-connector/stackable/patches/apply_patches.sh rename {trino => trino-storage-connector}/upload_new_trino_storage_version.sh (100%) create mode 100644 trino-storage-connector/versions.py diff --git a/conf.py b/conf.py index 23c5e54ce..e863dd145 100644 --- a/conf.py +++ b/conf.py @@ -29,6 +29,7 @@ superset = importlib.import_module("superset.versions") trino_cli = importlib.import_module("trino-cli.versions") trino = importlib.import_module("trino.versions") +trino_storage_connector = importlib.import_module("trino-storage-connector.versions") kafka_testing_tools = importlib.import_module("kafka-testing-tools.versions") kcat = importlib.import_module("kcat.versions") testing_tools = importlib.import_module("testing-tools.versions") @@ -56,6 +57,7 @@ {"name": "superset", "versions": superset.versions}, {"name": "trino-cli", "versions": trino_cli.versions}, {"name": "trino", "versions": trino.versions}, + {"name": "trino-storage-connector", "versions": trino_storage_connector.versions}, {"name": "kafka-testing-tools", "versions": kafka_testing_tools.versions}, {"name": "kcat", "versions": kcat.versions}, {"name": "testing-tools", "versions": testing_tools.versions}, @@ -94,5 +96,5 @@ "STACKABLE_USER_NAME": "stackable", "STACKABLE_USER_UID": "1000", "STACKABLE_USER_GID": "1000", - "DELETE_CACHES": "true" + "DELETE_CACHES": "true", } diff --git a/trino-storage-connector/Dockerfile b/trino-storage-connector/Dockerfile new file mode 100644 index 000000000..5b92551b6 --- /dev/null +++ b/trino-storage-connector/Dockerfile @@ -0,0 +1,37 @@ +# syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 +# check=error=true + +FROM stackable/image/java-devel AS storage-connector-builder + +ARG PRODUCT +ARG STACKABLE_USER_UID + +RUN <" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch b/trino-storage-connector/stackable/patches/451/001-cyclonedx-plugin.patch similarity index 100% rename from trino/stackable/patches/trino-storage/451/001-cyclonedx-plugin.patch rename to trino-storage-connector/stackable/patches/451/001-cyclonedx-plugin.patch diff --git a/trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch b/trino-storage-connector/stackable/patches/455/001-cyclonedx-plugin.patch similarity index 100% rename from trino/stackable/patches/trino-storage/455/001-cyclonedx-plugin.patch rename to trino-storage-connector/stackable/patches/455/001-cyclonedx-plugin.patch diff --git a/trino-storage-connector/stackable/patches/apply_patches.sh b/trino-storage-connector/stackable/patches/apply_patches.sh new file mode 100755 index 000000000..833b3e9c7 --- /dev/null +++ b/trino-storage-connector/stackable/patches/apply_patches.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Enable error handling and unset variable checking +set -eu +set -o pipefail + +# Check if $1 (VERSION) is provided +if [ -z "${1-}" ]; then + echo "Please provide a value for VERSION as the first argument." + exit 1 +fi + +VERSION="$1" +PATCH_DIR="patches/$VERSION" + +# Check if version-specific patches directory exists +if [ ! -d "$PATCH_DIR" ]; then + echo "Patches directory '$PATCH_DIR' does not exist." + exit 1 +fi + +# Create an array to hold the patches in sorted order +declare -a patch_files=() + +echo "Applying patches from ${PATCH_DIR}" now + +# Read the patch files into the array +while IFS= read -r -d $'\0' file; do + patch_files+=("$file") +done < <(find "$PATCH_DIR" -name "*.patch" -print0 | sort -zV) + +echo "Found ${#patch_files[@]} patches, applying now" + +# Iterate through sorted patch files +for patch_file in "${patch_files[@]}"; do + echo "Applying $patch_file" + # We can not use Git here, as we are not within a Git repo + patch --directory "." --strip=1 < "$patch_file" || { + echo "Failed to apply $patch_file" + exit 1 + } +done + +echo "All patches applied successfully." diff --git a/trino/upload_new_trino_storage_version.sh b/trino-storage-connector/upload_new_trino_storage_version.sh similarity index 100% rename from trino/upload_new_trino_storage_version.sh rename to trino-storage-connector/upload_new_trino_storage_version.sh diff --git a/trino-storage-connector/versions.py b/trino-storage-connector/versions.py new file mode 100644 index 000000000..ceb6b0b4a --- /dev/null +++ b/trino-storage-connector/versions.py @@ -0,0 +1,14 @@ +versions = [ + { + "product": "451", + "java-devel": "22", + }, + { + "product": "455", + "java-devel": "22", + }, + { + "product": "469", + "java-devel": "23", + }, +] diff --git a/trino/Dockerfile b/trino/Dockerfile index 68383bdbd..eb15b1469 100644 --- a/trino/Dockerfile +++ b/trino/Dockerfile @@ -1,45 +1,11 @@ # syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 # check=error=true -FROM stackable/image/java-devel AS storage-connector-builder - -ARG STORAGE_CONNECTOR -ARG STACKABLE_USER_UID - -RUN < Date: Fri, 7 Feb 2025 12:34:35 +0100 Subject: [PATCH 3/5] chore(trino-storage-connector): Patch 469 --- .../469/0001-Add-cyclonedx-plugin.patch | 42 +++++++++++++++++++ .../stackable/patches/469/patchable.toml | 2 + 2 files changed, 44 insertions(+) create mode 100644 trino-storage-connector/stackable/patches/469/0001-Add-cyclonedx-plugin.patch create mode 100644 trino-storage-connector/stackable/patches/469/patchable.toml diff --git a/trino-storage-connector/stackable/patches/469/0001-Add-cyclonedx-plugin.patch b/trino-storage-connector/stackable/patches/469/0001-Add-cyclonedx-plugin.patch new file mode 100644 index 000000000..1d3f74215 --- /dev/null +++ b/trino-storage-connector/stackable/patches/469/0001-Add-cyclonedx-plugin.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nick Larsen +Date: Fri, 7 Feb 2025 12:32:20 +0100 +Subject: Add cyclonedx plugin + +--- + pom.xml | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/pom.xml b/pom.xml +index 2176aba..91e9197 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -545,6 +545,23 @@ + + + ++ ++ org.cyclonedx ++ cyclonedx-maven-plugin ++ 2.9.1 ++ ++ application ++ 1.6 ++ ++ ++ ++ ++ makeBom ++ ++ package ++ ++ ++ + + + + +base-commit: e2612ce1e2801211dc090bab32f28107b563a2ae +-- +2.40.1 + diff --git a/trino-storage-connector/stackable/patches/469/patchable.toml b/trino-storage-connector/stackable/patches/469/patchable.toml new file mode 100644 index 000000000..674e38e6d --- /dev/null +++ b/trino-storage-connector/stackable/patches/469/patchable.toml @@ -0,0 +1,2 @@ +upstream = "https://github.com/snowlift/trino-storage" +base = "e2612ce1e2801211dc090bab32f28107b563a2ae" From 35a751bbd096160b03afa7b495a64d929ead3932 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 7 Feb 2025 12:40:41 +0100 Subject: [PATCH 4/5] chore: Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a26f533db..51350bcf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,11 +21,13 @@ All notable changes to this project will be documented in this file. - java: Add JDK/JRE 23 ([#992]). - trino: Add 469 ([#993]). - trino-cli: Add version 469 ([#993]). +- trino-storage-connector: Add version 469 ([#996]). ### Changed - kafka: Bump 3.8.0 to 3.8.1 ([#995]). - Update registry references to oci ([#989]). +- trino-storage-connector: Move the build out of trino/ for easier patching ([#996]). ### Removed @@ -56,6 +58,7 @@ All notable changes to this project will be documented in this file. [#992]: https://github.com/stackabletech/docker-images/pull/992 [#993]: https://github.com/stackabletech/docker-images/pull/993 [#995]: https://github.com/stackabletech/docker-images/pull/995 +[#996]: https://github.com/stackabletech/docker-images/pull/996 ## [24.11.1] - 2025-01-14 From f1c56f21380fc36ed6abf91c48f840635210f083 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Mon, 10 Feb 2025 11:45:03 +0100 Subject: [PATCH 5/5] chore(trino-storage-connector): Rename upload script --- ...e_version.sh => upload_new_trino_storage_connector_version.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename trino-storage-connector/{upload_new_trino_storage_version.sh => upload_new_trino_storage_connector_version.sh} (100%) diff --git a/trino-storage-connector/upload_new_trino_storage_version.sh b/trino-storage-connector/upload_new_trino_storage_connector_version.sh similarity index 100% rename from trino-storage-connector/upload_new_trino_storage_version.sh rename to trino-storage-connector/upload_new_trino_storage_connector_version.sh