Skip to content

Commit 31490f8

Browse files
sbernauerlabrenbe
authored andcommitted
feat(nifi): Add nifi-iceberg-bundle (#1060)
* feat(nifi): Add nifi-iceberg-bundle * changelog * Add SBOM to final image * Use version 0.0.1 * hadolint * Bump to 0.0.2 * Bump to 0.0.3
1 parent 3203717 commit 31490f8

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file.
3434
- zookeeper: check for correct permissions and ownerships in /stackable folder via
3535
`check-permissions-ownership.sh` provided in stackable-base image ([#1043]).
3636
- nifi: Add OPA authorizer plugin with workaround ([#1058]).
37+
- nifi: Add [nifi-iceberg-bundle](https://github.com/stackabletech/nifi-iceberg-bundle) for NiFi `2.2.0` ([#1060]).
3738
- java: Add JDK 24 ([#1097]).
3839
- ci: Add golang image to mirror workflow ([#1103]).
3940

@@ -94,6 +95,7 @@ All notable changes to this project will be documented in this file.
9495
[#1055]: https://github.com/stackabletech/docker-images/pull/1055
9596
[#1056]: https://github.com/stackabletech/docker-images/pull/1056
9697
[#1058]: https://github.com/stackabletech/docker-images/pull/1058
98+
[#1060]: https://github.com/stackabletech/docker-images/pull/1060
9799
[#1090]: https://github.com/stackabletech/docker-images/pull/1090
98100
[#1091]: https://github.com/stackabletech/docker-images/pull/1091
99101
[#1093]: https://github.com/stackabletech/docker-images/pull/1093

nifi/Dockerfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,88 @@ rm -rf /stackable/nifi-${PRODUCT}/docs
6363
chmod -R g=u /stackable
6464
EOF
6565

66+
FROM stackable/image/java-devel AS nifi-iceberg-bundle-builder
67+
68+
ARG NIFI_ICEBERG_BUNDLE
69+
ARG PRODUCT
70+
ARG STACKABLE_USER_UID
71+
72+
USER ${STACKABLE_USER_UID}
73+
WORKDIR /build
74+
75+
RUN <<EOF
76+
mkdir -p /stackable
77+
78+
# NiFI 1.x natively supports Iceberg, no need to build an iceberg-bundle for it
79+
if [[ "${PRODUCT}" != 1.* ]] ; then
80+
curl "https://github.com/stackabletech/nifi-iceberg-bundle/archive/refs/tags/${NIFI_ICEBERG_BUNDLE}.tar.gz" | tar -xzC .
81+
cd nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE} || exit
82+
83+
mvn \
84+
--batch-mode \
85+
--no-transfer-progress\
86+
clean package \
87+
-D nifi.version=${PRODUCT} \
88+
-Dmaven.javadoc.skip=true \
89+
-Denforcer.skip=true
90+
# We need "-Denforcer.skip=true", as the Maven version is too old
91+
92+
cp ./nifi-iceberg-services-api-nar/target/nifi-iceberg-services-api-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
93+
cp ./nifi-iceberg-services-nar/target/nifi-iceberg-services-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
94+
cp ./nifi-iceberg-processors-nar/target/nifi-iceberg-processors-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
95+
cp ./target/bom.json /stackable/nifi-iceberg-bundle.sbom.json
96+
97+
cd ..
98+
# Save disk space, even for intermediate images
99+
rm -rf nifi-iceberg-bundle-main
100+
101+
# Set correct groups
102+
chmod g=u /stackable/*.nar
103+
chmod g=u /stackable/*.sbom.json
104+
fi
105+
EOF
106+
107+
FROM stackable/image/java-devel AS nifi-iceberg-bundle-builder
108+
109+
ARG NIFI_ICEBERG_BUNDLE
110+
ARG PRODUCT
111+
ARG STACKABLE_USER_UID
112+
113+
USER ${STACKABLE_USER_UID}
114+
WORKDIR /build
115+
116+
RUN <<EOF
117+
mkdir -p /stackable
118+
119+
# NiFI 1.x natively supports Iceberg, no need to build an iceberg-bundle for it
120+
if [[ "${PRODUCT}" != 1.* ]] ; then
121+
curl "https://github.com/stackabletech/nifi-iceberg-bundle/archive/refs/tags/${NIFI_ICEBERG_BUNDLE}.tar.gz" | tar -xzC .
122+
cd nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE} || exit
123+
124+
mvn \
125+
--batch-mode \
126+
--no-transfer-progress\
127+
clean package \
128+
-D nifi.version=${PRODUCT} \
129+
-Dmaven.javadoc.skip=true \
130+
-Denforcer.skip=true
131+
# We need "-Denforcer.skip=true", as the Maven version is too old
132+
133+
cp ./nifi-iceberg-services-api-nar/target/nifi-iceberg-services-api-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
134+
cp ./nifi-iceberg-services-nar/target/nifi-iceberg-services-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
135+
cp ./nifi-iceberg-processors-nar/target/nifi-iceberg-processors-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
136+
cp ./target/bom.json /stackable/nifi-iceberg-bundle.sbom.json
137+
138+
cd ..
139+
# Save disk space, even for intermediate images
140+
rm -rf nifi-iceberg-bundle-main
141+
142+
# Set correct groups
143+
chmod g=u /stackable/*.nar
144+
chmod g=u /stackable/*.sbom.json
145+
fi
146+
EOF
147+
66148
FROM stackable/image/java-devel AS opa-authorizer-builder
67149

68150
ARG STACKABLE_USER_UID
@@ -100,6 +182,8 @@ LABEL name="Apache NiFi" \
100182

101183
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
102184
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
185+
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
186+
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.sbom.json /stackable/nifi-${PRODUCT}/lib/
103187

104188
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin/authorizer/target/opa-authorizer.nar /stackable/nifi-${PRODUCT}/extensions/opa-authorizer.nar
105189
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin/LICENSE /licenses/NIFI_OPA_PLUGIN_LICENSE

nifi/versions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"product": "2.2.0",
1414
"java-base": "21",
1515
"java-devel": "21",
16+
"nifi_iceberg_bundle": "0.0.3",
1617
},
1718
]

0 commit comments

Comments
 (0)