Skip to content

Commit 8ad5fa4

Browse files
committed
Adds Spark and a changelog entry
1 parent 6d4f536 commit 8ad5fa4

File tree

3 files changed

+35
-26
lines changed

3 files changed

+35
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file.
2929
README file ([#819]).
3030
- Update cargo-cyclonedx to 0.5.5 and build CycloneDX 1.5 files ([#783])
3131
- Enable [Docker build checks](https://docs.docker.com/build/checks/) ([#872])
32+
- Make username, user id, group id configurable, use numeric ids everywhere, change group of all files to 0 ([#849], [#890])
3233

3334
### Removed
3435

@@ -63,6 +64,7 @@ All notable changes to this project will be documented in this file.
6364
[#822]: https://github.com/stackabletech/docker-images/pull/822
6465
[#846]: https://github.com/stackabletech/docker-images/pull/846
6566
[#848]: https://github.com/stackabletech/docker-images/pull/848
67+
[#849]: https://github.com/stackabletech/docker-images/pull/849
6668
[#851]: https://github.com/stackabletech/docker-images/pull/851
6769
[#852]: https://github.com/stackabletech/docker-images/pull/852
6870
[#853]: https://github.com/stackabletech/docker-images/pull/853
@@ -76,6 +78,7 @@ All notable changes to this project will be documented in this file.
7678
[#879]: https://github.com/stackabletech/docker-images/pull/879
7779
[#881]: https://github.com/stackabletech/docker-images/pull/881
7880
[#882]: https://github.com/stackabletech/docker-images/pull/882
81+
[#890]: https://github.com/stackabletech/docker-images/pull/890
7982

8083
## [24.7.0] - 2024-07-24
8184

kafka-testing-tools/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat-${KCAT}/kcat /s
3434
RUN ln -s /stackable/kcat-${KCAT} /stackable/kcat
3535
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /licenses /licenses
3636

37-
3837
COPY --chown=${STACKABLE_USER_UID}:0 kafka-testing-tools/licenses /licenses
3938

4039
ENTRYPOINT ["/stackable/kcat"]

spark-k8s/Dockerfile

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ ARG WOODSTOX_CORE
172172
ARG JMX_EXPORTER
173173
ARG TARGETARCH
174174
ARG TINI
175+
ARG STACKABLE_USER_UID
175176

176177
WORKDIR /stackable/spark-${PRODUCT}
177178

@@ -283,45 +284,51 @@ LABEL name="Apache Spark" \
283284
summary="The Stackable image for Apache Spark with PySpark support." \
284285
description="This image is deployed by the Stackable Operator for Apache Spark on Kubernetes."
285286

286-
RUN microdnf update && \
287-
microdnf install \
288-
gzip \
289-
hostname \
290-
# required for spark startup scripts
291-
procps \
292-
"python${PYTHON}" \
293-
"python${PYTHON}-pip" \
294-
zip \
295-
# This is needed by the Spark UI to display process information using jps and jmap
296-
# Copying the binaries from the builder stage failed.
297-
"java-${JAVA_VERSION}-openjdk-devel" \
298-
&& microdnf clean all \
299-
&& rm -rf /var/cache/yum
300-
301-
RUN ln -s /usr/bin/python${PYTHON} /usr/bin/python \
302-
&& ln -s /usr/bin/pip-${PYTHON} /usr/bin/pip
303-
304287

305288
ENV HOME=/stackable
306289
ENV SPARK_HOME=/stackable/spark
307290
ENV PATH=$SPARK_HOME:$PATH:/bin:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$HOME/.local/bin
308291
ENV PYSPARK_PYTHON=/usr/bin/python
309292
ENV PYTHONPATH=$SPARK_HOME/python
310293

294+
COPY spark-k8s/stackable /stackable
295+
COPY spark-k8s/licenses /licenses
296+
311297
COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-builder /stackable/spark-${PRODUCT}/dist /stackable/spark
312298
COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-builder /stackable/spark-${PRODUCT}/assembly/target/bom.json /stackable/spark/spark-${PRODUCT}.cdx.json
313299
COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-builder /stackable/jmx /stackable/jmx
314300
COPY --from=spark-builder /usr/bin/tini /usr/bin/tini
315301

316-
RUN ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar \
317-
# Symlink example jar, so that we can easily use it in tests
318-
&& ln -s /stackable/spark/examples/jars/spark-examples_*.jar /stackable/spark/examples/jars/spark-examples.jar
302+
RUN <<EOF
303+
microdnf update
304+
# procps: required for spark startup scripts
305+
# java-*-openjdk-devel: This is needed by the Spark UI to display process information using jps and jmap
306+
# Copying just the binaries from the builder stage failed.
307+
microdnf install \
308+
gzip \
309+
hostname \
310+
procps \
311+
"python${PYTHON}" \
312+
"python${PYTHON}-pip" \
313+
zip \
314+
"java-${JAVA_VERSION}-openjdk-devel"
315+
microdnf clean all
316+
rm -rf /var/cache/yum
317+
318+
ln -s /usr/bin/python${PYTHON} /usr/bin/python
319+
ln -s /usr/bin/pip-${PYTHON} /usr/bin/pip
319320

320-
USER ${STACKABLE_USER_UID}
321-
WORKDIR /stackable
321+
ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar
322+
# Symlink example jar, so that we can easily use it in tests
323+
ln -s /stackable/spark/examples/jars/spark-examples_*.jar /stackable/spark/examples/jars/spark-examples.jar
322324

323-
COPY spark-k8s/stackable /stackable
324-
COPY spark-k8s/licenses /licenses
325+
# All files and folders owned by root to support running as arbitrary users
326+
# This is best practice as all container users will belong to the root group (0)
327+
chown -R ${STACKABLE_USER_UID}:0 /stackable
328+
chmod -R g=u /stackable
329+
EOF
330+
331+
USER ${STACKABLE_USER_UID}
325332

326333
WORKDIR /stackable/spark
327334
ENTRYPOINT [ "/stackable/run-spark.sh" ]

0 commit comments

Comments
 (0)