Skip to content

Commit 2e5e91d

Browse files
fix(spark-anomaly-detection): Adjust Trino HTTPS connection (#251)
* wip * fix assert zip content * fix zip * fix zip 2 * use main branch zip * set version back to 4.1.2 * Apply suggestions from code review Co-authored-by: Nick <[email protected]> * Update demos/spark-k8s-anomaly-detection-taxi-data/setup-superset.yaml Co-authored-by: Nick <[email protected]> * use listener service instead of headless --------- Co-authored-by: Nick <[email protected]>
1 parent 0ae0e0c commit 2e5e91d

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

demos/spark-k8s-anomaly-detection-taxi-data/create-spark-anomaly-detection-job.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,25 @@ spec:
99
initContainers:
1010
- name: wait-for-testdata
1111
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
12-
command: ["bash", "-c", "echo 'Waiting for job load-ny-taxi-data to finish' && kubectl wait --for=condition=complete --timeout=30m job/load-ny-taxi-data"]
12+
command:
13+
- bash
14+
- -euo
15+
- pipefail
16+
- -c
17+
- |
18+
echo 'Waiting for job load-ny-taxi-data to finish'
19+
kubectl wait --for=condition=complete --timeout=30m job/load-ny-taxi-data
1320
containers:
1421
- name: create-spark-anomaly-detection-job
1522
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
16-
command: ["bash", "-c", "echo 'Submitting Spark job' && kubectl apply -f /tmp/manifest/spark-ad-job.yaml"]
23+
command:
24+
- bash
25+
- -euo
26+
- pipefail
27+
- -c
28+
- |
29+
echo 'Submitting Spark job'
30+
kubectl apply -f /tmp/manifest/spark-ad-job.yaml
1731
volumeMounts:
1832
- name: manifest
1933
mountPath: /tmp/manifest
@@ -89,7 +103,7 @@ data:
89103
spark.sql.extensions: org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
90104
spark.sql.catalog.prediction: org.apache.iceberg.spark.SparkCatalog
91105
spark.sql.catalog.prediction.type: hive
92-
spark.sql.catalog.prediction.uri: thrift://hive-iceberg:9083
106+
spark.sql.catalog.prediction.uri: thrift://hive-iceberg-metastore:9083
93107
# AFAIK This can be removed in 24.3
94108
#spark.driver.userClassPathFirst: "false"
95109
#spark.executor.userClassPathFirst: "false"

demos/spark-k8s-anomaly-detection-taxi-data/setup-superset.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ spec:
99
containers:
1010
- name: setup-superset
1111
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
12-
command: ["bash", "-c", "curl -o superset-assets.zip https://raw.githubusercontent.com/stackabletech/demos/main/demos/spark-k8s-anomaly-detection-taxi-data/superset-assets.zip && python -u /tmp/script/script.py"]
12+
command:
13+
- bash
14+
- -euo
15+
- pipefail
16+
- -c
17+
- |
18+
curl -L -o superset-assets.zip sets.zip https://raw.githubusercontent.com/stackabletech/demos/main/demos/spark-k8s-anomaly-detection-taxi-data/superset-assets.zip
19+
python -u /tmp/script/script.py
1320
volumeMounts:
1421
- name: script
1522
mountPath: /tmp/script
@@ -39,7 +46,7 @@ data:
3946
import logging
4047
import requests
4148
42-
base_url = "http://superset-node-default:8088" # For local testing / developing replace it, afterwards change back to http://superset-node-default:8088
49+
base_url = "http://superset-node:8088" # For local testing / developing replace it, afterwards change back to http://superset-node:8088
4350
superset_username = open("/superset-credentials/adminUser.username").read()
4451
superset_password = open("/superset-credentials/adminUser.password").read()
4552
trino_username = "admin"
Binary file not shown.

stacks/trino-superset-s3/superset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ stringData:
2626
adminUser.firstname: Superset
2727
adminUser.lastname: Admin
2828
adminUser.email: [email protected]
29-
adminUser.password: {{ supersetAdminPassword }}
30-
connections.secretKey: {{ supersetSecretKey }}
29+
adminUser.password: "{{ supersetAdminPassword }}"
30+
connections.secretKey: "{{ supersetSecretKey }}"
3131
connections.sqlalchemyDatabaseUri: postgresql://superset:superset@postgresql-superset/superset
3232
---
3333
apiVersion: v1

0 commit comments

Comments
 (0)