Skip to content

Commit 2b0f1d8

Browse files
authored
Merge branch 'main' into chore/tool-bumps-25.7.0
2 parents b8d19e7 + cc57146 commit 2b0f1d8

File tree

6 files changed

+1853
-26
lines changed

6 files changed

+1853
-26
lines changed

.github/workflows/build_spark-connect-client.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
name: Reusable Workflow
2727
uses: ./.github/workflows/reusable_build_image.yaml
2828
secrets:
29-
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
29+
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
3030
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
3131
with:
3232
product-name: spark-connect-client

.github/workflows/mirror.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Mirror Container Image
33
run-name: |
4-
Mirror Container Image (attempt #${{ github.run_attempt }})
4+
Mirror Container Image (${{ inputs.image-repository-uri }}:${{ inputs.image-index-manifest-tag }}, attempt #${{ github.run_attempt }})
55
66
on:
77
workflow_dispatch:

.github/workflows/reusable_build_image.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
uses: stackabletech/actions/publish-image@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0
6868
with:
6969
image-registry-uri: oci.stackable.tech
70-
image-registry-username: robot$sdp+github-action-build
70+
image-registry-username: robot$${{ inputs.registry-namespace }}+github-action-build
7171
image-registry-password: ${{ secrets.harbor-robot-secret }}
7272
image-repository: ${{ inputs.registry-namespace }}/${{ inputs.product-name }}
7373
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
@@ -93,7 +93,7 @@ jobs:
9393
uses: stackabletech/actions/publish-index-manifest@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0
9494
with:
9595
image-registry-uri: oci.stackable.tech
96-
image-registry-username: robot$sdp+github-action-build
96+
image-registry-username: robot$${{ inputs.registry-namespace }}+github-action-build
9797
image-registry-password: ${{ secrets.harbor-robot-secret }}
9898
image-repository: ${{ inputs.registry-namespace }}/${{ inputs.product-name }}
9999
image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ inputs.sdp-version }}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ All notable changes to this project will be documented in this file.
3636

3737
- ubi-rust-builder: Bump Rust toolchain to 1.85.0, cargo-cyclonedx to 0.5.7, and cargo-auditable to 0.6.6 ([#1050]).
3838
- spark-k8s: Include spark-connect jars. Replace OpenJDK with Temurin JDK. Cleanup. ([#1034]).
39+
- spark-k8s: Include spark-connect jars. Replace OpenJDK with Temurin JDK. Cleanup. ([#1034])
40+
- spark-connect-client: Image is now completely based on spark-k8s and includes JupyterLab and other demo dependencies ([#1071])
3941
- jmx_exporter: Bump products to use `1.2.0` ([#1090]).
4042
- kubectl: Bump products to use `1.33.0` ([#1090]).
4143
- yq: Bump products to use `4.45.2` ([#1090]).

spark-connect-client/Dockerfile

+14-22
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# spark-builder: provides client libs for spark-connect
44
FROM stackable/image/spark-k8s AS spark-builder
55

6-
FROM stackable/image/java-base
7-
86
ARG PRODUCT
97
ARG PYTHON
108
ARG RELEASE
@@ -18,42 +16,36 @@ LABEL name="Stackable Spark Connect Examples" \
1816
summary="Spark Connect Examples" \
1917
description="Spark Connect client libraries for Python and the JVM, including some examples."
2018

19+
# Need root to install setuptools
20+
USER root
2121

22-
ENV HOME=/stackable
23-
24-
COPY spark-connect-client/stackable/spark-connect-examples /stackable/spark-connect-examples
25-
COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-builder /stackable/spark/connect /stackable/spark/connect
22+
COPY --chown=${STACKABLE_USER_UID}:0 spark-connect-client/stackable/spark-connect-examples /stackable/spark-connect-examples
23+
COPY --chown=${STACKABLE_USER_UID}:0 spark-connect-client/stackable/.jupyter /stackable/.jupyter
2624

2725
RUN <<EOF
2826
microdnf update
2927
# python{version}-setuptools: needed to build the pyspark[connect] package
3028
microdnf install --nodocs \
31-
"python${PYTHON}" \
32-
"python${PYTHON}-pip" \
3329
"python${PYTHON}-setuptools"
3430
microdnf clean all
3531
rm -rf /var/cache/yum
3632

37-
ln -s /usr/bin/python${PYTHON} /usr/bin/python
38-
ln -s /usr/bin/pip-${PYTHON} /usr/bin/pip
39-
40-
# Install python libraries for the spark connect client
41-
# shellcheck disable=SC2102
42-
pip install --no-cache-dir pyspark[connect]==${PRODUCT}
43-
4433
# All files and folders owned by root group to support running as arbitrary users.
4534
# This is best practice as all container users will belong to the root group (0).
4635
chown -R ${STACKABLE_USER_UID}:0 /stackable
4736
chmod -R g=u /stackable
4837
EOF
4938

50-
# ----------------------------------------
51-
# Attention: We are changing the group of all files in /stackable directly above
52-
# If you do any file based actions (copying / creating etc.) below this comment you
53-
# absolutely need to make sure that the correct permissions are applied!
54-
# chown ${STACKABLE_USER_UID}:0
55-
# ----------------------------------------
56-
5739
USER ${STACKABLE_USER_UID}
5840

41+
# Install python packages.
42+
# Packages are intentionally installed in "user mode" to reduce the container attack surface.
43+
# - pyspark[connect] = spark connect client libs
44+
# - jupyterlab = notebook client used in demos
45+
RUN pip install --no-cache-dir --user \
46+
"pyspark[connect]==${PRODUCT}" \
47+
"jupyterlab==4.4.1" \
48+
"scikit-learn==1.3.1" \
49+
"matplotlib==3.10.1"
50+
5951
WORKDIR /stackable/spark-connect-examples/python

0 commit comments

Comments
 (0)