Skip to content
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

create mobile job #121

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
oui is daily operator
mikev committed Jul 24, 2023
commit 5018a1adc6ddb7b7663327c690e84a28b4d95fae
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ data:
query.sql: |
SELECT
date, net_id, count(net_id) AS count
FROM TABLE_IOT_PACKETS GROUP BY net_d ORDER BY neti_d DESC
FROM TABLE_IOT_PACKETS GROUP BY net_id ORDER BY net_id DESC
---
apiVersion: "sparkoperator.k8s.io/v1beta2"
kind: SparkApplication
142 changes: 75 additions & 67 deletions manifests/poc-data-cluster/prod/spark/iot-oui-counts-silver.yaml
Original file line number Diff line number Diff line change
@@ -7,77 +7,85 @@ data:
query.sql: |
SELECT
date, oui, count(oui) AS count
FROM TABLE_IOT_PACKETS GROUP BY oui ORDER BY oui DESC
FROM TABLE_IOT_PACKETS
GROUP BY oui
ORDER BY oui DESC
WHERE date_add(current_date(), -1);
---
apiVersion: "sparkoperator.k8s.io/v1beta2"
kind: SparkApplication
kind: ScheduledSparkApplication
metadata:
name: iot-oui-counts-silver
namespace: spark
spec:
type: Scala
mode: cluster
image: "public.ecr.aws/k0m1p4t7/spark:v3.4.0-aws"
imagePullPolicy: Always
mainClass: Main
mainApplicationFile: "s3a://foundation-data-lake-requester-pays/jars/spark-streaming-sql-assembly-1.0.jar"
sparkVersion: "3.4.0"
restartPolicy:
type: OnFailure
onFailureRetries: 3
onFailureRetryInterval: 10
onSubmissionFailureRetries: 3
onSubmissionFailureRetryInterval: 10
sparkConf:
spark.databricks.delta.autoCompact.enabled: "true"
hadoopConf:
fs.s3a.aws.credentials.provider: com.amazonaws.auth.WebIdentityTokenCredentialsProvider
volumes:
- name: "tmp"
hostPath:
path: "/tmp"
type: Directory
- name: config-vol
configMap:
name: iot-oui-counts-silver-query
items:
- key: query.sql
path: query.sql
driver:
serviceAccount: spark-data-lake-access
cores: 1
coreLimit: "1200m"
memory: "512m"
nodeSelector:
node.kubernetes.io/instance-type: m5.large
envVars:
TABLE_IOT_PACKETS: s3a://foundation-data-lake-requester-pays/silver/iot-packets
PARTITION_BY: "date"
CHECKPOINT: s3a://foundation-data-lake-requester-pays/checkpoints/iot-oui-counts
OUTPUT: s3a://foundation-data-lake-requester-pays/silver/iot-oui-counts
QUERY_PATH: /app/query.sql
labels:
version: 3.4.0
volumeMounts:
- name: "test-volume"
mountPath: "/tmp"
- name: config-vol
mountPath: /app
executor:
serviceAccount: spark-data-lake-access
cores: 1
coreLimit: "1200m"
instances: 3
memory: "10G"
tolerations: # Schedule executor pods on spot instance group
- key: dedicated
operator: Equal
value: spark
effect: NoSchedule
nodeSelector:
nodegroup-type: spot
labels:
version: 3.4.0
volumeMounts:
schedule: "@daily"
concurrencyPolicy: Allow
successfulRunHistoryLimit: 1
failedRunHistoryLimit: 3
template:
type: Scala
mode: cluster
image: "public.ecr.aws/k0m1p4t7/spark:v3.4.0-aws"
imagePullPolicy: Always
mainClass: Main
mainApplicationFile: "s3a://foundation-data-lake-requester-pays/jars/spark-streaming-sql-assembly-1.0.jar"
sparkVersion: "3.4.0"
restartPolicy:
type: OnFailure
onFailureRetries: 3
onFailureRetryInterval: 10
onSubmissionFailureRetries: 3
onSubmissionFailureRetryInterval: 10
sparkConf:
spark.databricks.delta.autoCompact.enabled: "true"
hadoopConf:
fs.s3a.aws.credentials.provider: com.amazonaws.auth.WebIdentityTokenCredentialsProvider
volumes:
- name: "tmp"
mountPath: "/tmp"
hostPath:
path: "/tmp"
type: Directory
- name: config-vol
configMap:
name: iot-oui-counts-silver-query
items:
- key: query.sql
path: query.sql
driver:
serviceAccount: spark-data-lake-access
cores: 1
coreLimit: "1200m"
memory: "512m"
nodeSelector:
node.kubernetes.io/instance-type: m5.large
envVars:
TABLE_IOT_PACKETS: s3a://foundation-data-lake-requester-pays/silver/iot-packets
PARTITION_BY: "date"
CHECKPOINT: s3a://foundation-data-lake-requester-pays/checkpoints/iot-oui-counts
OUTPUT: s3a://foundation-data-lake-requester-pays/silver/iot-oui-counts
QUERY_PATH: /app/query.sql
labels:
version: 3.4.0
volumeMounts:
- name: "test-volume"
mountPath: "/tmp"
- name: config-vol
mountPath: /app
executor:
serviceAccount: spark-data-lake-access
cores: 1
coreLimit: "1200m"
instances: 3
memory: "10G"
tolerations: # Schedule executor pods on spot instance group
- key: dedicated
operator: Equal
value: spark
effect: NoSchedule
nodeSelector:
nodegroup-type: spot
labels:
version: 3.4.0
volumeMounts:
- name: "tmp"
mountPath: "/tmp"