SlideShare a Scribd company logo
Alex Dadgar
HOMOLOGOUS SPARK
CLUSTERS USING
NOMAD
Alex Dadgar
Team Lead of Nomad
HashiCorp
Deploying Spark
Deploying Spark
Why?
2006
2010
2012 2014 20162008
We’re in a transitional period
• Migrations to cloud
• Monolithic applications toward micro-services
• DevOps and an explosion of tooling
• Rise of cluster schedulers
Big Data is here to stay
• 2014 IDC Research Study
• Compound growth of 42% - near doubling!
• 2010 - 1 ZB
• 2020 - 50 ZB
Spark is here to stay!
Homologous Apache Spark Clusters Using Nomad with Alex Dadgar
Homologous Apache Spark Clusters Using Nomad with Alex Dadgar
What is Nomad?
Jobs
Nodes
Cluster Scheduler
• Easy for Developers
• Operationally Simple
• Built for ScaleNomad
Easy for Developers
example.nomad
# Define our simple redis job
job "redis" {
# Run only in us-east-1
datacenters = ["us-east-1"]
# Define the single redis task using Docker
task "redis" {
driver = "docker"
config {
image = "redis:latest"
}
resources {
cpu = 500 # Mhz
memory = 256 # MB
network {
mbits = 10
port “redis” {}
}
}
}
}
Job Specification
Declares what to run
Job Specification
Nomad determines where and
manages how to run
Job Specification
Powerful yet simple
# Define our simple redis job
job "redis" {
# Run only in us-east-1
datacenters = ["us-east-1"]
# Define the single redis task using Docker
task "redis" {
driver = "docker"
config {
image = "redis:latest"
}
resources {
cpu = 500 # Mhz
memory = 256 # MB
network {
mbits = 10
port “redis” {}
}
}
}
}
Containerized
Virtualized
Standalone
Qemu / KVM
Java Jar
Static Binaries
Rkt
LXC
Docker
Containerized
Virtualized
Standalone
Docker Windows Server Containers
Qemu / KVM
Hyper-V
Xen
Java Jar
Static Binaries
C#
Rkt
LXC
Operationally Simple
Client Server
Single Region Architecture
SERVER SERVER SERVER
CLIENT CLIENT CLIENTDC1 DC2 DC3
FOLLOWER LEADER FOLLOWER
REPLICATION
FORWARDING
REPLICATION
FORWARDING
RPC RPC RPC
Built for Scale
Built on Experience
GOSSIP CONSENSUS
Mature Libraries Proven Design Patterns
Built on Research
GOSSIP CONSENSUS
Homologous Apache Spark Clusters Using Nomad with Alex Dadgar
Nomad
Million Container
Challenge
1,000 Jobs
1,000 Tasks per Job
5,000 Hosts on GCE
1,000,000 Containers
Homologous Apache Spark Clusters Using Nomad with Alex Dadgar
-Bill Gates
“640 KB ought to be enough for anybody.
2nd Largest Hedge Fund
18K Cores
5 Hours
2,200 Containers/second
Today and in the Future
Benefits to Deploying on Nomad
Today: Uncompromised Spark
• ./spark-submit workflow remains
• Supports: Scala, Java, R, Python
• Support Spark Shell
• Dynamic Executors
• Run with or without Docker
Terminal
$ ./bin/spark-submit 
--master nomad 
--docker-image hashicorp/spark-nomad 
--distribution local:///opt/spark 
--class org.apache.spark.examples.SparkPi 
local:/opt/spark/examples/jars/spark-examples_2.11-2.1.1.jar 
10
Today: Shared Batch/Service Cluster
• No separate Spark cluster and Service cluster
• Higher density and reduced cost
• Operators manage one infrastructure
• Developers learn one tool
Google Borg Paper
Figure 5 shows that
segregating prod and
non-prod work
would need 20–30%
more machines in
the median cell to
run our workload.
Today: Security
• Integration with HashiCorp Vault
• Vault stores static secrets and can generate
dynamic secrets
• IAM credentials
• Don’t bake secrets into Spark jobs
HASHICORP
task “payment-api" {
…
vault {
policies = [“s3_user_data_rw”]
}
template {
data = <<END
{{with $secret := vault "aws/creds/deploy" }}
AWS_SECRET_ACCESS_KEY={{$secret.Data.access_key}}
AWS_ACCESS_KEY_ID={{$secret.Data.secret_key}}
{{end}}
<<END
dest = “secrets/aws_creds”
env = true
}
}
Today: Security
• Went to great lengths to minimize the exposure of Vault
token
• Servers never see token
• One time access (can detect tampering)
• Write to in-memory file (tmpfs)
• Full talk: https://youtu.be/4gAYyAA6h9E
Today: Multi Region/DC
SERVER SERVER SERVER
FOLLOWER LEADER FOLLOWER
REPLICATION
FORWARDING
REPLICATION
REGION B GOSSIP
REPLICATION REPLICATION
FORWARDING
REGION FORWARDING
REGION A
SERVER
FOLLOWER
SERVER SERVER
LEADER FOLLOWER
Today: Cron Spark Jobs
• Run a Spark Job on a cron schedule
• Responsibility of Nomad to manage and launch
the job
• Higher Reliability
Today: Templated Spark Jobs
• Spark Submit can take a Nomad Job file as a
template
• Merges generated Spark job
• Fully customizable
Today: Templated Spark Jobs
• Run a logging sidecar to ship Spark logs
• Retrieve secrets securely from Vault
• Register Spark jobs in service discovery
• Customize any Nomad tunable
job "template" {
group "driver" {
task "driver" {
meta { "spark.nomad.role" = "driver"}
}
task "log-forwarding-sidecar" {
# sidecar task definition here
}
}
group "executor" {
task "executor" {
meta { "spark.nomad.role" = “executor" }
}
task "log-forwarding-sidecar" {
# sidecar task definition here
}
}
}
Terminal
$ ./bin/spark-submit 
--class org.apache.spark.examples.SparkPi 
--master nomad 
--docker-image hashicorp/spark-nomad 
--distribution local:///opt/spark 
--conf spark.nomad.job.template=template.json 
local:/opt/spark/examples/jars/spark-examples_2.11-2.1.1.jar 
10
job "template" {
group "executor" {
task "executor" {
meta { "spark.nomad.role" = “executor" }
template {
data = <<END
{{with $secret := vault "aws/creds/deploy" }}
AWS_SECRET_ACCESS_KEY={{$secret.Data.access_key}}
AWS_ACCESS_KEY_ID={{$secret.Data.secret_key}} {{end}}
<<END
dest = “secrets/aws_creds”
env = true
}
vault {
policies = [“s3-mydata-rw”]
}
}
}
}
Future: Pre-emption
• Job Priorities: 0-100
• Run critical services at higher priority
• Run Spark Driver at higher priority than executors
• Preempt lower priority Spark Executors
• Still make progress
Future: Quotas and Chargebacks
• Enable multi-tenant clusters
• Gate job-submission based on quota
• Control hogging of cluster
• Fine-grain chargebacks
Future: GPU
• Speed up Machine-Learning Tasks
• Nomad Clients detect GPUs
• Spark jobs can annotate desire to run on GPU
machines
• Other tasks on host won’t have access to GPU
Future: Over-Subscription
• Jobs declare their resource requirement
• Often don’t use all of it
• Ask for 4 GB of Memory and use 1 GB
• Detect unused resource and make available to
batch jobs
Play with it!
• PR is out: https://github.com/apache/spark/pull/
18209
• Docker Image: https://hub.docker.com/r/
hashicorp/spark-nomad/
Thank You.
Twitter: @adadgar
GitHub: @dadgar

More Related Content

What's hot (20)

PDF
Spark Summit EU talk by Miklos Christine paddling up the stream
Spark Summit
 
PPTX
Keeping Spark on Track: Productionizing Spark for ETL
Databricks
 
PDF
ETL to ML: Use Apache Spark as an end to end tool for Advanced Analytics
Miklos Christine
 
PPTX
ETL with SPARK - First Spark London meetup
Rafal Kwasny
 
PDF
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Databricks
 
PDF
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Databricks
 
PDF
Operational Tips for Deploying Spark
Databricks
 
PDF
Reactive app using actor model & apache spark
Rahul Kumar
 
PDF
Spark Summit EU talk by Stavros kontopoulos and Justin Pihony
Spark Summit
 
PDF
SSR: Structured Streaming for R and Machine Learning
felixcss
 
PDF
Apache Spark Introduction - CloudxLab
Abhinav Singh
 
PDF
Spark Summit EU talk by William Benton
Spark Summit
 
PDF
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark Summit
 
PPTX
Real time Analytics with Apache Kafka and Apache Spark
Rahul Jain
 
PDF
Spark Summit EU talk by Jim Dowling
Spark Summit
 
PDF
Extending the R API for Spark with sparklyr and Microsoft R Server with Ali Z...
Databricks
 
PDF
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Databricks
 
PDF
Opaque: A Data Analytics Platform with Strong Security: Spark Summit East tal...
Spark Summit
 
PPTX
Alpine academy apache spark series #1 introduction to cluster computing wit...
Holden Karau
 
PPTX
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
Chester Chen
 
Spark Summit EU talk by Miklos Christine paddling up the stream
Spark Summit
 
Keeping Spark on Track: Productionizing Spark for ETL
Databricks
 
ETL to ML: Use Apache Spark as an end to end tool for Advanced Analytics
Miklos Christine
 
ETL with SPARK - First Spark London meetup
Rafal Kwasny
 
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Databricks
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Databricks
 
Operational Tips for Deploying Spark
Databricks
 
Reactive app using actor model & apache spark
Rahul Kumar
 
Spark Summit EU talk by Stavros kontopoulos and Justin Pihony
Spark Summit
 
SSR: Structured Streaming for R and Machine Learning
felixcss
 
Apache Spark Introduction - CloudxLab
Abhinav Singh
 
Spark Summit EU talk by William Benton
Spark Summit
 
Spark and Spark Streaming at Netfix-(Kedar Sedekar and Monal Daxini, Netflix)
Spark Summit
 
Real time Analytics with Apache Kafka and Apache Spark
Rahul Jain
 
Spark Summit EU talk by Jim Dowling
Spark Summit
 
Extending the R API for Spark with sparklyr and Microsoft R Server with Ali Z...
Databricks
 
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Databricks
 
Opaque: A Data Analytics Platform with Strong Security: Spark Summit East tal...
Spark Summit
 
Alpine academy apache spark series #1 introduction to cluster computing wit...
Holden Karau
 
SF Big Analytics_20190612: Scaling Apache Spark on Kubernetes at Lyft
Chester Chen
 

Similar to Homologous Apache Spark Clusters Using Nomad with Alex Dadgar (20)

PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PDF
The benefits of running Spark on your own Docker
Itai Yaffe
 
PDF
Nomad Multi-Cloud
Nic Jackson
 
PDF
Living the Nomadic life - Nic Jackson
Paris Container Day
 
PDF
Easy Cloud Native Transformation with Nomad
Bram Vogelaar
 
PPTX
Modern Scheduling for Modern Applications with Nomad
Mitchell Pronschinske
 
PDF
Standalone Spark Deployment for Stability and Performance
Romi Kuntsman
 
PPTX
Standalone Spark Deployment for Stability and Performance
Alon Torres
 
PDF
Easy Cloud Native Transformation using HashiCorp Nomad
Bram Vogelaar
 
PDF
Apache spark - Installation
Martin Zapletal
 
PPT
February 2016 HUG: Running Spark Clusters in Containers with Docker
Yahoo Developer Network
 
PDF
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Spark Summit
 
PPT
Running Apache Spark & Apache Zeppelin in Production
DataWorks Summit/Hadoop Summit
 
PDF
London HUG 8/3 - Nomad
London HashiCorp User Group
 
PDF
Altitude SF 2017: Nomad and next-gen application architectures
Fastly
 
PDF
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Spark Summit
 
PPTX
Spark
fatemehjamalii
 
PPTX
Spark Resource Manager
Shad Amez
 
PDF
Apache Spark At Apple with Sam Maclennan and Vishwanath Lakkundi
Databricks
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
The benefits of running Spark on your own Docker
Itai Yaffe
 
Nomad Multi-Cloud
Nic Jackson
 
Living the Nomadic life - Nic Jackson
Paris Container Day
 
Easy Cloud Native Transformation with Nomad
Bram Vogelaar
 
Modern Scheduling for Modern Applications with Nomad
Mitchell Pronschinske
 
Standalone Spark Deployment for Stability and Performance
Romi Kuntsman
 
Standalone Spark Deployment for Stability and Performance
Alon Torres
 
Easy Cloud Native Transformation using HashiCorp Nomad
Bram Vogelaar
 
Apache spark - Installation
Martin Zapletal
 
February 2016 HUG: Running Spark Clusters in Containers with Docker
Yahoo Developer Network
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Spark Summit
 
Running Apache Spark & Apache Zeppelin in Production
DataWorks Summit/Hadoop Summit
 
London HUG 8/3 - Nomad
London HashiCorp User Group
 
Altitude SF 2017: Nomad and next-gen application architectures
Fastly
 
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Spark Summit
 
Spark Resource Manager
Shad Amez
 
Apache Spark At Apple with Sam Maclennan and Vishwanath Lakkundi
Databricks
 
Ad

More from Databricks (20)

PPTX
DW Migration Webinar-March 2022.pptx
Databricks
 
PPTX
Data Lakehouse Symposium | Day 1 | Part 1
Databricks
 
PPT
Data Lakehouse Symposium | Day 1 | Part 2
Databricks
 
PPTX
Data Lakehouse Symposium | Day 2
Databricks
 
PPTX
Data Lakehouse Symposium | Day 4
Databricks
 
PDF
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Databricks
 
PDF
Democratizing Data Quality Through a Centralized Platform
Databricks
 
PDF
Learn to Use Databricks for Data Science
Databricks
 
PDF
Why APM Is Not the Same As ML Monitoring
Databricks
 
PDF
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
Databricks
 
PDF
Stage Level Scheduling Improving Big Data and AI Integration
Databricks
 
PDF
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Databricks
 
PDF
Scaling your Data Pipelines with Apache Spark on Kubernetes
Databricks
 
PDF
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Databricks
 
PDF
Sawtooth Windows for Feature Aggregations
Databricks
 
PDF
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Databricks
 
PDF
Re-imagine Data Monitoring with whylogs and Spark
Databricks
 
PDF
Raven: End-to-end Optimization of ML Prediction Queries
Databricks
 
PDF
Processing Large Datasets for ADAS Applications using Apache Spark
Databricks
 
PDF
Massive Data Processing in Adobe Using Delta Lake
Databricks
 
DW Migration Webinar-March 2022.pptx
Databricks
 
Data Lakehouse Symposium | Day 1 | Part 1
Databricks
 
Data Lakehouse Symposium | Day 1 | Part 2
Databricks
 
Data Lakehouse Symposium | Day 2
Databricks
 
Data Lakehouse Symposium | Day 4
Databricks
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Databricks
 
Democratizing Data Quality Through a Centralized Platform
Databricks
 
Learn to Use Databricks for Data Science
Databricks
 
Why APM Is Not the Same As ML Monitoring
Databricks
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
Databricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Databricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Databricks
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Databricks
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Databricks
 
Sawtooth Windows for Feature Aggregations
Databricks
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Databricks
 
Re-imagine Data Monitoring with whylogs and Spark
Databricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Databricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Databricks
 
Massive Data Processing in Adobe Using Delta Lake
Databricks
 
Ad

Recently uploaded (20)

PPT
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PPTX
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
PDF
apidays Singapore 2025 - Streaming Lakehouse with Kafka, Flink and Iceberg by...
apidays
 
PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PPTX
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PPTX
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
PDF
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
PDF
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
PDF
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
PDF
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
PDF
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
PPTX
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
PPTX
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
apidays Singapore 2025 - Streaming Lakehouse with Kafka, Flink and Iceberg by...
apidays
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 

Homologous Apache Spark Clusters Using Nomad with Alex Dadgar

  • 2. Alex Dadgar Team Lead of Nomad HashiCorp
  • 7. We’re in a transitional period • Migrations to cloud • Monolithic applications toward micro-services • DevOps and an explosion of tooling • Rise of cluster schedulers
  • 8. Big Data is here to stay • 2014 IDC Research Study • Compound growth of 42% - near doubling! • 2010 - 1 ZB • 2020 - 50 ZB
  • 9. Spark is here to stay!
  • 14. Cluster Scheduler • Easy for Developers • Operationally Simple • Built for ScaleNomad
  • 16. example.nomad # Define our simple redis job job "redis" { # Run only in us-east-1 datacenters = ["us-east-1"] # Define the single redis task using Docker task "redis" { driver = "docker" config { image = "redis:latest" } resources { cpu = 500 # Mhz memory = 256 # MB network { mbits = 10 port “redis” {} } } } }
  • 18. Job Specification Nomad determines where and manages how to run
  • 20. # Define our simple redis job job "redis" { # Run only in us-east-1 datacenters = ["us-east-1"] # Define the single redis task using Docker task "redis" { driver = "docker" config { image = "redis:latest" } resources { cpu = 500 # Mhz memory = 256 # MB network { mbits = 10 port “redis” {} } } } }
  • 21. Containerized Virtualized Standalone Qemu / KVM Java Jar Static Binaries Rkt LXC Docker
  • 22. Containerized Virtualized Standalone Docker Windows Server Containers Qemu / KVM Hyper-V Xen Java Jar Static Binaries C# Rkt LXC
  • 25. Single Region Architecture SERVER SERVER SERVER CLIENT CLIENT CLIENTDC1 DC2 DC3 FOLLOWER LEADER FOLLOWER REPLICATION FORWARDING REPLICATION FORWARDING RPC RPC RPC
  • 27. Built on Experience GOSSIP CONSENSUS Mature Libraries Proven Design Patterns
  • 30. Nomad Million Container Challenge 1,000 Jobs 1,000 Tasks per Job 5,000 Hosts on GCE 1,000,000 Containers
  • 32. -Bill Gates “640 KB ought to be enough for anybody.
  • 33. 2nd Largest Hedge Fund 18K Cores 5 Hours 2,200 Containers/second
  • 34. Today and in the Future Benefits to Deploying on Nomad
  • 35. Today: Uncompromised Spark • ./spark-submit workflow remains • Supports: Scala, Java, R, Python • Support Spark Shell • Dynamic Executors • Run with or without Docker
  • 36. Terminal $ ./bin/spark-submit --master nomad --docker-image hashicorp/spark-nomad --distribution local:///opt/spark --class org.apache.spark.examples.SparkPi local:/opt/spark/examples/jars/spark-examples_2.11-2.1.1.jar 10
  • 37. Today: Shared Batch/Service Cluster • No separate Spark cluster and Service cluster • Higher density and reduced cost • Operators manage one infrastructure • Developers learn one tool
  • 38. Google Borg Paper Figure 5 shows that segregating prod and non-prod work would need 20–30% more machines in the median cell to run our workload.
  • 39. Today: Security • Integration with HashiCorp Vault • Vault stores static secrets and can generate dynamic secrets • IAM credentials • Don’t bake secrets into Spark jobs
  • 40. HASHICORP task “payment-api" { … vault { policies = [“s3_user_data_rw”] } template { data = <<END {{with $secret := vault "aws/creds/deploy" }} AWS_SECRET_ACCESS_KEY={{$secret.Data.access_key}} AWS_ACCESS_KEY_ID={{$secret.Data.secret_key}} {{end}} <<END dest = “secrets/aws_creds” env = true } }
  • 41. Today: Security • Went to great lengths to minimize the exposure of Vault token • Servers never see token • One time access (can detect tampering) • Write to in-memory file (tmpfs) • Full talk: https://youtu.be/4gAYyAA6h9E
  • 42. Today: Multi Region/DC SERVER SERVER SERVER FOLLOWER LEADER FOLLOWER REPLICATION FORWARDING REPLICATION REGION B GOSSIP REPLICATION REPLICATION FORWARDING REGION FORWARDING REGION A SERVER FOLLOWER SERVER SERVER LEADER FOLLOWER
  • 43. Today: Cron Spark Jobs • Run a Spark Job on a cron schedule • Responsibility of Nomad to manage and launch the job • Higher Reliability
  • 44. Today: Templated Spark Jobs • Spark Submit can take a Nomad Job file as a template • Merges generated Spark job • Fully customizable
  • 45. Today: Templated Spark Jobs • Run a logging sidecar to ship Spark logs • Retrieve secrets securely from Vault • Register Spark jobs in service discovery • Customize any Nomad tunable
  • 46. job "template" { group "driver" { task "driver" { meta { "spark.nomad.role" = "driver"} } task "log-forwarding-sidecar" { # sidecar task definition here } } group "executor" { task "executor" { meta { "spark.nomad.role" = “executor" } } task "log-forwarding-sidecar" { # sidecar task definition here } } }
  • 47. Terminal $ ./bin/spark-submit --class org.apache.spark.examples.SparkPi --master nomad --docker-image hashicorp/spark-nomad --distribution local:///opt/spark --conf spark.nomad.job.template=template.json local:/opt/spark/examples/jars/spark-examples_2.11-2.1.1.jar 10
  • 48. job "template" { group "executor" { task "executor" { meta { "spark.nomad.role" = “executor" } template { data = <<END {{with $secret := vault "aws/creds/deploy" }} AWS_SECRET_ACCESS_KEY={{$secret.Data.access_key}} AWS_ACCESS_KEY_ID={{$secret.Data.secret_key}} {{end}} <<END dest = “secrets/aws_creds” env = true } vault { policies = [“s3-mydata-rw”] } } } }
  • 49. Future: Pre-emption • Job Priorities: 0-100 • Run critical services at higher priority • Run Spark Driver at higher priority than executors • Preempt lower priority Spark Executors • Still make progress
  • 50. Future: Quotas and Chargebacks • Enable multi-tenant clusters • Gate job-submission based on quota • Control hogging of cluster • Fine-grain chargebacks
  • 51. Future: GPU • Speed up Machine-Learning Tasks • Nomad Clients detect GPUs • Spark jobs can annotate desire to run on GPU machines • Other tasks on host won’t have access to GPU
  • 52. Future: Over-Subscription • Jobs declare their resource requirement • Often don’t use all of it • Ask for 4 GB of Memory and use 1 GB • Detect unused resource and make available to batch jobs
  • 53. Play with it! • PR is out: https://github.com/apache/spark/pull/ 18209 • Docker Image: https://hub.docker.com/r/ hashicorp/spark-nomad/