SlideShare a Scribd company logo
1 of 24
M E S O S F R A M E W O R K A P I
V 1
@ v i n o d k o n e
M E S O S A P I S
S c h e d u l e r M a s t e r A g e n t E x e c u t o r
Scheduler API Executor API
Internal API
Operator API
Framework API
N E T W O R K I N G C O N S T R A I N T S
S c h e d u l e r M a s t e r
Firewall
Containers :( Network partitions :(
D E P E N D E N C E O N N A T I V E
L I B R A R Y
S c h e d u l e r
M a s t e rJ a v a
L i b r a r y
N a t i v e
L i b r a r y
mesos.jar libmesos.so Hard to debug
Not portable
Un-needed dependencies
U N D O C U M E N T E D F R A M E W O R K
A P I
POST /master/mesos.internal.LaunchTasksMessage HTTP/1.1
User-Agent: libprocess/scheduler-1234-23-23342@127.0.0.1:8081
Libprocess-From: scheduler-1234-23-23342@127.0.0.1:8081
Connection: Keep-Alive
Host:
Transfer-Encoding: chunked
LIBPROCESS_IP
LIBPROCESS_ADVERTISE_IP
L A C K O F A P I V E R S I O N I N G
S c h e d u l e r M a s t e r
Version YDriver version X
Compatible?
H A R D T O E V O L V E T H E A P I
Lot of boiler plate to expose new API objects
Adding new features breaks the API
Maintenance API?
– H A R V E Y D E N T
“You either die a hero…
or live long enough to see yourself become the villain”
replaced by a better API
F R A M E W O R K A P I V 1 G O A L S
API versioning
Easy to evolve API
Well documented
Allow pure language client libraries
Work inside firewalls / containers
F R A M E W O R K A P I V 1
• Calls and Events as building blocks
• Schema: v1/scheduler.proto and v1/executor.proto
• Versioned API endpoints
• master: /api/v1/scheduler
• agent: /api/v1/executor
C A L L S Old API
S U B S C R I B E start()
T E A R D O W N stop()
A C C E P T acceptOffers()
D E C L I N E declineOffer()
R E V I V E reviveOffers()
K I L L killTask()
S H U T D O W N * Shutdown executor *
A C K N O W L E D G E acknowledgeStatusUpdate()
R E C O N C I L E reconcileTasks()
M E S S A G E sendFrameworkMessage()
R E Q U E S T requestResources()
S U P P R E S S suppressOffers()
E V E N T S Old API
S U B S C R I B E D registered() / reregistered()
O F F E R S resourceOffers()
R E S C I N D offerRescinded()
U P D A T E statusUpdate()
M E S S A G E frameworkMessage()
F A I L U R E slaveLost() / executorLost()
E R R O R error()
H E A R T B E A T * Periodic heartbeats *
P R O T O C O L
• HTTP 1.1
• Scheduler/Executor opens connections to the
master/agent
• A persistent connection to receive Events
• One (or more) connection(s) to send Calls
P R O T O C O L
• Every call is a HTTP POST request
• Content-Type: application/json or application/x-protobuf
• SUBSCRIBE call results in a “200 OK” streaming response
• Record-IO formatted events
• “Mesos-Stream-Id” header
• All successful non-SUBSCRIBE calls result in “202 Accepted”
• Must include “Mesos-Stream-Id" header
S U B S C R I P T I O N R E Q U E S T
POST /api/v1/scheduler HTTP/1.1
Host: masterhost:5050
Content-Type: application/json
Accept: application/json
Connection: close
{
“type” : “SUBSCRIBE”,
“subscribe” : {
“framework_info” : {
“user” : “foo”,
“name” : “Example HTTP Framework”
},
}
}
S U B S C R I P T I O N R E S P O N S E
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
<event length>
{
“type” : “SUBSCRIBED”,
“subscribed” : {
“framework_id” : {“value”:“12220-3440-12532-2345”},
“heartbeat_interval_seconds” : 15
}
}
<more events>
K I L L
POST /api/v1/scheduler HTTP/1.1
Host: masterhost:5050
Content-Type: application/son
Accept: application/json
Connection: close
Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
{
“framework_id” : {“value” : “12220-3440-12532-2345”},
“type” : “KILL”,
“kill” : {
“task_id” : {“value” : “12220-3440-12532-my-task”},
“agent_id” : {“value” : “12220-3440-12532-S123345”}
}
}
Response: HTTP/1.1 202 Accepted
D I S C O N N E C T I O N S &
P A R T I T I O N S
• Master tracks the persistent subscription connection
• Scheduler can reconnect within failover timeout
• Assigns stream IDs to uniquely identify streams
• Periodic HEARTBEATs sent by master
• Scheduler can reconnect if no HEARTBEATs
V E R S I O N I N G
Explicit Simple
Avoid version explosion
/api/v1/scheduler
/api/v1/executor
A P I V E R S I O N V S R E L E A S E
V E R S I O N
• API version == Major release version
• v1 API supported by 1.0.0, 1.4.0, 1.20.0
• vN API released in N-1 release version
• vN API considered stable in the last N-1 release
• Version bumping
• Major/API version bumped for backwards incompatible changes (> yearly)
• Minor version bumped regularly (4-8 weeks)
S C H E D U L E R A P I V 1 S T A T U S
• 0.28.0: More API changes (Use this version!)
• 0.24.0: MVP
• Experimental: Use in testing clusters only
• Schema: v1/scheduler/scheduler.proto
• Documentation: http://mesos.apache.org/documentation/latest/scheduler-http-api/
• Reference implementation
• C++ library:
https://github.com/apache/mesos/blob/master/src/scheduler/scheduler.cpp
• C++ scheduler:
https://github.com/apache/mesos/blob/master/src/examples/test_http_framework.cp
p
E X E C U T O R A P I V 1 S T A T U S
• 0.28.0: MVP
• Experimental: Use in testing clusters only
• Schema: v1/executor/executor.proto
• Documentation: http://mesos.apache.org/documentation/latest/executor-http-
api/
• Reference implementation
• C++ library:
https://github.com/apache/mesos/blob/master/src/executor/executor.cpp
• C++ executor:
https://github.com/apache/mesos/blob/master/src/examples/test_http_execut
or.cpp
T O D O
• Authentication support
• Encryption support
• Rate limiting support
• Scheduler <—> Executor message optimization
T H A N K Y O U
Questions?

More Related Content

Viewers also liked

Meson: Building a Machine Learning Orchestration Framework on Mesos
Meson: Building a Machine Learning Orchestration Framework on MesosMeson: Building a Machine Learning Orchestration Framework on Mesos
Meson: Building a Machine Learning Orchestration Framework on Mesos
Antony Arokiasamy
 
C++ API 디자인 - 확장성
C++ API 디자인 - 확장성C++ API 디자인 - 확장성
C++ API 디자인 - 확장성
HyeonSeok Choi
 

Viewers also liked (20)

Mesos Networking
Mesos NetworkingMesos Networking
Mesos Networking
 
Doing Big Data for Real with Docker
Doing Big Data for Real with Docker  Doing Big Data for Real with Docker
Doing Big Data for Real with Docker
 
Mesosphere & Magnetic: Take the pain out of running complex and critical serv...
Mesosphere & Magnetic: Take the pain out of running complex and critical serv...Mesosphere & Magnetic: Take the pain out of running complex and critical serv...
Mesosphere & Magnetic: Take the pain out of running complex and critical serv...
 
Elastic jenkins with mesos and dcos (2016 01-20)
Elastic jenkins with mesos and dcos (2016 01-20)Elastic jenkins with mesos and dcos (2016 01-20)
Elastic jenkins with mesos and dcos (2016 01-20)
 
Apache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in HadoopApache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in Hadoop
 
Easy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on AzureEasy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on Azure
 
Mesos sys adminday
Mesos sys admindayMesos sys adminday
Mesos sys adminday
 
Scaling Like Twitter with Apache Mesos
Scaling Like Twitter with Apache MesosScaling Like Twitter with Apache Mesos
Scaling Like Twitter with Apache Mesos
 
Introduce Apache Mesos
Introduce Apache MesosIntroduce Apache Mesos
Introduce Apache Mesos
 
Creating a Mesos python framework
Creating a Mesos python frameworkCreating a Mesos python framework
Creating a Mesos python framework
 
Meson: Building a Machine Learning Orchestration Framework on Mesos
Meson: Building a Machine Learning Orchestration Framework on MesosMeson: Building a Machine Learning Orchestration Framework on Mesos
Meson: Building a Machine Learning Orchestration Framework on Mesos
 
Meson: Heterogeneous Workflows with Spark at Netflix
Meson: Heterogeneous Workflows with Spark at NetflixMeson: Heterogeneous Workflows with Spark at Netflix
Meson: Heterogeneous Workflows with Spark at Netflix
 
C++ API 디자인 - 확장성
C++ API 디자인 - 확장성C++ API 디자인 - 확장성
C++ API 디자인 - 확장성
 
DC/OS: The definitive platform for modern apps
DC/OS: The definitive platform for modern appsDC/OS: The definitive platform for modern apps
DC/OS: The definitive platform for modern apps
 
Mesos + Marathon + Docker
Mesos + Marathon + DockerMesos + Marathon + Docker
Mesos + Marathon + Docker
 
클라우드 서비스운영 플랫폼 가루다
클라우드 서비스운영 플랫폼 가루다클라우드 서비스운영 플랫폼 가루다
클라우드 서비스운영 플랫폼 가루다
 
Deploying Docker Containers at Scale with Mesos and Marathon
Deploying Docker Containers at Scale with Mesos and MarathonDeploying Docker Containers at Scale with Mesos and Marathon
Deploying Docker Containers at Scale with Mesos and Marathon
 
REST API 디자인 개요
REST API 디자인 개요REST API 디자인 개요
REST API 디자인 개요
 
범용 PaaS 플랫폼 mesos(mesosphere)
범용 PaaS 플랫폼 mesos(mesosphere)범용 PaaS 플랫폼 mesos(mesosphere)
범용 PaaS 플랫폼 mesos(mesosphere)
 
TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...
TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...
TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...
 

Similar to Mesos framework API v1

Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
Sri Prasanna
 

Similar to Mesos framework API v1 (20)

Mesos 1.0
Mesos 1.0Mesos 1.0
Mesos 1.0
 
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend DevsGraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend Devs
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
The 12 Factor App
The 12 Factor AppThe 12 Factor App
The 12 Factor App
 
Owasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF SessionOwasp AppSecEU 2015 - BeEF Session
Owasp AppSecEU 2015 - BeEF Session
 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
 
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
Chicago Hadoop User Group (CHUG) Presentation on Apache Flume - April 9, 2014
 
Design Hypermedia APIs
Design Hypermedia APIsDesign Hypermedia APIs
Design Hypermedia APIs
 
Apache Pulsar Development 101 with Python
Apache Pulsar Development 101 with PythonApache Pulsar Development 101 with Python
Apache Pulsar Development 101 with Python
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 
The advantages of Arista/OVH configurations, and the technologies behind buil...
The advantages of Arista/OVH configurations, and the technologies behind buil...The advantages of Arista/OVH configurations, and the technologies behind buil...
The advantages of Arista/OVH configurations, and the technologies behind buil...
 
Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink
 
BonAHA framework - Lab presentation
BonAHA framework - Lab presentationBonAHA framework - Lab presentation
BonAHA framework - Lab presentation
 
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT TalksMykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
 
Developer-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for KubernetesDeveloper-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for Kubernetes
 
From SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurde
From SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurdeFrom SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurde
From SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurde
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Architecting the Future: Abstractions and Metadata - KCDC
Architecting the Future: Abstractions and Metadata - KCDCArchitecting the Future: Abstractions and Metadata - KCDC
Architecting the Future: Abstractions and Metadata - KCDC
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
 

More from Mesosphere Inc.

Growing the Mesos Ecosystem
Growing the Mesos EcosystemGrowing the Mesos Ecosystem
Growing the Mesos Ecosystem
Mesosphere Inc.
 

More from Mesosphere Inc. (20)

DevOps in Age of Kubernetes
DevOps in Age of KubernetesDevOps in Age of Kubernetes
DevOps in Age of Kubernetes
 
Java EE Modernization with Mesosphere DCOS
Java EE Modernization with Mesosphere DCOSJava EE Modernization with Mesosphere DCOS
Java EE Modernization with Mesosphere DCOS
 
Operating Kubernetes at Scale (Australia Presentation)
Operating Kubernetes at Scale (Australia Presentation)Operating Kubernetes at Scale (Australia Presentation)
Operating Kubernetes at Scale (Australia Presentation)
 
Episode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OSEpisode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OS
 
Episode 3: Kubernetes and Big Data Services
Episode 3: Kubernetes and Big Data ServicesEpisode 3: Kubernetes and Big Data Services
Episode 3: Kubernetes and Big Data Services
 
Episode 2: Deploying Kubernetes at Scale
Episode 2: Deploying Kubernetes at ScaleEpisode 2: Deploying Kubernetes at Scale
Episode 2: Deploying Kubernetes at Scale
 
Episode 1: Building Kubernetes-as-a-Service
Episode 1: Building Kubernetes-as-a-ServiceEpisode 1: Building Kubernetes-as-a-Service
Episode 1: Building Kubernetes-as-a-Service
 
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
 
Webinar: What's New in DC/OS 1.11
Webinar: What's New in DC/OS 1.11Webinar: What's New in DC/OS 1.11
Webinar: What's New in DC/OS 1.11
 
Webinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OSWebinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OS
 
Webinar: Operating Kubernetes at Scale
Webinar: Operating Kubernetes at ScaleWebinar: Operating Kubernetes at Scale
Webinar: Operating Kubernetes at Scale
 
Webinar: Déployez facilement Kubernetes & vos containers
Webinar: Déployez facilement Kubernetes & vos containersWebinar: Déployez facilement Kubernetes & vos containers
Webinar: Déployez facilement Kubernetes & vos containers
 
Webinar: Deep Learning Pipelines Beyond the Learning
Webinar: Deep Learning Pipelines Beyond the LearningWebinar: Deep Learning Pipelines Beyond the Learning
Webinar: Deep Learning Pipelines Beyond the Learning
 
Running Distributed TensorFlow with GPUs on Mesos with DC/OS
Running Distributed TensorFlow with GPUs on Mesos with DC/OS Running Distributed TensorFlow with GPUs on Mesos with DC/OS
Running Distributed TensorFlow with GPUs on Mesos with DC/OS
 
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
Manage Microservices & Fast Data Systems on One Platform w/ DC/OSManage Microservices & Fast Data Systems on One Platform w/ DC/OS
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
 
Jolt: Distributed, fault-tolerant test running at scale using Mesos
Jolt: Distributed, fault-tolerant test running at scale using MesosJolt: Distributed, fault-tolerant test running at scale using Mesos
Jolt: Distributed, fault-tolerant test running at scale using Mesos
 
Deploying Kong with Mesosphere DC/OS
Deploying Kong with Mesosphere DC/OSDeploying Kong with Mesosphere DC/OS
Deploying Kong with Mesosphere DC/OS
 
Tech Preview: Kubernetes on Mesosphere DC/OS 1.10
Tech Preview: Kubernetes on Mesosphere DC/OS 1.10Tech Preview: Kubernetes on Mesosphere DC/OS 1.10
Tech Preview: Kubernetes on Mesosphere DC/OS 1.10
 
Discover the all new Mesosphere DC/OS 1.10
Discover the all new Mesosphere DC/OS 1.10Discover the all new Mesosphere DC/OS 1.10
Discover the all new Mesosphere DC/OS 1.10
 
Growing the Mesos Ecosystem
Growing the Mesos EcosystemGrowing the Mesos Ecosystem
Growing the Mesos Ecosystem
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Mesos framework API v1

  • 1. M E S O S F R A M E W O R K A P I V 1 @ v i n o d k o n e
  • 2. M E S O S A P I S S c h e d u l e r M a s t e r A g e n t E x e c u t o r Scheduler API Executor API Internal API Operator API Framework API
  • 3. N E T W O R K I N G C O N S T R A I N T S S c h e d u l e r M a s t e r Firewall Containers :( Network partitions :(
  • 4. D E P E N D E N C E O N N A T I V E L I B R A R Y S c h e d u l e r M a s t e rJ a v a L i b r a r y N a t i v e L i b r a r y mesos.jar libmesos.so Hard to debug Not portable Un-needed dependencies
  • 5. U N D O C U M E N T E D F R A M E W O R K A P I POST /master/mesos.internal.LaunchTasksMessage HTTP/1.1 User-Agent: libprocess/scheduler-1234-23-23342@127.0.0.1:8081 Libprocess-From: scheduler-1234-23-23342@127.0.0.1:8081 Connection: Keep-Alive Host: Transfer-Encoding: chunked LIBPROCESS_IP LIBPROCESS_ADVERTISE_IP
  • 6. L A C K O F A P I V E R S I O N I N G S c h e d u l e r M a s t e r Version YDriver version X Compatible?
  • 7. H A R D T O E V O L V E T H E A P I Lot of boiler plate to expose new API objects Adding new features breaks the API Maintenance API?
  • 8. – H A R V E Y D E N T “You either die a hero… or live long enough to see yourself become the villain” replaced by a better API
  • 9. F R A M E W O R K A P I V 1 G O A L S API versioning Easy to evolve API Well documented Allow pure language client libraries Work inside firewalls / containers
  • 10. F R A M E W O R K A P I V 1 • Calls and Events as building blocks • Schema: v1/scheduler.proto and v1/executor.proto • Versioned API endpoints • master: /api/v1/scheduler • agent: /api/v1/executor
  • 11. C A L L S Old API S U B S C R I B E start() T E A R D O W N stop() A C C E P T acceptOffers() D E C L I N E declineOffer() R E V I V E reviveOffers() K I L L killTask() S H U T D O W N * Shutdown executor * A C K N O W L E D G E acknowledgeStatusUpdate() R E C O N C I L E reconcileTasks() M E S S A G E sendFrameworkMessage() R E Q U E S T requestResources() S U P P R E S S suppressOffers()
  • 12. E V E N T S Old API S U B S C R I B E D registered() / reregistered() O F F E R S resourceOffers() R E S C I N D offerRescinded() U P D A T E statusUpdate() M E S S A G E frameworkMessage() F A I L U R E slaveLost() / executorLost() E R R O R error() H E A R T B E A T * Periodic heartbeats *
  • 13. P R O T O C O L • HTTP 1.1 • Scheduler/Executor opens connections to the master/agent • A persistent connection to receive Events • One (or more) connection(s) to send Calls
  • 14. P R O T O C O L • Every call is a HTTP POST request • Content-Type: application/json or application/x-protobuf • SUBSCRIBE call results in a “200 OK” streaming response • Record-IO formatted events • “Mesos-Stream-Id” header • All successful non-SUBSCRIBE calls result in “202 Accepted” • Must include “Mesos-Stream-Id" header
  • 15. S U B S C R I P T I O N R E Q U E S T POST /api/v1/scheduler HTTP/1.1 Host: masterhost:5050 Content-Type: application/json Accept: application/json Connection: close { “type” : “SUBSCRIBE”, “subscribe” : { “framework_info” : { “user” : “foo”, “name” : “Example HTTP Framework” }, } }
  • 16. S U B S C R I P T I O N R E S P O N S E HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af <event length> { “type” : “SUBSCRIBED”, “subscribed” : { “framework_id” : {“value”:“12220-3440-12532-2345”}, “heartbeat_interval_seconds” : 15 } } <more events>
  • 17. K I L L POST /api/v1/scheduler HTTP/1.1 Host: masterhost:5050 Content-Type: application/son Accept: application/json Connection: close Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af { “framework_id” : {“value” : “12220-3440-12532-2345”}, “type” : “KILL”, “kill” : { “task_id” : {“value” : “12220-3440-12532-my-task”}, “agent_id” : {“value” : “12220-3440-12532-S123345”} } } Response: HTTP/1.1 202 Accepted
  • 18. D I S C O N N E C T I O N S & P A R T I T I O N S • Master tracks the persistent subscription connection • Scheduler can reconnect within failover timeout • Assigns stream IDs to uniquely identify streams • Periodic HEARTBEATs sent by master • Scheduler can reconnect if no HEARTBEATs
  • 19. V E R S I O N I N G Explicit Simple Avoid version explosion /api/v1/scheduler /api/v1/executor
  • 20. A P I V E R S I O N V S R E L E A S E V E R S I O N • API version == Major release version • v1 API supported by 1.0.0, 1.4.0, 1.20.0 • vN API released in N-1 release version • vN API considered stable in the last N-1 release • Version bumping • Major/API version bumped for backwards incompatible changes (> yearly) • Minor version bumped regularly (4-8 weeks)
  • 21. S C H E D U L E R A P I V 1 S T A T U S • 0.28.0: More API changes (Use this version!) • 0.24.0: MVP • Experimental: Use in testing clusters only • Schema: v1/scheduler/scheduler.proto • Documentation: http://mesos.apache.org/documentation/latest/scheduler-http-api/ • Reference implementation • C++ library: https://github.com/apache/mesos/blob/master/src/scheduler/scheduler.cpp • C++ scheduler: https://github.com/apache/mesos/blob/master/src/examples/test_http_framework.cp p
  • 22. E X E C U T O R A P I V 1 S T A T U S • 0.28.0: MVP • Experimental: Use in testing clusters only • Schema: v1/executor/executor.proto • Documentation: http://mesos.apache.org/documentation/latest/executor-http- api/ • Reference implementation • C++ library: https://github.com/apache/mesos/blob/master/src/executor/executor.cpp • C++ executor: https://github.com/apache/mesos/blob/master/src/examples/test_http_execut or.cpp
  • 23. T O D O • Authentication support • Encryption support • Rate limiting support • Scheduler <—> Executor message optimization
  • 24. T H A N K Y O U Questions?