Skip to content

Commit d2e7f7e

Browse files
committed
wip
1 parent 5def648 commit d2e7f7e

6 files changed

Lines changed: 47 additions & 14 deletions

File tree

demos/data-lakehouse-iceberg-trino-spark/create-nifi-ingestion-job.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ spec:
1010
initContainers:
1111
- name: wait-for-kafka
1212
image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev
13-
command: ["bash", "-c", "echo 'Waiting for all kafka brokers to be ready' && kubectl wait --for=condition=ready --timeout=30m pod -l app.kubernetes.io/instance=kafka -l app.kubernetes.io/name=kafka"]
13+
command:
14+
- bash
15+
- -euo
16+
- pipefail
17+
- -c
18+
- |
19+
echo 'Waiting for all kafka brokers to be ready'
20+
kubectl wait --for=condition=ready --timeout=30m pod -l app.kubernetes.io/instance=kafka -l app.kubernetes.io/name=kafka
1421
containers:
1522
- name: create-nifi-ingestion-job
1623
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
@@ -54,7 +61,7 @@ data:
5461
import urllib3
5562
5663
# As of 2022-08-29 we cant use "https://nifi:8443" here because <h2>The request contained an invalid host header [<code>nifi:8443</code>] in the request [<code>/nifi-api</code>]. Check for request manipulation or third-party intercept.</h2>
57-
ENDPOINT = f"https://nifi-node-default-0.nifi-node-default.{os.environ['NAMESPACE']}.svc.cluster.local:8443" # For local testing / developing replace it, afterwards change back to f"https://nifi-node-default-0.nifi-node-default.{os.environ['NAMESPACE']}.svc.cluster.local:8443"
64+
ENDPOINT = f"https://nifi-node-default-0.nifi-node-default-headless.{os.environ['NAMESPACE']}.svc.cluster.local:8443" # For local testing / developing replace it, afterwards change back to f"https://nifi-node-default-0.nifi-node-default-headless.{os.environ['NAMESPACE']}.svc.cluster.local:8443"
5865
USERNAME = "admin"
5966
PASSWORD = open("/nifi-admin-credentials-secret/admin").read()
6067

demos/data-lakehouse-iceberg-trino-spark/create-spark-ingestion-job.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,24 @@ spec:
1313
initContainers:
1414
- name: wait-for-kafka
1515
image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev
16-
command: ["bash", "-c", "echo 'Waiting for all kafka brokers to be ready' && kubectl wait --for=condition=ready --timeout=30m pod -l app.kubernetes.io/name=kafka -l app.kubernetes.io/instance=kafka"]
16+
command:
17+
- bash
18+
- -euo
19+
- pipefail
20+
- -c
21+
- |
22+
echo 'Waiting for all kafka brokers to be ready'
23+
kubectl wait --for=condition=ready --timeout=30m pod -l app.kubernetes.io/name=kafka -l app.kubernetes.io/instance=kafka
1724
containers:
1825
- name: create-spark-ingestion-job
1926
image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev
20-
command: ["bash", "-c", "echo 'Submitting Spark job' && kubectl apply -f /tmp/manifest/spark-ingestion-job.yaml"]
27+
command:
28+
- bash
29+
- -euo
30+
- pipefail
31+
- -c
32+
- |
33+
echo 'Submitting Spark job' && kubectl apply -f /tmp/manifest/spark-ingestion-job.yaml
2134
volumeMounts:
2235
- name: manifest
2336
mountPath: /tmp/manifest
@@ -56,7 +69,7 @@ data:
5669
spark.sql.extensions: org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
5770
spark.sql.catalog.lakehouse: org.apache.iceberg.spark.SparkCatalog
5871
spark.sql.catalog.lakehouse.type: hive
59-
spark.sql.catalog.lakehouse.uri: thrift://hive-iceberg:9083
72+
spark.sql.catalog.lakehouse.uri: thrift://hive-iceberg-metastore:9083
6073
# Every merge into statements creates 8 files.
6174
# Paralleling is enough for the demo, might need to be increased (or omitted entirely) when merge larger data volumes
6275
spark.sql.shuffle.partitions: "8"

demos/data-lakehouse-iceberg-trino-spark/create-trino-tables.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ spec:
1010
initContainers:
1111
- name: wait-for-testdata
1212
image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev
13-
command: ["bash", "-c", "echo 'Waiting for job load-test-data to finish' && kubectl wait --for=condition=complete --timeout=30m job/load-test-data"]
13+
command:
14+
- bash
15+
- -euo
16+
- pipefail
17+
- -c
18+
- |
19+
echo 'Waiting for job load-test-data to finish'
20+
kubectl wait --for=condition=complete --timeout=30m job/load-test-data
1421
containers:
1522
- name: create-tables-in-trino
1623
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev

demos/data-lakehouse-iceberg-trino-spark/setup-superset.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ 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/data-lakehouse-iceberg-trino-spark/superset-assets.zip && python -u /tmp/script/script.py"]
12+
command:
13+
- "bash"
14+
- "-c"
15+
- "pipefail"
16+
- "curl -o superset-assets.zip https://raw.githubusercontent.com/stackabletech/demos/main/demos/data-lakehouse-iceberg-trino-spark/superset-assets.zip && python -u /tmp/script/script.py"
1317
volumeMounts:
1418
- name: script
1519
mountPath: /tmp/script
@@ -39,7 +43,7 @@ data:
3943
import logging
4044
import requests
4145
42-
base_url = "http://superset-node-default:8088" # For local testing / developing replace it, afterwards change back to http://superset-node-default:8088
46+
base_url = "http://superset-node:8088" # For local testing / developing replace it, afterwards change back to http://superset-node:8088
4347
superset_username = open("/superset-credentials/adminUser.username").read()
4448
superset_password = open("/superset-credentials/adminUser.password").read()
4549
trino_username = "admin"

stacks/data-lakehouse-iceberg-trino-spark/nifi.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ spec:
99
clusterConfig:
1010
authentication:
1111
- authenticationClass: nifi-admin-credentials
12-
listenerClass: external-unstable
1312
sensitiveProperties:
1413
keySecret: nifi-sensitive-property-key
1514
autoGenerate: true
1615
nodes:
16+
roleConfig:
17+
listenerClass: external-unstable
1718
config:
1819
resources:
1920
cpu:
2021
min: "2"
2122
max: "4"
2223
memory:
23-
limit: '6Gi'
24+
limit: "6Gi"
2425
storage:
2526
contentRepo:
2627
capacity: "10Gi"
@@ -51,4 +52,4 @@ kind: Secret
5152
metadata:
5253
name: nifi-admin-credentials-secret
5354
stringData:
54-
admin: {{ nifiAdminPassword }}
55+
admin: "{{ nifiAdminPassword }}"

stacks/data-lakehouse-iceberg-trino-spark/trino.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ spec:
77
image:
88
productVersion: "476"
99
clusterConfig:
10-
listenerClass: external-unstable
1110
catalogLabelSelector:
1211
matchLabels:
1312
trino: trino
@@ -18,14 +17,16 @@ spec:
1817
configMapName: opa
1918
package: trino
2019
coordinators:
20+
roleConfig:
21+
listenerClass: external-unstable
2122
config:
2223
queryMaxMemory: 10TB
2324
resources:
2425
cpu:
2526
min: "1"
2627
max: "4"
2728
memory:
28-
limit: '6Gi'
29+
limit: "6Gi"
2930
roleGroups:
3031
default:
3132
replicas: 1
@@ -37,7 +38,7 @@ spec:
3738
min: "2"
3839
max: "6"
3940
memory:
40-
limit: '20Gi'
41+
limit: "20Gi"
4142
roleGroups:
4243
default:
4344
replicas: 4

0 commit comments

Comments
 (0)