World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[MINOR] fix(license): ship the binary LICENSE and NOTICE in connector images (#13578)
Bharath Krishna393924be59ee
diff --git a/dev/docker/build-docker.sh b/dev/docker/build-docker.shindex 4f85738a10..2df3052371 100755--- a/dev/docker/build-docker.sh+++ b/dev/docker/build-docker.sh@@ -132,8 +132,8 @@ elif [ "${component_type}" == "trino-connectors" ] || \exit 1fiecho "INFO : IMAGE_VERSION=${image_version} (from gradle.properties)"- # Build the connector jars, stage them under packages/, and copy the- # repository-root LICENSE/NOTICE into licenses/ (done by the dependency script).+ # Build the connector jars, stage them under packages/, and stage each+ # artifact's own LICENSE/NOTICE under licenses/ (done by the dependency script).. "${script_dir}/${component_type}/${component_type}-dependency.sh"build_args="--build-arg IMAGE_VERSION=${image_version}"elsediff --git a/dev/docker/flink-connectors/Dockerfile b/dev/docker/flink-connectors/Dockerfileindex d25a430d81..a9a11439ba 100644--- a/dev/docker/flink-connectors/Dockerfile+++ b/dev/docker/flink-connectors/Dockerfile@@ -22,8 +22,7 @@# Contains the Apache Gravitino Flink connector runtime jars for every# supported Flink version present in the source tree (Scala 2.12; Flink does# not support Scala 2.13). The connector code is Apache-2.0; the shaded runtime-# jar bundles third-party open source components (see-# licenses/THIRD_PARTY_LICENSES.txt).+# jar bundles third-party open source components (see the licenses/ directory).# Used as a Kubernetes init-container to inject connector jars into Flink pods.## The set of Flink versions is discovered at build time from the Gravitino@@ -35,7 +34,7 @@# Red Hat UBI / certification-oriented properties:# - Based on UBI 10 (registry.access.redhat.com)# - Required LABELs present-# - /licenses directory with LICENSE, NOTICE and THIRD_PARTY_LICENSES.txt+# - /licenses directory with a LICENSE and NOTICE per runtime variant# - Runs as non-root user (UID 1000, GID 0) with a passwd entry# - OpenShift arbitrary UID compatible (GID 0 group permissions)# ==============================================================================diff --git a/dev/docker/flink-connectors/README.md b/dev/docker/flink-connectors/README.mdindex 7df7dcfa90..68d35d708a 100644--- a/dev/docker/flink-connectors/README.md+++ b/dev/docker/flink-connectors/README.md@@ -40,14 +40,14 @@ Build locally from the repository root with the shared image build script:```The script builds the connector runtime jars (`flink-connectors-dependency.sh`),-stages the repository-root `LICENSE`/`NOTICE` into `licenses/`, injects+stages each runtime jar's `LICENSE`/`NOTICE` into `licenses/`, injects`IMAGE_VERSION` from `gradle.properties`, and runs the multi-arch buildx build.This image contains open source software only. The Apache Gravitino connectorcode is licensed under the Apache License 2.0; the shaded runtime jar also-bundles third-party open source components under their own licenses. See the-`LICENSE`, `NOTICE` and `THIRD_PARTY_LICENSES.txt` files under `/licenses` in-the image.+bundles third-party open source components under their own licenses. Every+bundled component is declared under `/licenses` in the image, in one directory+per runtime variant.## Server compatibility@@ -69,8 +69,8 @@ docker run --rm apache/gravitino-flink-connector:{version}```Each directory contains one shaded runtime JAR. Do not mix JARs from-different Flink minor versions. `LICENSE` and `NOTICE` are in `/licenses` in-the image.+different Flink minor versions. Each JAR's `LICENSE` and `NOTICE` are under+`/licenses/<jar name>` in the image.## Installdiff --git a/dev/docker/flink-connectors/flink-connectors-dependency.sh b/dev/docker/flink-connectors/flink-connectors-dependency.shindex d9025668e3..5085460b87 100755--- a/dev/docker/flink-connectors/flink-connectors-dependency.sh+++ b/dev/docker/flink-connectors/flink-connectors-dependency.sh@@ -98,10 +98,25 @@ if [ "${copied}" -eq 0 ]; thenexit 1fi-# Stage the canonical Apache-2.0 LICENSE and NOTICE from the repository root so-# the image ships the real texts (not drifting copies committed in-tree).-cp "${gravitino_home}/LICENSE" "${conn_dir}/licenses/LICENSE"-cp "${gravitino_home}/NOTICE" "${conn_dir}/licenses/NOTICE"+# /licenses must describe what the shipped jars bundle, not the source tree.+# Each jar already carries that pair in META-INF, generated from its resolved+# dependency set, with the per-component texts it cites alongside them inside the+# jar. Versions bundle different components, so each gets its own directory.+license_jars="$(find "${conn_dir}/packages/connectors" -name '*.jar' | sort)"+[ -n "${license_jars}" ] || { echo "ERROR: no staged jar to take licenses from" >&2; exit 1; }++# Drop earlier staging; leftovers would ship licences for jars not in the image.+mkdir -p "${conn_dir}/licenses"+find "${conn_dir}/licenses" -mindepth 1 -maxdepth 1 ! -name '.gitignore' -exec rm -rf {} +++while IFS= read -r jar; do+ dest="${conn_dir}/licenses/$(basename "${jar}" .jar)"+ mkdir -p "${dest}"+ unzip -p "${jar}" META-INF/LICENSE > "${dest}/LICENSE" \+ || { echo "ERROR: ${jar} has no META-INF/LICENSE" >&2; exit 1; }+ unzip -p "${jar}" META-INF/NOTICE > "${dest}/NOTICE" \+ || { echo "ERROR: ${jar} has no META-INF/NOTICE" >&2; exit 1; }+done <<< "${license_jars}"echo ""echo "=== Flink connectors prepared (${copied} version(s)) ==="diff --git a/dev/docker/flink-connectors/licenses/.gitignore b/dev/docker/flink-connectors/licenses/.gitignoreindex 1ec3b21573..af64f6fa98 100644--- a/dev/docker/flink-connectors/licenses/.gitignore+++ b/dev/docker/flink-connectors/licenses/.gitignore@@ -1,4 +1,5 @@-# LICENSE and NOTICE are copied from the repository root at build time-# by build-docker.sh / the CI workflow. Do not commit generated copies.+# Populated at build time by flink-connectors-dependency.sh from the staged+# runtime jars. Do not commit generated copies.+/*//LICENSE/NOTICEdiff --git a/dev/docker/flink-connectors/licenses/THIRD_PARTY_LICENSES.txt b/dev/docker/flink-connectors/licenses/THIRD_PARTY_LICENSES.txtdeleted file mode 100644index 461bc5f283..0000000000--- a/dev/docker/flink-connectors/licenses/THIRD_PARTY_LICENSES.txt+++ /dev/null@@ -1,20 +0,0 @@-THIRD-PARTY SOFTWARE NOTICE — Apache Gravitino Flink Connector image--This image packages the Apache Gravitino Flink connector as a shaded runtime-jar. The shaded jar bundles third-party open source components, relocated-under the org.apache.gravitino.shaded namespace and redistributed under their-own licenses. They include, among others:-- - Google Guava / Protobuf (com.google.*) ............... Apache-2.0 / BSD-3-Clause- - Apache HttpComponents (org.apache.hc.*) .............. Apache-2.0- - Jackson (com.fasterxml.jackson.*) .................... Apache-2.0- - Caffeine (com.github.benmanes.caffeine) .............. Apache-2.0- - Apache Gravitino Java client ......................... Apache-2.0--The Apache Gravitino connector code itself is licensed under the Apache-License, Version 2.0 (see the LICENSE and NOTICE files in this directory).--This list is a summary for operator convenience and is not exhaustive. The-authoritative license and notice text for every bundled component is carried-inside the jar's META-INF directory. Nothing in this summary modifies the-license terms that apply to any individual component.diff --git a/dev/docker/spark-connectors/Dockerfile b/dev/docker/spark-connectors/Dockerfileindex 9960924952..7c98b04072 100644--- a/dev/docker/spark-connectors/Dockerfile+++ b/dev/docker/spark-connectors/Dockerfile@@ -22,7 +22,7 @@# Contains the Apache Gravitino Spark connector runtime jars for every# supported Spark version and Scala variant present in the source tree. The# connector code is Apache-2.0; the shaded runtime jar bundles third-party open-# source components (see licenses/THIRD_PARTY_LICENSES.txt).+# source components, declared in the licenses/ directory.# Used as a Kubernetes init-container to inject connector jars into Spark pods.## The set of Spark version / Scala combinations is discovered at build time@@ -36,7 +36,7 @@# Red Hat UBI / certification-oriented properties:# - Based on UBI 10 (registry.access.redhat.com)# - Required LABELs present-# - /licenses directory with LICENSE, NOTICE and THIRD_PARTY_LICENSES.txt+# - /licenses directory with a LICENSE and NOTICE per runtime variant# - Runs as non-root user (UID 1000, GID 0) with a passwd entry# - OpenShift arbitrary UID compatible (GID 0 group permissions)# ==============================================================================@@ -72,7 +72,7 @@ COPY packages/connectors /connectors# Entrypoint script for version selectionCOPY --chmod=755 copy-connector.sh /copy-connector.sh-# --- licenses directory (LICENSE + NOTICE + third-party summary) ---+# --- licenses directory (one LICENSE + NOTICE per runtime variant) ---COPY licenses /licenses# --- Connector image usage documentation ---diff --git a/dev/docker/spark-connectors/README.md b/dev/docker/spark-connectors/README.mdindex 78cafc7b61..fa9cbc849f 100644--- a/dev/docker/spark-connectors/README.md+++ b/dev/docker/spark-connectors/README.md@@ -40,14 +40,14 @@ Build locally from the repository root with the shared image build script:```The script builds the connector runtime jars (`spark-connectors-dependency.sh`),-stages the repository-root `LICENSE`/`NOTICE` into `licenses/`, injects+stages each runtime jar's `LICENSE`/`NOTICE` into `licenses/`, injects`IMAGE_VERSION` from `gradle.properties`, and runs the multi-arch buildx build.This image contains open source software only. The Apache Gravitino connectorcode is licensed under the Apache License 2.0; the shaded runtime jar also-bundles third-party open source components under their own licenses. See the-`LICENSE`, `NOTICE` and `THIRD_PARTY_LICENSES.txt` files under `/licenses` in-the image.+bundles third-party open source components under their own licenses. Every+bundled component is declared under `/licenses` in the image, in one directory+per runtime variant.## Server compatibility@@ -69,8 +69,8 @@ it was built from; list them with:docker run --rm apache/gravitino-spark-connector:{version}```-Each directory contains one shaded runtime JAR. `LICENSE` and `NOTICE` are in-`/licenses` in the image.+Each directory contains one shaded runtime JAR. Its `LICENSE` and `NOTICE` are+under `/licenses/<jar name>` in the image.## Installdiff --git a/dev/docker/spark-connectors/licenses/.gitignore b/dev/docker/spark-connectors/licenses/.gitignoreindex 1ec3b21573..a0ef62fc63 100644--- a/dev/docker/spark-connectors/licenses/.gitignore+++ b/dev/docker/spark-connectors/licenses/.gitignore@@ -1,4 +1,5 @@-# LICENSE and NOTICE are copied from the repository root at build time-# by build-docker.sh / the CI workflow. Do not commit generated copies.+# Populated at build time by spark-connectors-dependency.sh from the staged+# runtime jars. Do not commit generated copies.+/*//LICENSE/NOTICEdiff --git a/dev/docker/spark-connectors/licenses/THIRD_PARTY_LICENSES.txt b/dev/docker/spark-connectors/licenses/THIRD_PARTY_LICENSES.txtdeleted file mode 100644index afd2b47fa8..0000000000--- a/dev/docker/spark-connectors/licenses/THIRD_PARTY_LICENSES.txt+++ /dev/null@@ -1,21 +0,0 @@-THIRD-PARTY SOFTWARE NOTICE — Apache Gravitino Spark Connector image--This image packages the Apache Gravitino Spark connector as a shaded runtime-jar. The shaded jar bundles third-party open source components, relocated-under the org.apache.gravitino.shaded namespace and redistributed under their-own licenses. They include, among others:-- - Google Guava / Protobuf (com.google.*) ............... Apache-2.0 / BSD-3-Clause- - Apache HttpComponents (org.apache.hc.*) .............. Apache-2.0- - Jackson (com.fasterxml.jackson.*) .................... Apache-2.0- - Caffeine (com.github.benmanes.caffeine) .............. Apache-2.0- - Apache Kyuubi Spark connector (hive) ................. Apache-2.0- - Apache Gravitino Java client ......................... Apache-2.0--The Apache Gravitino connector code itself is licensed under the Apache-License, Version 2.0 (see the LICENSE and NOTICE files in this directory).--This list is a summary for operator convenience and is not exhaustive. The-authoritative license and notice text for every bundled component is carried-inside the jar's META-INF directory. Nothing in this summary modifies the-license terms that apply to any individual component.diff --git a/dev/docker/spark-connectors/spark-connectors-dependency.sh b/dev/docker/spark-connectors/spark-connectors-dependency.shindex 5021e1e942..7a8639abe5 100755--- a/dev/docker/spark-connectors/spark-connectors-dependency.sh+++ b/dev/docker/spark-connectors/spark-connectors-dependency.sh@@ -177,10 +177,25 @@ if [ "${copied}" -eq 0 ]; thenexit 1fi-# Stage the canonical Apache-2.0 LICENSE and NOTICE from the repository root so-# the image ships the real texts (not drifting copies committed in-tree).-cp "${gravitino_home}/LICENSE" "${conn_dir}/licenses/LICENSE"-cp "${gravitino_home}/NOTICE" "${conn_dir}/licenses/NOTICE"+# /licenses must describe what the shipped jars bundle, not the source tree.+# Each jar already carries that pair in META-INF, generated from its resolved+# dependency set, with the per-component texts it cites alongside them inside the+# jar. Variants bundle different components, so each gets its own directory.+license_jars="$(find "${conn_dir}/packages/connectors" -name '*.jar' | sort)"+[ -n "${license_jars}" ] || { echo "ERROR: no staged jar to take licenses from" >&2; exit 1; }++# Drop earlier staging; leftovers would ship licences for jars not in the image.+mkdir -p "${conn_dir}/licenses"+find "${conn_dir}/licenses" -mindepth 1 -maxdepth 1 ! -name '.gitignore' -exec rm -rf {} +++while IFS= read -r jar; do+ dest="${conn_dir}/licenses/$(basename "${jar}" .jar)"+ mkdir -p "${dest}"+ unzip -p "${jar}" META-INF/LICENSE > "${dest}/LICENSE" \+ || { echo "ERROR: ${jar} has no META-INF/LICENSE" >&2; exit 1; }+ unzip -p "${jar}" META-INF/NOTICE > "${dest}/NOTICE" \+ || { echo "ERROR: ${jar} has no META-INF/NOTICE" >&2; exit 1; }+done <<< "${license_jars}"echo ""echo "=== Spark connectors prepared (${copied} combination(s)) ==="diff --git a/dev/docker/trino-connectors/Dockerfile b/dev/docker/trino-connectors/Dockerfileindex cf241f2bfd..d419caf287 100644--- a/dev/docker/trino-connectors/Dockerfile+++ b/dev/docker/trino-connectors/Dockerfile@@ -23,7 +23,7 @@# Trino/Starburst version range present in the source tree. Each band is a full# Trino plugin directory (connector jar + its dependency jars + LICENSE +# NOTICE + README). The connector code is Apache-2.0; the bundled dependency-# jars are third-party open source (see licenses/THIRD_PARTY_LICENSES.txt).+# jars are third-party open source, declared in the licenses/ directory.# Used as a Kubernetes init-container to inject connector jars into Trino pods.## The set of version ranges is discovered at build time from the Gravitino@@ -35,7 +35,7 @@# Red Hat UBI / certification-oriented properties:# - Based on UBI 10 (registry.access.redhat.com)# - Required LABELs present-# - /licenses directory with LICENSE, NOTICE and THIRD_PARTY_LICENSES.txt+# - /licenses directory with a LICENSE and NOTICE per version band# - Runs as non-root user (UID 1000, GID 0) with a passwd entry# - OpenShift arbitrary UID compatible (GID 0 group permissions)# ==============================================================================@@ -70,7 +70,7 @@ COPY packages/connectors /connectors# Entrypoint script for version selectionCOPY --chmod=755 copy-connector.sh /copy-connector.sh-# --- licenses directory (LICENSE + NOTICE + third-party summary) ---+# --- licenses directory (one LICENSE + NOTICE per version band) ---COPY licenses /licenses# --- Connector image usage documentation ---diff --git a/dev/docker/trino-connectors/README.md b/dev/docker/trino-connectors/README.mdindex 1fcc9afd49..492be47c76 100644--- a/dev/docker/trino-connectors/README.md+++ b/dev/docker/trino-connectors/README.md@@ -41,14 +41,14 @@ Build locally from the repository root with the shared image build script:```The script builds the connector bands (`trino-connectors-dependency.sh`),-stages the repository-root `LICENSE`/`NOTICE` into `licenses/`, injects+stages each plugin band's `LICENSE`/`NOTICE` into `licenses/`, injects`IMAGE_VERSION` from `gradle.properties`, and runs the multi-arch buildx build.This image contains open source software only. The Apache Gravitino connectorcode is licensed under the Apache License 2.0; each plugin band also bundles-third-party open source dependency jars under their own licenses. See the-`LICENSE`, `NOTICE` and `THIRD_PARTY_LICENSES.txt` files under `/licenses` in-the image.+third-party open source dependency jars under their own licenses. Every bundled+component is declared under `/licenses` in the image, in one directory per+version band.## Server compatibilitydiff --git a/dev/docker/trino-connectors/licenses/.gitignore b/dev/docker/trino-connectors/licenses/.gitignoreindex 1ec3b21573..994fcf4827 100644--- a/dev/docker/trino-connectors/licenses/.gitignore+++ b/dev/docker/trino-connectors/licenses/.gitignore@@ -1,4 +1,5 @@-# LICENSE and NOTICE are copied from the repository root at build time-# by build-docker.sh / the CI workflow. Do not commit generated copies.+# Populated at build time by trino-connectors-dependency.sh from the staged+# connector bands. Do not commit generated copies.+/*//LICENSE/NOTICEdiff --git a/dev/docker/trino-connectors/licenses/THIRD_PARTY_LICENSES.txt b/dev/docker/trino-connectors/licenses/THIRD_PARTY_LICENSES.txtdeleted file mode 100644index 3b8cb1f550..0000000000--- a/dev/docker/trino-connectors/licenses/THIRD_PARTY_LICENSES.txt+++ /dev/null@@ -1,24 +0,0 @@-THIRD-PARTY SOFTWARE NOTICE — Apache Gravitino Trino Connector image--This image packages the Apache Gravitino Trino connector plugin. Each Trino-version band under /connectors is a Trino plugin directory that contains the-Gravitino connector jar together with its runtime dependency jars.--Those dependency jars are third-party open source components, redistributed-under their own licenses. They include, among others:-- - Airlift libraries (log, etc.) ......................... Apache-2.0- - Google Guava ......................................... Apache-2.0- - Apache Commons (collections4, lang3, ...) ............ Apache-2.0- - Jackson (com.fasterxml.jackson.*) .................... Apache-2.0- - OpenTelemetry semantic conventions ................... Apache-2.0- - Trino JDBC client (io.trino:trino-jdbc) .............. Apache-2.0--The Apache Gravitino connector jar itself is licensed under the Apache-License, Version 2.0 (see the LICENSE and NOTICE files in this directory and-in each plugin band directory).--This list is a summary for operator convenience and is not exhaustive. The-authoritative license and notice text for every bundled component is carried-inside the respective jar's META-INF directory. Nothing in this summary-modifies the license terms that apply to any individual component.diff --git a/dev/docker/trino-connectors/trino-connectors-dependency.sh b/dev/docker/trino-connectors/trino-connectors-dependency.shindex 3e6f592402..f2f897eca2 100755--- a/dev/docker/trino-connectors/trino-connectors-dependency.sh+++ b/dev/docker/trino-connectors/trino-connectors-dependency.sh@@ -89,10 +89,27 @@ if [ "${copied}" -eq 0 ]; thenexit 1fi-# Stage the canonical Apache-2.0 LICENSE and NOTICE from the repository root so-# the image ships the real texts (not drifting copies committed in-tree).-cp "${gravitino_home}/LICENSE" "${conn_dir}/licenses/LICENSE"-cp "${gravitino_home}/NOTICE" "${conn_dir}/licenses/NOTICE"+# /licenses must describe what the shipped plugin jars bundle, not the source+# tree. Each band already carries that pair, built from LICENSE.trino and+# NOTICE.trino, with the texts it cites in its own licenses/ directory. Bands+# bundle different components, so each gets its own directory.+bands="$(find "${conn_dir}/packages/connectors" -maxdepth 1 -mindepth 1 -type d | sort)"+[ -n "${bands}" ] || { echo "ERROR: no staged connector band to take licenses from" >&2; exit 1; }++# Drop earlier staging; leftovers would ship licences for bands not in the image.+mkdir -p "${conn_dir}/licenses"+find "${conn_dir}/licenses" -mindepth 1 -maxdepth 1 ! -name '.gitignore' -exec rm -rf {} +++while IFS= read -r band; do+ dest="${conn_dir}/licenses/$(basename "${band}")"+ [ -s "${band}/LICENSE" ] && [ -s "${band}/NOTICE" ] || {+ echo "ERROR: ${band} has no LICENSE or NOTICE" >&2+ exit 1+ }+ mkdir -p "${dest}"+ cp "${band}/LICENSE" "${dest}/LICENSE"+ cp "${band}/NOTICE" "${dest}/NOTICE"+done <<< "${bands}"echo ""echo "=== Trino connectors prepared (${copied} version range(s)) ==="