Skip to content

Commit df80332

Browse files
authored
feat: custom product version for Omid (#1174)
* feat: support custom product versions * chore: changelog
1 parent c05fde3 commit df80332

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ All notable changes to this project will be documented in this file.
128128
- nifi: Remove `2.2.0` ([#1114]).
129129
- kafka: Remove `3.7.1` and `3.8.0` ([#1117]).
130130
- spark-connect-client: Remove `3.5.5` ([#1142]).
131+
- omid: Enable custom versions ([#1174]).
131132

132133
[nifi-iceberg-bundle]: https://github.com/stackabletech/nifi-iceberg-bundle
133134
[#1025]: https://github.com/stackabletech/docker-images/pull/1025
@@ -194,6 +195,7 @@ All notable changes to this project will be documented in this file.
194195
[#1168]: https://github.com/stackabletech/docker-images/pull/1168
195196
[#1170]: https://github.com/stackabletech/docker-images/pull/1170
196197
[#1173]: https://github.com/stackabletech/docker-images/pull/1173
198+
[#1174]: https://github.com/stackabletech/docker-images/pull/1174
197199
[#1179]: https://github.com/stackabletech/docker-images/pull/1179
198200
[#1180]: https://github.com/stackabletech/docker-images/pull/1180
199201

omid/Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
FROM stackable/image/java-devel AS builder
55

66
ARG PRODUCT
7+
ARG RELEASE
78
ARG DELETE_CACHES="true"
89
ARG STACKABLE_USER_UID
910

@@ -27,13 +28,21 @@ COPY --chown=${STACKABLE_USER_UID}:0 omid/stackable/patches/${PRODUCT} /stackabl
2728
RUN --mount=type=cache,id=maven-omid-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
2829
set -x
2930
cd "$(/stackable/patchable --images-repo-root=src checkout omid ${PRODUCT})"
31+
32+
ORIGINAL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
33+
NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
34+
35+
mvn versions:set -DnewVersion=$NEW_VERSION
36+
3037
# Create snapshot of the source code including custom patches
31-
tar -czf /stackable/omid-${PRODUCT}-src.tar.gz .
38+
tar -czf /stackable/omid-${NEW_VERSION}-src.tar.gz .
3239
mvn --batch-mode --no-transfer-progress package -Phbase-2 -DskipTests
33-
tar -xf tso-server/target/omid-tso-server-${PRODUCT}-bin.tar.gz -C /stackable
34-
mv tso-server/target/bom.json /stackable/omid-tso-server-${PRODUCT}/omid-tso-server-${PRODUCT}.cdx.json
35-
tar -xf examples/target/omid-examples-${PRODUCT}-bin.tar.gz -C /stackable
36-
mv examples/target/bom.json /stackable/omid-examples-${PRODUCT}/omid-examples-${PRODUCT}.cdx.json
40+
tar -xf tso-server/target/omid-tso-server-${NEW_VERSION}-bin.tar.gz -C /stackable
41+
sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g" tso-server/target/bom.json
42+
mv tso-server/target/bom.json /stackable/omid-tso-server-${NEW_VERSION}/omid-tso-server-${NEW_VERSION}.cdx.json
43+
tar -xf examples/target/omid-examples-${NEW_VERSION}-bin.tar.gz -C /stackable
44+
sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g" examples/target/bom.json
45+
mv examples/target/bom.json /stackable/omid-examples-${NEW_VERSION}/omid-examples-${NEW_VERSION}.cdx.json
3746

3847
if [ "${DELETE_CACHES}" = "true" ] ; then
3948
rm -rf /stackable/.m2/repository/*
@@ -46,7 +55,7 @@ EOF
4655
# TODO: This can be restricted to target only versions which do not honor the environment
4756
# varible that has been set above but this has not currently been implemented
4857
COPY shared/log4shell.sh /bin
49-
RUN /bin/log4shell.sh /stackable/omid-tso-server-${PRODUCT}
58+
RUN /bin/log4shell.sh /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE}
5059

5160
# Ensure no vulnerable files are left over
5261
# This will currently report vulnerable files being present, as it also alerts on
@@ -55,7 +64,7 @@ RUN /bin/log4shell.sh /stackable/omid-tso-server-${PRODUCT}
5564
COPY shared/log4shell_1.6.1-log4shell_Linux_x86_64 /bin/log4shell_scanner_x86_64
5665
COPY shared/log4shell_1.6.1-log4shell_Linux_aarch64 /bin/log4shell_scanner_aarch64
5766
COPY shared/log4shell_scanner /bin/log4shell_scanner
58-
RUN /bin/log4shell_scanner s /stackable/omid-tso-server-${PRODUCT}
67+
RUN /bin/log4shell_scanner s /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE}
5968
# ===
6069

6170
FROM stackable/image/java-base
@@ -76,17 +85,17 @@ LABEL name="Apache Phoenix Omid" \
7685
COPY omid/licenses /licenses
7786

7887
COPY --chown=${STACKABLE_USER_UID}:0 omid/stackable /stackable
79-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server-${PRODUCT}
80-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-examples-${PRODUCT} /stackable/omid-examples-${PRODUCT}
81-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-${PRODUCT}-src.tar.gz /stackable
88+
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE} /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE}
89+
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-examples-${PRODUCT}-stackable${RELEASE} /stackable/omid-examples-${PRODUCT}-stackable${RELEASE}
90+
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/omid-${PRODUCT}-stackable${RELEASE}-src.tar.gz /stackable
8291

8392
RUN <<EOF
8493
microdnf update
8594
microdnf clean all
8695
rm -rf /var/cache/yum
8796

88-
ln -s /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server
89-
ln -s /stackable/omid-examples-${PRODUCT} /stackable/omid-examples
97+
ln -s /stackable/omid-tso-server-${PRODUCT}-stackable${RELEASE} /stackable/omid-tso-server
98+
ln -s /stackable/omid-examples-${PRODUCT}-stackable${RELEASE} /stackable/omid-examples
9099
curl https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar \
91100
-o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar
92101
chmod -x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar

0 commit comments

Comments
 (0)