Skip to content

Commit 9fad083

Browse files
committed
Merge branch 'feature/source/trino' of github.com:stackabletech/docker-images into feature/source/trino
2 parents 146e3bc + ce2baa3 commit 9fad083

29 files changed

+746
-211
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ All notable changes to this project will be documented in this file.
1414
image to the HBase image. The script `export-snapshot-to-s3` makes
1515
exporting easier ([#621]).
1616
- kafka: Build from source ([#659], [#661]).
17+
- kafka: Add jmx broker config to builder image ([#703]).
18+
- nifi: Build from source ([#678]).
1719
- omid: Include Apache Omid in all workflows such as building and releasing images ([#635]).
1820
- java-devel: New image to serve as base layer for builder stages ([#665]).
1921
- hdfs: Exclude YARN and Mapreduce projects from build ([#667]).
2022
- stackable-base: Mitigate CVE-2023-37920 by removing e-Tugra root certificates ([#673]).
23+
- hdfs: Exclude unused jars and mitigate snappy-java CVEs by bumping dependency ([#682]).
24+
- druid: Build from source ([#684], [#696]).
25+
- opa: Add log processing script to opa for decision logging ([#695], [#704]).
2126

2227
### Changed
2328

@@ -28,6 +33,8 @@ All notable changes to this project will be documented in this file.
2833
- ubi8-rust-builder: Bump `protoc` from `21.5` to `26.1` ([#624]).
2934
- pass platform argument to preflight check ([#626]).
3035
- nifi: provision stackable-bcrypt from Maven ([#663])
36+
- nifi: move /bin/stackable-bcrypt to /stackable/stackable-bcrypt and added softlink for backwards compatibility ([#678]).
37+
- nifi: patch nifi-assembly pom file to not zip binaries after the build to save disk space ([#685]).
3138
- hadoop: use java-devel as base layer for the builder stage ([#665])
3239
- hive: use java-devel as base layer for the builder stage ([#665])
3340
- zookeeper: use java-devel as base layer for the builder stage ([#665])
@@ -37,6 +44,7 @@ All notable changes to this project will be documented in this file.
3744
- opa-bundle-builder: Bump image to 1.1.2 ([#666])
3845
- opa: Build from source ([#676])
3946
- trino: Build from source ([#687]).
47+
- spark: Build from source ([#679])
4048

4149
### Fixed
4250

@@ -47,6 +55,7 @@ All notable changes to this project will be documented in this file.
4755
- hive: Fix compilation on ARM by back-porting [HIVE-21939](https://issues.apache.org/jira/browse/HIVE-21939) from [this](https://github.com/apache/hive/commit/2baf21bb55fcf33d8522444c78a8d8cab60e7415) commit ([#617]).
4856
- hive: Fix compilation on ARM in CI as well ([#619]).
4957
- hive: Fix compilation of x86 in CI due to lower disk usage to prevent disk running full ([#619]).
58+
- hive: Provide logging dependency previously bundled with the hadoop yarn client ([#688]).
5059

5160
### Removed
5261

@@ -74,9 +83,19 @@ All notable changes to this project will be documented in this file.
7483
[#665]: https://github.com/stackabletech/docker-images/pull/665
7584
[#666]: https://github.com/stackabletech/docker-images/pull/666
7685
[#667]: https://github.com/stackabletech/docker-images/pull/667
77-
[#676]: https://github.com/stackabletech/docker-images/pull/676
7886
[#673]: https://github.com/stackabletech/docker-images/pull/673
87+
[#676]: https://github.com/stackabletech/docker-images/pull/676
88+
[#678]: https://github.com/stackabletech/docker-images/pull/678
89+
[#679]: https://github.com/stackabletech/docker-images/pull/679
90+
[#682]: https://github.com/stackabletech/docker-images/pull/682
91+
[#684]: https://github.com/stackabletech/docker-images/pull/684
92+
[#685]: https://github.com/stackabletech/docker-images/pull/685
7993
[#687]: https://github.com/stackabletech/docker-images/pull/687
94+
[#688]: https://github.com/stackabletech/docker-images/pull/688
95+
[#696]: https://github.com/stackabletech/docker-images/pull/696
96+
[#695]: https://github.com/stackabletech/docker-images/pull/695
97+
[#703]: https://github.com/stackabletech/docker-images/pull/703
98+
[#704]: https://github.com/stackabletech/docker-images/pull/704
8099

81100
## [24.3.0] - 2024-03-20
82101

airflow/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RUN microdnf update && \
4141
python${PYTHON}-devel \
4242
python${PYTHON}-pip \
4343
python${PYTHON}-wheel \
44-
# the unixODBC-devel package is not available for ubi9
44+
# The airflow odbc provider can compile without the development files (headers and libraries) (see https://github.com/stackabletech/docker-images/pull/683)
4545
unixODBC && \
4646
microdnf clean all && \
4747
rm -rf /var/cache/yum

conf.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
{
5757
"product": "26.0.0",
5858
"java-base": "11",
59+
"java-devel": "11",
5960
"jackson_dataformat_xml": "2.10.5",
6061
"stax2_api": "4.2.1",
6162
"woodstox_core": "6.2.1",
@@ -64,6 +65,7 @@
6465
{
6566
"product": "27.0.0",
6667
"java-base": "11",
68+
"java-devel": "11",
6769
"jackson_dataformat_xml": "2.10.5",
6870
"stax2_api": "4.2.1",
6971
"woodstox_core": "6.2.1",
@@ -76,6 +78,7 @@
7678
# Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class
7779
# java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError
7880
"java-base": "11",
81+
"java-devel": "11",
7982
"jackson_dataformat_xml": "2.12.7", # from https://github.com/apache/druid/blob/b8201e31aa6b124049a61764309145baaad78db7/pom.xml#L100
8083
"stax2_api": "4.2.2",
8184
"woodstox_core": "6.6.0",
@@ -120,7 +123,7 @@
120123
"java-base": "11",
121124
"java-devel": "11",
122125
"async_profiler": "2.9",
123-
"phoenix": "5.1.3",
126+
"phoenix": "5.2.0",
124127
"hbase_profile": "2.4",
125128
"hadoop": "3.3.6",
126129
"jmx_exporter": "0.20.0",
@@ -147,6 +150,8 @@
147150
"java-devel": "1.8.0",
148151
"hadoop": "3.3.4",
149152
"jackson_dataformat_xml": "2.12.3",
153+
# No longer bundled with the hadoop-yarn/mapreduce libraries (2.12.7 corresponds to the hadoop build for 3.3.4).
154+
"jackson_jaxb_annotations": "2.12.7",
150155
# Normally Hive 3.1.3 ships with "postgresql-9.4.1208.jre7.jar", but as this is old enough it does only support
151156
# MD5 based authentication. Because of this, it does not work against more recent PostgresQL versions.
152157
# See https://github.com/stackabletech/hive-operator/issues/170 for details.
@@ -249,9 +254,21 @@
249254
{
250255
"name": "nifi",
251256
"versions": [
252-
{"product": "1.21.0", "java-base": "11"},
253-
{"product": "1.23.2", "java-base": "11"},
254-
{"product": "1.25.0", "java-base": "21"},
257+
{
258+
"product": "1.21.0",
259+
"java-base": "11",
260+
"java-devel": "11"
261+
},
262+
{
263+
"product": "1.23.2",
264+
"java-base": "11",
265+
"java-devel": "11"
266+
},
267+
{
268+
"product": "1.25.0",
269+
"java-base": "21",
270+
"java-devel": "11"
271+
},
255272
],
256273
},
257274
{
@@ -287,10 +304,9 @@
287304
"versions": [
288305
{
289306
"product": "3.4.1",
290-
"spark": "3.4.1",
291307
"java-base": "11",
308+
"java-devel": "11",
292309
"python": "3.11",
293-
"hadoop_short_version": "3",
294310
"hadoop_long_version": "3.3.4", # https://github.com/apache/spark/blob/1db2f5c36b120c213432fc658c9fd24fc73cb45e/pom.xml#L122
295311
"aws_java_sdk_bundle": "1.12.262", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.4
296312
"azure_storage": "7.0.1", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-azure/3.3.4
@@ -304,10 +320,9 @@
304320
},
305321
{
306322
"product": "3.4.2",
307-
"spark": "3.4.2",
308323
"java-base": "11",
324+
"java-devel": "11",
309325
"python": "3.11",
310-
"hadoop_short_version": "3",
311326
"hadoop_long_version": "3.3.4", # https://github.com/apache/spark/blob/1db2f5c36b120c213432fc658c9fd24fc73cb45e/pom.xml#L122
312327
"aws_java_sdk_bundle": "1.12.262", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.4
313328
"azure_storage": "7.0.1", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-azure/3.3.4
@@ -321,10 +336,9 @@
321336
},
322337
{
323338
"product": "3.5.0",
324-
"spark": "3.5.0",
325339
"java-base": "11",
340+
"java-devel": "11",
326341
"python": "3.11",
327-
"hadoop_short_version": "3",
328342
"hadoop_long_version": "3.3.4", # https://github.com/apache/spark/blob/6a5747d66e53ed0d934cdd9ca5c9bd9fde6868e6/pom.xml#L125
329343
"aws_java_sdk_bundle": "1.12.262", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.4
330344
"azure_storage": "7.0.1", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-azure/3.3.4
@@ -340,8 +354,8 @@
340354
"product": "3.5.1",
341355
"spark": "3.5.1",
342356
"java-base": "11",
357+
"java-devel": "11",
343358
"python": "3.11",
344-
"hadoop_short_version": "3",
345359
"hadoop_long_version": "3.3.4", # https://github.com/apache/spark/blob/6a5747d66e53ed0d934cdd9ca5c9bd9fde6868e6/pom.xml#L125
346360
"aws_java_sdk_bundle": "1.12.262", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-aws/3.3.4
347361
"azure_storage": "7.0.1", # https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-azure/3.3.4

druid/Dockerfile

Lines changed: 75 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,76 @@
44
# Ignoring DL4006 globally because we inherit the SHELL from our base image
55
# hadolint global ignore=DL3038,DL4006
66

7-
FROM stackable/image/java-base
7+
# hadolint ignore=DL3006
8+
FROM stackable/image/java-devel as druid-builder
89

910
ARG PRODUCT
1011
ARG JACKSON_DATAFORMAT_XML
1112
ARG STAX2_API
1213
ARG WOODSTOX_CORE
1314
ARG AUTHORIZER
15+
16+
RUN microdnf update && \
17+
microdnf install \
18+
# Required to install pyyaml
19+
python-pip \
20+
# Required to patch druid
21+
patch && \
22+
microdnf clean all && \
23+
rm -rf /var/cache/yum && \
24+
# pyyaml is required for the compile Druid
25+
pip install --no-cache-dir pyyaml==6.0.1
26+
27+
USER stackable
28+
WORKDIR /stackable
29+
30+
COPY --chown=stackable:stackable druid/stackable/patches/apply_patches.sh /stackable/apache-druid-${PRODUCT}-src/patches/apply_patches.sh
31+
COPY --chown=stackable:stackable druid/stackable/patches/${PRODUCT} /stackable/apache-druid-${PRODUCT}-src/patches/${PRODUCT}
32+
33+
RUN curl --fail -L "https://repo.stackable.tech/repository/packages/druid/apache-druid-${PRODUCT}-src.tar.gz" | tar -xzC . && \
34+
cd apache-druid-${PRODUCT}-src && \
35+
./patches/apply_patches.sh ${PRODUCT} && \
36+
mvn clean install -Pdist -pl '!extensions-core/druid-ranger-security' -DskipTests -Dmaven.javadoc.skip=true && \
37+
tar -xzf /stackable/apache-druid-${PRODUCT}-src/distribution/target/apache-druid-${PRODUCT}-bin.tar.gz && \
38+
mv /stackable/apache-druid-${PRODUCT}-src/apache-druid-${PRODUCT} /stackable/apache-druid-${PRODUCT} && \
39+
rm -rf /stackable/apache-druid-${PRODUCT}-src
40+
# Do not remove the /stackable/apache-druid-${PRODUCT}/quickstart folder, it is needed for loading the Wikipedia
41+
# testdata in kuttl tests and the getting started guide.
42+
43+
# Install the Prometheus emitter extension. This bundle contains the emitter and all jar dependencies.
44+
RUN curl --fail "https://repo.stackable.tech/repository/packages/druid/druid-prometheus-emitter-${PRODUCT}.tar.gz" | tar -xzC /stackable/apache-druid-${PRODUCT}/extensions && \
45+
# Install OPA authorizer extension.
46+
curl --fail "https://repo.stackable.tech/repository/packages/druid/druid-opa-authorizer-${AUTHORIZER}.tar.gz" | tar -xzC /stackable/apache-druid-${PRODUCT}/extensions && \
47+
# Install jackson-dataformat-xml, stax2-api, and woodstox-core which are required for logging, and remove stax-ex.
48+
rm /stackable/apache-druid-${PRODUCT}/lib/stax-ex-*.jar && \
49+
curl --fail -L -o /stackable/apache-druid-${PRODUCT}/lib/jackson-dataformat-xml-${JACKSON_DATAFORMAT_XML}.jar \
50+
"https://repo.stackable.tech/repository/packages/jackson-dataformat-xml/jackson-dataformat-xml-${JACKSON_DATAFORMAT_XML}.jar" && \
51+
curl --fail -L -o /stackable/apache-druid-${PRODUCT}/lib/stax2-api-${STAX2_API}.jar \
52+
"https://repo.stackable.tech/repository/packages/stax2-api/stax2-api-${STAX2_API}.jar" && \
53+
curl --fail -L -o /stackable/apache-druid-${PRODUCT}/lib/woodstox-core-${WOODSTOX_CORE}.jar \
54+
"https://repo.stackable.tech/repository/packages/woodstox-core/woodstox-core-${WOODSTOX_CORE}.jar"
55+
56+
# For earlier versions this script removes the .class file that contains the
57+
# vulnerable code.
58+
# TODO: This can be restricted to target only versions which do not honor the environment
59+
# varible that has been set above but this has not currently been implemented
60+
COPY shared/log4shell.sh /bin
61+
RUN /bin/log4shell.sh "/stackable/apache-druid-${PRODUCT}"
62+
63+
# Ensure no vulnerable files are left over
64+
# This will currently report vulnerable files being present, as it also alerts on
65+
# SocketNode.class, which we do not remove with our scripts.
66+
# Further investigation will be needed whether this should also be removed.
67+
COPY shared/log4shell_1.6.1-log4shell_Linux_x86_64 /bin/log4shell_scanner_x86_64
68+
COPY shared/log4shell_1.6.1-log4shell_Linux_aarch64 /bin/log4shell_scanner_aarch64
69+
COPY shared/log4shell_scanner /bin/log4shell_scanner
70+
RUN /bin/log4shell_scanner s "/stackable/apache-druid-${PRODUCT}"
71+
# ===
72+
73+
# hadolint ignore=DL3006
74+
FROM stackable/image/java-base as final
75+
76+
ARG PRODUCT
1477
ARG RELEASE
1578

1679
LABEL name="Apache Druid" \
@@ -22,36 +85,27 @@ LABEL name="Apache Druid" \
2285
description="This image is deployed by the Stackable Operator for Apache Druid."
2386

2487
RUN microdnf update && \
25-
microdnf install \
26-
findutils \
27-
gzip \
28-
tar \
29-
zip && \
3088
microdnf clean all && \
3189
rm -rf /var/cache/yum
3290

3391
USER stackable
3492
WORKDIR /stackable
3593

94+
COPY --from=druid-builder /stackable /stackable
3695
COPY --chown=stackable:stackable druid/stackable /stackable
3796
COPY --chown=stackable:stackable druid/licenses /licenses
3897

39-
RUN curl --fail -L https://repo.stackable.tech/repository/packages/druid/apache-druid-${PRODUCT}-bin.tar.gz | tar -xzC . && \
40-
ln -s /stackable/apache-druid-${PRODUCT} /stackable/druid && \
98+
RUN ln -s /stackable/apache-druid-${PRODUCT} /stackable/druid && \
4199
# Force to overwrite the existing 'run-druid'
42-
ln -sf /stackable/bin/run-druid /stackable/druid/bin/run-druid && \
43-
# Install the Prometheus emitter extension. This bundle contains the emitter and all jar dependencies.
44-
curl --fail https://repo.stackable.tech/repository/packages/druid/druid-prometheus-emitter-${PRODUCT}.tar.gz | tar -xzC /stackable/druid/extensions && \
45-
# Install OPA authorizer extension.
46-
curl --fail https://repo.stackable.tech/repository/packages/druid/druid-opa-authorizer-${AUTHORIZER}.tar.gz | tar -xzC /stackable/druid/extensions && \
47-
# Install jackson-dataformat-xml, stax2-api, and woodstox-core which are required for logging, and remove stax-ex.
48-
rm /stackable/druid/lib/stax-ex-*.jar && \
49-
curl --fail -L -o /stackable/druid/lib/jackson-dataformat-xml-${JACKSON_DATAFORMAT_XML}.jar \
50-
https://repo.stackable.tech/repository/packages/jackson-dataformat-xml/jackson-dataformat-xml-${JACKSON_DATAFORMAT_XML}.jar && \
51-
curl --fail -L -o /stackable/druid/lib/stax2-api-${STAX2_API}.jar \
52-
https://repo.stackable.tech/repository/packages/stax2-api/stax2-api-${STAX2_API}.jar && \
53-
curl --fail -L -o /stackable/druid/lib/woodstox-core-${WOODSTOX_CORE}.jar \
54-
https://repo.stackable.tech/repository/packages/woodstox-core/woodstox-core-${WOODSTOX_CORE}.jar
100+
ln -sf /stackable/bin/run-druid /stackable/druid/bin/run-druid
101+
102+
ENV PATH="${PATH}":/stackable/druid/bin
103+
104+
# ===
105+
# Mitigation for CVE-2021-44228 (Log4Shell)
106+
# This variable is supported as of Log4j version 2.10 and
107+
# disables the vulnerable feature
108+
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
55109

56110
WORKDIR /stackable/druid
57111
CMD ["bin/run-druid", "coordinator", "conf/druid/cluster/master/coordinator-overlord/"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/distribution/pom.xml b/distribution/pom.xml
2+
index 14013a7a5f..58fd00009e 100644
3+
--- a/distribution/pom.xml
4+
+++ b/distribution/pom.xml
5+
@@ -252,8 +252,6 @@
6+
<argument>-c</argument>
7+
<argument>org.apache.druid.extensions:druid-pac4j</argument>
8+
<argument>-c</argument>
9+
- <argument>org.apache.druid.extensions:druid-ranger-security</argument>
10+
- <argument>-c</argument>
11+
<argument>org.apache.druid.extensions:druid-kubernetes-extensions</argument>
12+
<argument>-c</argument>
13+
<argument>org.apache.druid.extensions:druid-catalog</argument>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/distribution/pom.xml b/distribution/pom.xml
2+
index 14013a7a5f..58fd00009e 100644
3+
--- a/distribution/pom.xml
4+
+++ b/distribution/pom.xml
5+
@@ -252,8 +252,6 @@
6+
<argument>-c</argument>
7+
<argument>org.apache.druid.extensions:druid-pac4j</argument>
8+
<argument>-c</argument>
9+
- <argument>org.apache.druid.extensions:druid-ranger-security</argument>
10+
- <argument>-c</argument>
11+
<argument>org.apache.druid.extensions:druid-kubernetes-extensions</argument>
12+
<argument>-c</argument>
13+
<argument>org.apache.druid.extensions:druid-catalog</argument>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/distribution/pom.xml b/distribution/pom.xml
2+
index 14013a7a5f..58fd00009e 100644
3+
--- a/distribution/pom.xml
4+
+++ b/distribution/pom.xml
5+
@@ -252,8 +252,6 @@
6+
<argument>-c</argument>
7+
<argument>org.apache.druid.extensions:druid-pac4j</argument>
8+
<argument>-c</argument>
9+
- <argument>org.apache.druid.extensions:druid-ranger-security</argument>
10+
- <argument>-c</argument>
11+
<argument>org.apache.druid.extensions:druid-kubernetes-extensions</argument>
12+
<argument>-c</argument>
13+
<argument>org.apache.druid.extensions:druid-catalog</argument>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
# Enable error handling and unset variable checking
4+
set -eu
5+
set -o pipefail
6+
7+
# Check if $1 (VERSION) is provided
8+
if [ -z "${1-}" ]; then
9+
echo "Please provide a value for VERSION as the first argument."
10+
exit 1
11+
fi
12+
13+
VERSION="$1"
14+
PATCH_DIR="patches/$VERSION"
15+
16+
# Check if version-specific patches directory exists
17+
if [ ! -d "$PATCH_DIR" ]; then
18+
echo "Patches directory '$PATCH_DIR' does not exist."
19+
exit 1
20+
fi
21+
22+
# Create an array to hold the patches in sorted order
23+
declare -a patch_files=()
24+
25+
echo "Applying patches from ${PATCH_DIR}" now
26+
27+
# Read the patch files into the array
28+
while IFS= read -r -d $'\0' file; do
29+
patch_files+=("$file")
30+
done < <(find "$PATCH_DIR" -name "*.patch" -print0 | sort -zV)
31+
32+
echo "Found ${#patch_files[@]} patches, applying now"
33+
34+
# Iterate through sorted patch files
35+
for patch_file in "${patch_files[@]}"; do
36+
echo "Applying $patch_file"
37+
# We can not use Git here, as we are not within a Git repo
38+
patch --directory "." --strip=1 < "$patch_file" || {
39+
echo "Failed to apply $patch_file"
40+
exit 1
41+
}
42+
done
43+
44+
echo "All patches applied successfully."

0 commit comments

Comments
 (0)