Skip to content

ci(jupyterhub-keycloak): Add workflow for image build #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/dev_jupyterhub-keycloak-spark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Build and publish Spark for jupyterhub-keycloak demo

on:
workflow_dispatch:
push:
branches:
- main
# TODO (@NickLarsenNZ): Also build on release branches, but with a stackable0.0.0-dev or stackableYY.M.X tag.
# The current problem is that we don't know the patch level, so do we always build for `.0`, or just drop that
# (eg: stackableYY.M), but then do we do the same for main (eg: 0.0-dev)?
# - release-*
paths:
- demos/jupyterhub-keycloak/Dockerfile
- .github/workflows/dev_jupyterhub-keycloak-spark.yaml

jobs:
build_image:
name: Reusable Workflow
uses: ./.github/workflows/reusable_build_image.yaml
secrets:
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_DEMOS_GITHUB_ACTION_BUILD_SECRET }}
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
with:
image-name: spark
# TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
# the demo is reproducable for the release and it will be automatically replaced for the release branch.
image-version: 3.5.2-python311
containerfile-path: demos/jupyterhub-keycloak/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# docker build -t oci.stackable.tech/sandbox/spark:3.5.5-python311 -f Dockerfile .
# kind load docker-image oci.stackable.tech/sandbox/spark:3.5.5-python311 -n stackable-data-platform
# docker build -t oci.stackable.tech/demos/spark:3.5.2-python311 -f Dockerfile .
# kind load docker-image oci.stackable.tech/demos/spark:3.5.2-python311 -n stackable-data-platform
# or:
# docker push oci.stackable.tech/sandbox/spark:3.5.5-python311
# docker push oci.stackable.tech/demos/spark:3.5.2-python311

FROM spark:3.5.5-scala2.12-java17-ubuntu
FROM spark:3.5.2-scala2.12-java17-ubuntu

USER root

Expand Down
Binary file modified docs/modules/demos/images/jupyterhub-keycloak/load-nb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/modules/demos/pages/jupyterhub-keycloak.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ This setup is ideal for interactive data processing.

=== Spark Configuration

* **Executor Image**: Uses a custom image `oci.stackable.tech/sandbox/spark:3.5.5-python311` (built on the standard Spark image) for the executors, matching the Python version of the notebook.
* **Executor Image**: Uses a custom image `oci.stackable.tech/demos/spark:3.5.2-python311` (built on the standard Spark image) for the executors, matching the Python version of the notebook.
* **Resource Allocation**: Configures Spark executor instances, memory, and cores through settings defined in the notebook.
* **Hadoop and AWS Libraries**: Includes necessary Hadoop and AWS libraries for S3 operations, matching the notebook image version.

Expand Down
2 changes: 1 addition & 1 deletion stacks/jupyterhub-keycloak/jupyterhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ options:
image:
display_name: Image
choices:
{% for image in ["quay.io/jupyter/pyspark-notebook:python-3.11.9", "quay.io/jupyter/pyspark-notebook:spark-3.5.5"] %}
{% for image in ["quay.io/jupyter/pyspark-notebook:python-3.11.9", "quay.io/jupyter/pyspark-notebook:spark-3.5.2"] %}
"{{image}}":
display_name: "{{image}}"
kubespawner_override:
Expand Down
6 changes: 3 additions & 3 deletions stacks/jupyterhub-keycloak/process-s3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"acts as the driver. It is important that the versions of spark and python match across the driver (running in the juypyterhub image)\n",
"and the executor(s) (running in a separate image, specified below with the `spark.kubernetes.container.image` setting).\n",
"\n",
"The jupyterhub image `quay.io/jupyter/pyspark-notebook:spark-3.5.5` uses a base ubuntu image (like the spark images).\n",
"The versions of java match exactly. Python versions can differ at patch level, and the image used below `oci.stackable.tech/sandbox/spark:3.5.5-python311` is built from a `spark:3.5.2-scala2.12-java17-ubuntu` base image with python 3.11 (the same major/minor version as the notebook) installed.\n",
"The jupyterhub image `quay.io/jupyter/pyspark-notebook:spark-3.5.2` uses a base ubuntu image (like the spark images).\n",
"The versions of java match exactly. Python versions can differ at patch level, and the image used below `oci.stackable.tech/demos/spark:3.5.2-python311` is built from a `spark:3.5.2-scala2.12-java17-ubuntu` base image with python 3.11 (the same major/minor version as the notebook) installed.\n",
"\n",
"## S3\n",
"As we will be reading data from an S3 bucket, we need to add the necessary `hadoop` and `aws` libraries in the same hadoop version as the\n",
Expand All @@ -69,7 +69,7 @@
"NAMESPACE = os.environ.get(\"NAMESPACE\", \"default\")\n",
"POD_NAME = os.environ.get(\"HOSTNAME\", f\"jupyter-{os.environ.get('USER', 'default')}-{NAMESPACE}\")\n",
"\n",
"EXECUTOR_IMAGE = \"oci.stackable.tech/sandbox/spark:3.5.5-python311\" \n",
"EXECUTOR_IMAGE = \"oci.stackable.tech/demos/spark:3.5.2-python311\" \n",
"\n",
"spark = (\n",
" SparkSession.builder\n",
Expand Down