-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: Spark Operator Blueprint update #359
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanty, I appreciate your PR! I've added a few minor suggestions for your review. Additionally, could you please ensure that any necessary updates are reflected in the Website documentation? You can refer to the TPCDS Benchmark test example at this link: https://awslabs.github.io/data-on-eks/docs/blueprints/data-analytics/spark-operator-yunikorn, particularly in the example section. It would also be beneficial to provide an explanation on the utilization of NVMe SSD by the pods in this configuration.
volumes: | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /local1 | ||
driver: | ||
volumeMounts: | ||
- name: spark-local-dir-1 | ||
mountPath: /ossdata1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permission | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: ['sh', '-c', 'mkdir /ossdata1; chown -R 1000:1000 /ossdata1'] | ||
volumeMounts: | ||
- name: spark-local-dir-1 | ||
mountPath: /ossdata1 | ||
cores: 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment block in the Karpenter Provisioner and Userdata in main.tf around NVMe and the volumes.
Then added a callout on each of the pods around the node selectors.
labels: | ||
app: "tpcds-benchmark" | ||
applicationId: "tpcds-benchmark-3t" | ||
queue: root.prod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment here saying "YuniKorn Queue"
labels: | ||
app: "tpcds-data-generation" | ||
applicationId: "tpcds-data-generation-3t" | ||
queue: root.prod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
volumes: | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /local1 | ||
driver: | ||
volumeMounts: | ||
- name: spark-local-dir-1 | ||
mountPath: /ossdata1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permission | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: ['sh', '-c', 'mkdir /ossdata1; chown -R 1000:1000 /ossdata1'] | ||
volumeMounts: | ||
- name: spark-local-dir-1 | ||
mountPath: /ossdata1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
volumes: # using NVMe instance storage mounted on /local1 | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /local1 | ||
type: Directory | ||
|
||
driver: | ||
volumeMounts: # Points to InstanceStore 150GB NVMe SSD for shuffle spill over from memory | ||
- name: spark-local-dir-1 | ||
mountPath: /data1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permissions | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: [ 'sh', '-c', 'chown -R 185 /local1' ] | ||
volumeMounts: | ||
- mountPath: "/local1" | ||
name: "spark-local-dir-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
volumes: # using NVMe instance storage mounted on /local1 | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /local1 | ||
type: Directory | ||
|
||
driver: | ||
volumeMounts: # Points to InstanceStore 150GB NVMe SSD for shuffle spill over from memory | ||
- name: spark-local-dir-1 | ||
mountPath: /data1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permissions | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: [ 'sh', '-c', 'chown -R 185 /local1' ] | ||
volumeMounts: | ||
- mountPath: "/local1" | ||
name: "spark-local-dir-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter/CA, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
volumes: # using NVMe instance storage mounted on /mnt/k8s-disks | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /mnt/k8s-disks | ||
type: Directory | ||
|
||
driver: | ||
volumeMounts: # Points to InstanceStore 150GB NVMe SSD for shuffle spill over from memory | ||
- name: spark-local-dir-1 | ||
mountPath: /data1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permissions | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: [ 'sh', '-c', 'chown -R 185 /mnt/k8s-disks' ] | ||
volumeMounts: | ||
- mountPath: "/mnt/k8s-disks" | ||
name: "spark-local-dir-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
volumes: # using NVMe instance storage mounted on /mnt/k8s-disks | ||
- name: spark-local-dir-1 | ||
hostPath: | ||
path: /mnt/k8s-disks | ||
type: Directory | ||
|
||
driver: | ||
volumeMounts: # Points to InstanceStore 150GB NVMe SSD for shuffle spill over from memory | ||
- name: spark-local-dir-1 | ||
mountPath: /data1 | ||
readOnly: false | ||
initContainers: | ||
- name: volume-permissions | ||
image: public.ecr.aws/y4g4v0z7/busybox | ||
command: [ 'sh', '-c', 'chown -R 185 /mnt/k8s-disks' ] | ||
volumeMounts: | ||
- mountPath: "/mnt/k8s-disks" | ||
name: "spark-local-dir-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a comment stating that the NVMe SSD disks provided with c5d instances are automatically formatted and mounted by Karpenter, and subsequently integrated into the node as the primary storage volume. Therefore, it is unnecessary to employ hostPath in Spark jobs for mounting this volume to pods. Instead, Spark pods can effortlessly utilize the local NVMe SSD through the use of emptyDir().
- job_name: kubecost | ||
honor_labels: true | ||
scrape_interval: 1m | ||
scrape_timeout: 10s | ||
metrics_path: /metrics | ||
scheme: http | ||
dns_sd_configs: | ||
- names: | ||
- kubecost-cost-analyzer.kubecost.svc | ||
type: 'A' | ||
port: 9003 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you not using KubeCost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubecost is still running but scraping these metrics was causing some problems with grafana dashboards. Queries were returning multiple metrics and breaking "group by" statements.
Kubecost should still be able to collect metrics and make determinations on cost, it just isn't scraped in the central Prometheus config.
happy to revert these changes as needed, i didn't investigate the issue very far and don't want to break other stuff.
nodesortpolicy: | ||
type: binpacking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very important feature: Add some details to explain this feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a quick call out in the values file and link to the policy docs.
I didn't find a great place on the site to add a callout, maybe we should add a section on Yunikorn and some of the benefits/config we have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼 Thanks for the PR @alanty 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanty LGTM! Please merge latest main so CI checks can pass.
- job_name: karpenter | ||
kubernetes_sd_configs: | ||
- role: endpoints | ||
namespaces: | ||
names: | ||
- karpenter | ||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_endpoint_port_name] | ||
regex: http-metrics | ||
action: keep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -12,7 +12,7 @@ variable "region" { | |||
|
|||
variable "eks_cluster_version" { | |||
description = "EKS Cluster version" | |||
default = "1.26" | |||
default = "1.28" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌🏽
What does this PR do?
This PR includes updates/bumps and changes that I've made while working with the Spark Operator Blueprint:
providers.tf
to useexec
for authentication tokensaws-cloudwatch-metrics-valyes.yaml
AmazonSSMManagedInstanceCore
IAM policy to Karpenter node rolekubecost
scrape, addkarpenter
confignodesortpolicy
tobinpacking
aws_eks_cluster_auth data
resourcelocal-disks
in bootstrap.shhostpath
mounts from NVMe examplesMotivation
Been working with the example and I've updated and fixed a few things that may help someone else using the blueprint.
More
website/docs
orwebsite/blog
section for this featurepre-commit run -a
with this PR. Link for installing pre-commit locallyFor Moderators
Additional Notes
local-disks
script from the EKS AMI the pods will write to an NVMe raid by default, we don't need the hostpath mounts to leverage the fast disks.