From bbb3a9eaf7825a0ec64aab42cf5718edcb1f12d6 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 13 Jul 2026 12:13:48 +0200 Subject: [PATCH 1/8] fix(signal-processing): Correctly template namespace in notebook --- stacks/signal-processing/jupyterhub.yaml | 5 +++++ stacks/signal-processing/tsdb.ipynb | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index 2f586b51..f404e7fc 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -54,6 +54,11 @@ options: initContainers: - name: download-notebook image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace # This file path needs adjustment for versioned demos on release branch command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/main/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] volumeMounts: diff --git a/stacks/signal-processing/tsdb.ipynb b/stacks/signal-processing/tsdb.ipynb index d5581578..f66179fa 100644 --- a/stacks/signal-processing/tsdb.ipynb +++ b/stacks/signal-processing/tsdb.ipynb @@ -68,7 +68,10 @@ "metadata": {}, "outputs": [], "source": [ - "engine = sqlalchemy.create_engine(\"postgresql://admin:adminadmin@postgresql-timescaledb.{{ NAMESPACE }}.svc.cluster.local:5432/tsdb\")\n", + "import os\n", + "namespace = os.environ.get('NAMESPACE', \"default\")\n", + "\n", + "engine = sqlalchemy.create_engine(f\"postgresql://admin:adminadmin@postgresql-timescaledb.{namespace}.svc.cluster.local:5432/tsdb\")\n", "last_time = \"1970-01-01\"\n", "cols = ['r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7', 'r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14']" ] From 35162bf72cab585b0f1b308efae9c84f73e0aad1 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 13 Jul 2026 12:16:47 +0200 Subject: [PATCH 2/8] temp: Fetch notebook from branch with fixes --- stacks/signal-processing/jupyterhub.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index f404e7fc..775a6b73 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -60,7 +60,7 @@ options: fieldRef: fieldPath: metadata.namespace # This file path needs adjustment for versioned demos on release branch - command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/main/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] + command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] volumeMounts: - mountPath: /notebook name: notebook From 31ac513eefb52e7e308e1063c411c4e68b07a1bd Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 13 Jul 2026 13:20:42 +0200 Subject: [PATCH 3/8] fix(signal-processing): Use different placeholder in NiFi flow --- demos/signal-processing/DownloadAndWriteToDB.json | 2 +- demos/signal-processing/create-nifi-ingestion-job.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/signal-processing/DownloadAndWriteToDB.json b/demos/signal-processing/DownloadAndWriteToDB.json index 6605021a..018e033c 100644 --- a/demos/signal-processing/DownloadAndWriteToDB.json +++ b/demos/signal-processing/DownloadAndWriteToDB.json @@ -741,7 +741,7 @@ "kerberos-credentials-service": null, "dbcp-max-conn-lifetime": "-1", "Validation-query": "select count(*) from conditions;", - "Database Connection URL": "jdbc:postgresql://postgresql-timescaledb.{{ NAMESPACE }}.svc.cluster.local:5432/tsdb", + "Database Connection URL": "jdbc:postgresql://postgresql-timescaledb.[[ NAMESPACE ]].svc.cluster.local:5432/tsdb", "dbcp-time-between-eviction-runs": "-1", "Database User": "admin", "kerberos-user-service": null, diff --git a/demos/signal-processing/create-nifi-ingestion-job.yaml b/demos/signal-processing/create-nifi-ingestion-job.yaml index 45d75ff1..b4c4d597 100644 --- a/demos/signal-processing/create-nifi-ingestion-job.yaml +++ b/demos/signal-processing/create-nifi-ingestion-job.yaml @@ -94,7 +94,7 @@ data: filename = "/tmp/DownloadAndWriteToDB.json" with open(filename, "w") as f: - f.write(response.text.replace("{{ NAMESPACE }}", os.environ["NAMESPACE"])) + f.write(response.text.replace("[[ NAMESPACE ]]", os.environ["NAMESPACE"])) pg_id = get_root_pg_id() From 170c8c813af0278afcdf77b8916a7a3f263e3676 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 13 Jul 2026 13:50:24 +0200 Subject: [PATCH 4/8] temp: Fetch NiFi flow from branch with fixes --- demos/signal-processing/create-nifi-ingestion-job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/signal-processing/create-nifi-ingestion-job.yaml b/demos/signal-processing/create-nifi-ingestion-job.yaml index b4c4d597..1bcb36ce 100644 --- a/demos/signal-processing/create-nifi-ingestion-job.yaml +++ b/demos/signal-processing/create-nifi-ingestion-job.yaml @@ -90,7 +90,7 @@ data: # At release time, .scripts/update_refs.sh rewrites the branch in this URL to the release # branch. Keep the URL in a form its regex matches, or release-branch installs will # download this file from main (see the 26.3 regression). - response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/main/demos/signal-processing/DownloadAndWriteToDB.json") + response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/demos/signal-processing/DownloadAndWriteToDB.json") filename = "/tmp/DownloadAndWriteToDB.json" with open(filename, "w") as f: From e414ba008a3463ad9bb6c37045a72e0896388ca0 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Mon, 13 Jul 2026 14:49:46 +0200 Subject: [PATCH 5/8] chore(stack/signal-processing): Add some guidance for finding Helm values --- stacks/signal-processing/jupyterhub.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index 775a6b73..b7c62e2b 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -5,6 +5,8 @@ repo: name: jupyterhub url: https://jupyterhub.github.io/helm-chart/ version: 4.4.0 # appVersion: 5.5.0 +# Find values here: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/jupyterhub/values.yaml +# Note, they don't tag the repository, so you need to find _a_ commit where the Chart version matches what you are looking for. options: hub: config: From 006b2a0330dea290377e79eb70766435fed7dd03 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Mon, 13 Jul 2026 16:42:08 +0200 Subject: [PATCH 6/8] chore(stack/signal-processing): Disable cloudMetadata block The iptables call ing the It fails for me. I am on kernel 7.0. It could be that. Or maybe oci.stackable.tech/demos/jupyter-pyspark-with-alibi-detect needs some update? --- stacks/signal-processing/jupyterhub.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index b7c62e2b..187dd796 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -42,6 +42,11 @@ options: # the demo is reproducable for the release and it will be automatically replaced for the release branch. name: oci.stackable.tech/demos/jupyter-pyspark-with-alibi-detect tag: python-3.9 + cloudMetadata: + # Disable, otherwise we get Back-off restarting failed container block-cloud-metadata in pod: + # block-cloud-metadata iptables v1.8.9 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?) + # I believe this breaks in Kernel 7.x. + blockWithIptables: false serviceAccountName: spark networkPolicy: enabled: false From 28abd71671ff5551f54fbf6d3d34747d16791a6d Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Mon, 13 Jul 2026 16:45:10 +0200 Subject: [PATCH 7/8] fix(stack/signal-processing): Namespace interpolation Add extraEnv for providing the templated namespace. We would use the downward api, but that breaks because the value of extraEnv is also passed to `hub` which expects a dict. --- stacks/signal-processing/jupyterhub.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index 187dd796..ccff3eba 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -58,14 +58,17 @@ options: # {% if DEMO is defined %} stackable.tech/demo: "{{ DEMO }}" # {% endif %} + extraEnv: + # Needed because the Notebook runs code to interpolate the Postgres DB hostname with a namespace. + # We cannot use the downward API because some python code uses it and expects scalar values. + # We also MUST use a dict, otherwise hub shows the following error: + # traitlets.traitlets.TraitError: The 'environment' trait of a KubeSpawner instance expected a dict, not the list [{'name': 'NAMESPACE', 'value': 'my-namespace'}]. + # A helper in the chart formats these properly for any container env vars in Pods. + NAMESPACE: "{{ NAMESPACE }}" initContainers: - name: download-notebook image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev env: - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace # This file path needs adjustment for versioned demos on release branch command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] volumeMounts: From 81849f131c44519ee96b7ac83d3f0467b032212f Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 13 Jul 2026 17:02:56 +0200 Subject: [PATCH 8/8] chore: Apply suggestions Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- demos/signal-processing/create-nifi-ingestion-job.yaml | 2 +- stacks/signal-processing/jupyterhub.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/signal-processing/create-nifi-ingestion-job.yaml b/demos/signal-processing/create-nifi-ingestion-job.yaml index 1bcb36ce..5506b2af 100644 --- a/demos/signal-processing/create-nifi-ingestion-job.yaml +++ b/demos/signal-processing/create-nifi-ingestion-job.yaml @@ -90,7 +90,7 @@ data: # At release time, .scripts/update_refs.sh rewrites the branch in this URL to the release # branch. Keep the URL in a form its regex matches, or release-branch installs will # download this file from main (see the 26.3 regression). - response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/demos/signal-processing/DownloadAndWriteToDB.json") + response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/refs/heads/main/demos/signal-processing/DownloadAndWriteToDB.json") filename = "/tmp/DownloadAndWriteToDB.json" with open(filename, "w") as f: diff --git a/stacks/signal-processing/jupyterhub.yaml b/stacks/signal-processing/jupyterhub.yaml index ccff3eba..41579c77 100644 --- a/stacks/signal-processing/jupyterhub.yaml +++ b/stacks/signal-processing/jupyterhub.yaml @@ -70,7 +70,7 @@ options: image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev env: # This file path needs adjustment for versioned demos on release branch - command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] + command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/refs/heads/main/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb'] volumeMounts: - mountPath: /notebook name: notebook