Skip to content

Commit

Permalink
chore(trino): Add 455 (#822)
Browse files Browse the repository at this point in the history
* chore(trino): Add 455

* add changelog

* fix changelog references

* bump trino-cli version & add changelog

* quote name as recommended in SC2215
  • Loading branch information
xeniape authored Sep 5, 2024
1 parent e9d7d1f commit 7756dbb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 49 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ All notable changes to this project will be documented in this file.
- airflow: Add version `2.9.3` ([#809]).
- kafka: Add version `3.8.0` ([#813]).
- hive: Add version `4.0.0` ([#818]).
- trino: Add version `455` ([#822]).
- trino-cli: Add version `455` ([#822]).

### Removed

- opa: Remove version `0.61.0` ([#797]).
- vector: Remove version `0.39.0` ([#802]).
- airflow: Remove versions `2.6.3`, `2.8.1`, `2.8.4` ([#809]).
- kafka: Remove versions `3.4.1`, `3.6.1`, `3.6.2` ([#813]).
- trino: Remove versions `414`, `442` ([#822]).
- trino-cli: Remove version `451` ([#822]).

### Fixed

Expand All @@ -29,6 +33,7 @@ All notable changes to this project will be documented in this file.
[#811]: https://github.com/stackabletech/docker-images/pull/811
[#813]: https://github.com/stackabletech/docker-images/pull/813
[#818]: https://github.com/stackabletech/docker-images/pull/818
[#822]: https://github.com/stackabletech/docker-images/pull/822

## [24.7.0] - 2024-07-24

Expand Down Expand Up @@ -72,6 +77,7 @@ All notable changes to this project will be documented in this file.
- hbase: Remove the symlink `/stackable/jmx/jmx_prometheus_javaagent-0.16.1.jar`
which is unused since SDP 23.11 ([#621]).
- hive: Only build and ship Hive metastore. This reduces the image size from `2.63GB` to `1.9GB` and should also reduce the number of dependencies ([#619], [#622]).
- ubi8-rust-builder: Bump `protoc` from `21.5` to `26.1` ([#624]).
- pass platform argument to preflight check ([#626]).
- nifi: provision stackable-bcrypt from Maven ([#663])
- nifi: move /bin/stackable-bcrypt to /stackable/stackable-bcrypt and added softlink for backwards compatibility ([#678]).
Expand Down Expand Up @@ -363,7 +369,6 @@ All notable changes to this project will be documented in this file.
[#419]: https://github.com/stackabletech/docker-images/pull/419
[#425]: https://github.com/stackabletech/docker-images/pull/425
[#429]: https://github.com/stackabletech/docker-images/pull/429
[#429]: https://github.com/stackabletech/docker-images/pull/429
[#431]: https://github.com/stackabletech/docker-images/pull/431
[#433]: https://github.com/stackabletech/docker-images/pull/433
[#434]: https://github.com/stackabletech/docker-images/pull/434
Expand Down
2 changes: 1 addition & 1 deletion trino-cli/versions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
versions = [
{
"product": "451",
"product": "455",
"java-base": "22",
},
]
36 changes: 5 additions & 31 deletions trino/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,22 @@ ARG STORAGE_CONNECTOR
WORKDIR /stackable

RUN curl --fail -L "https://repo.stackable.tech/repository/packages/trino-storage/trino-storage-${STORAGE_CONNECTOR}-src.tar.gz" | tar -xzC .
RUN --mount=type=cache,target=/root/.m2/repository cd trino-storage-${STORAGE_CONNECTOR}-src && \
RUN "--mount=type=cache,target=/root/.m2/repository" cd trino-storage-${STORAGE_CONNECTOR}-src && \
# Upstream builds are marked as -SNAPSHOT, even for release builds
mvn versions:set -DnewVersion=${STORAGE_CONNECTOR} && \
mvn package -DskipTests -Dmaven.gitcommitid.skip=true

# # TODO: remove the OPA authorizer builder once Trino versions 414 and 428 are removed
FROM stackable/image/java-devel AS opa-authorizer-builder

ARG PRODUCT
ARG OPA_AUTHORIZER

WORKDIR /stackable

RUN if [ -n "${OPA_AUTHORIZER}" ]; then \
curl --fail -L "https://repo.stackable.tech/repository/packages/trino-opa-authorizer/trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}-src.tar.gz" | tar -xzC .; \
fi
RUN --mount=type=cache,target=/root/.m2/repository if [ -n "${OPA_AUTHORIZER}" ]; then \
cd trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}-src && \
mvn package -DskipTests; \
fi

# Create an empty dummy plugin folder for newer versions that don't need the plugin anymore
RUN mkdir -p trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}-src/target/out
# We need to use ./mvnw instead of mvn to get a recent maven version (which is required to build Trino)
./mvnw package -DskipTests -Dmaven.gitcommitid.skip=true

FROM stackable/image/java-devel AS builder

ARG PRODUCT
# External OPA authorizer only required for 414 and 428, included in 438
# The `OPA_AUTHORIZER` is not set in the conf.py for version 438 to remove the ARG as soon as 414 and 428 are removed
ARG OPA_AUTHORIZER
ARG STORAGE_CONNECTOR

WORKDIR /stackable

RUN curl --fail -L "https://repo.stackable.tech/repository/packages/trino-server/trino-server-${PRODUCT}-src.tar.gz" | tar -xzC .

RUN --mount=type=cache,target=/root/.m2/repository cd "trino-server-${PRODUCT}-src" && \
RUN "--mount=type=cache,target=/root/.m2/repository" cd "trino-server-${PRODUCT}-src" && \
# We need to use ./mvnw instead of mvn to get a recent maven version (which is required to build Trino)
./mvnw package -DskipTests -Dmaven.gitcommitid.skip=true --projects="!docs,!core/trino-server-rpm" && \
# Delete the worst intermediate build products to free some space
Expand All @@ -56,11 +35,6 @@ RUN --mount=type=cache,target=/root/.m2/repository cd "trino-server-${PRODUCT}-s
rm -r /stackable/trino-server-${PRODUCT}-src

COPY --from=storage-connector-builder /stackable/trino-storage-${STORAGE_CONNECTOR}-src/target/trino-storage-${STORAGE_CONNECTOR} /stackable/trino-server-${PRODUCT}/plugin/trino-storage-${STORAGE_CONNECTOR}
# # TODO: remove the following COPY statement once Trino versions 414 and 428 are removed
COPY --from=opa-authorizer-builder /stackable/trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}-src/target/out /stackable/trino-server-${PRODUCT}/plugin/trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}
# We have no way to copy a folder conditionally, so delete the opa authorizer folder if no version is selected
# Otherwise Trino will crash since empty plugin folders are not allowed
RUN [ -n "${OPA_AUTHORIZER}" ] || rmdir /stackable/trino-server-${PRODUCT}/plugin/trino-opa-authorizer-${PRODUCT}-${OPA_AUTHORIZER}

# For earlier versions this script removes the .class file that contains the
# vulnerable code.
Expand All @@ -86,7 +60,7 @@ ARG JMX_EXPORTER
WORKDIR /stackable

RUN curl --fail -L "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus-${JMX_EXPORTER}-src.tar.gz" | tar -xzC .
RUN --mount=type=cache,target=/root/.m2/repository cd jmx_prometheus-${JMX_EXPORTER}-src && \
RUN "--mount=type=cache,target=/root/.m2/repository" cd jmx_prometheus-${JMX_EXPORTER}-src && \
mvn package

FROM stackable/image/java-base
Expand Down
22 changes: 6 additions & 16 deletions trino/versions.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
versions = [
{
"product": "414",
"java-base": "17",
"java-devel": "17",
"opa_authorizer": "stackable0.2.0",
"jmx_exporter": "1.0.1",
"storage_connector": "413",
},
{
"product": "442",
"java-base": "21",
"java-devel": "21",
"product": "451",
"java-base": "22",
"java-devel": "22",
"jmx_exporter": "1.0.1",
"storage_connector": "442",
"opa_authorizer": "",
"storage_connector": "451",
},
{
"product": "451",
"product": "455",
"java-base": "22",
"java-devel": "22",
"jmx_exporter": "1.0.1",
"storage_connector": "451",
"opa_authorizer": "",
"storage_connector": "455",
},
]

0 comments on commit 7756dbb

Please sign in to comment.