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 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-storage-connector/stackable/patches/451/001-cyclonedx-plugin.patch b/trino-storage-connector/stackable/patches/451/001-cyclonedx-plugin.patch new file mode 100644 index 000000000..390ae15b1 --- /dev/null +++ b/trino-storage-connector/stackable/patches/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-storage-connector/stackable/patches/455/001-cyclonedx-plugin.patch b/trino-storage-connector/stackable/patches/455/001-cyclonedx-plugin.patch new file mode 100644 index 000000000..387997d5d --- /dev/null +++ b/trino-storage-connector/stackable/patches/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 ++ ++ ++ + + + 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" 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_connector_version.sh similarity index 100% rename from trino/upload_new_trino_storage_version.sh rename to trino-storage-connector/upload_new_trino_storage_connector_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 <