M E S O S 1 . 0
Vi n o d K o n e ( v i n o d @ m e s o s p h e re . c o m )
A n a n d M a z u m d a r ( a n a n d @ m e s o s p h e re . c o m )
W H A T ’ S I N 1 . 0 ?
New APIs
Agent rename
Unified Containerizer
GPUs
Windows
Dynamic weights
Release policy
CNIXFS
Fine-grained AuthZ
W H Y 1 . 0 ?
• Versioned and documented APIs
• Formal release and upgrade policy
• Improved security features
W H E N ?
• 1.0.0 -RC1 is out
• Please test it and vote it!
• Official release will be end of June’16
• 2-3 weeks for vetting the RC(s)
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
Framework API
Master API Agent API
O p e r a t o r O p e r a t o r
Operator API
Internal API
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
P R O T O C O L
• HTTP 1.1
• Based on Calls & Events
• Client opens connections to
the master/agent
• One (or more) connection(s)
to send Calls
• A persistent connection to
receive Events
F R A M E W O R K P R O T O C O L
• Every call is a HTTP POST request
• Content-Type: application/json or application/x-protobuf
• Successful SUBSCRIBE call results in a “200 OK” streaming response
• Record-IO formatted events
• Persistent connection
• “Mesos-Stream-Id” header (schedulers only)
• All successful non-SUBSCRIBE calls result in “202 Accepted”
• Must include “Mesos-Stream-Id" header (schedulers only)
W O R K F L O W
S c h e d u l e r M a s t e r
SUBSCRIBE
POST /api/v1/scheduler HTTP/1.1
{
"type" : "SUBSCRIBE",
"subscribe" : {
"framework_info" : {
"user" : "foo",
"name" : "Example HTTP Framework"
}
}
}
W O R K F L O W
SUBSCRIBE
S c h e d u l e r M a s t e r
SUBSCRIBE
W O R K F L O W
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>
<more events>
SUBSCRIBE
Streaming Response
M a s t e rS c h e d u l e r
W O R K F L O W
S c h e d u l e r M a s t e r
Offers Event
<event-length>
{
"type" : "OFFERS",
"offers" : [
{
"offer_id":{"value": "12214-23523-O235235"},
"framework_id":{"value": "12124-235325-32425"},
"agent_id":{"value": "12325-23523-S23523"},
"hostname":"agent.host",
"resources":[...],
"attributes":[...],
"executor_ids":[]
}
]
}
A g e n t
W O R K F L O W
S c h e d u l e r M a s t e r
ACCEPT
POST /api/v1/scheduler HTTP/1.1
Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
{
"framework_id" : {"value" : "12220-3440-12532-2345"},
"type" : "ACCEPT",
"accept" : {
"offer_ids" : [
{"value" : "12220-3440-12532-O12"},
{"value" : "12220-3440-12532-O12"}
],
"operations" : [ {"type" : "LAUNCH", "launch" : {...}} ],
"filters" : {...}
}
}
A g e n t
S c h e d u l e r M a s t e r
W O R K F L O W
ACCEPT
Response
HTTP/1.1 202 Accepted
A g e n t
W O R K F L O W
S c h e d u l e r M a s t e r
ACCEPT
Launch Task
A g e n t
W O R K F L O W
S c h e d u l e r M a s t e r
Launch Task
E x e c u t o r
SUBSCRIBE
A g e n t
ACCEPT
W O R K F L O W
S c h e d u l e r M a s t e r
E x e c u t o r
SUBSCRIBE
POST /api/v1/executor HTTP/1.1
{
"type": "SUBSCRIBE",
"executor_id": {
"value": "387aa966-8fc5-4428-a794-5a868a60d3eb"
},
"framework_id": {
"value": "49154f1b-8cf6-4421-bf13-8bd11dccd1f1"
}
}
A g e n t
W O R K F L O W
S c h e d u l e r
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
<event length>
{
"type" : "SUBSCRIBED",
"subscribed" : {…}
}
<more events>
Streaming Response
S c h e d u l e r M a s t e r
E x e c u t o r A g e n tE x e c u t o r
SUBSCRIBE
W O R K F L O W
S c h e d u l e r
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
<event-length>
{
"type": "LAUNCH",
"launch": (…)
}
<more events>
Launch Event
S c h e d u l e r M a s t e r
E x e c u t o r A g e n tE x e c u t o r
S C H E D U L E R D I S C O N N E C T I O N S &
PA R T I T I O N S
• Master tracks the persistent subscription connection
• Reconnect within framework failover timeout
• Periodic HEARTBEAT events sent by master
• If the scheduler does not receive a bunch of them within
a time window, disconnect and trigger reconnection
O P E R A T O R V 1 A P I
• Similar to Framework API
• Endpoint: /api/v1
• Calls, Responses and Events
• Streaming support!
• Subscribe to events happening on the cluster e.g., status updates
etc.
W O R K F L O W
O p e r a t o r M a s t e r
GET_VERSION
POST /api/v1/ HTTP/1.1
Host: masterhost:5050
Content-Type: application/json
{
“type” : “GET_VERSION”
}
O p e r a t o r M a s t e r
GET_VERSION
HTTP/1.1 200 OK
{
“type” : “VERSION”,
“version”¹ : {
“version” : “1.0.0”
}
}
W O R K F L O W
Response
W O R K F L O W
O p e r a t o r M a s t e r
SUBSCRIBE
POST /api/v1/ HTTP/1.1
Host: masterhost:5050
Content-Type: application/json
{
“type” : “SUBSCRIBE”
}
W O R K F L O W
O p e r a t o r M a s t e r
SUBSCRIBE
Streaming Response
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
<event length>{
"type" : "UPDATE",
"update" : {
"status" : {
"task_id" : { "value" : "12344-my-task"},
"state" : "TASK_RUNNING",
"source" : "SOURCE_EXECUTOR",
"uuid" : "adfadfadbhgvjayd23r2uahj",
"bytes" : "uhdjfhuagdj63d7hadkf"
}
}
}<more events>
<more events>
S C H E D U L E R A P I V 1 S TA T U S
• API is stable today!
• Ready to use
• Documentation: http://mesos.apache.org/documentation/latest/
scheduler-http-api/
• Scheduler libraries
• C++: https://github.com/apache/mesos/blob/master/src/
scheduler/scheduler.cpp
• Java: https://github.com/mesosphere/mesos-rxjava
• Go: https://github.com/mesos/mesos-go
E X E C U T O R A P I V 1 S TA T U S
• API is stable today!
• Ready to use
• Documentation: http://mesos.apache.org/documentation/latest/executor-
http-api/
• Executor libraries
• C++: https://github.com/apache/mesos/blob/master/src/executor/
executor.cpp
• Java: https://github.com/mesosphere/mesos-rxjava
• Go: https://github.com/mesos/mesos-go
O P E R A T O R A P I V 1 S TA T U S
• API will be stable by 1.0!
• Implementation is in progress
• MVP will be ready by 1.0
• Streaming support!
http://mesos.apache.org/documentation/latest/versioning/
R E L E A S E P O L I C Y
• New release every 2 months
• Supported for 6 months
• Patch releases every month
• Release branches to ease back ports
U P G R A D E P O L I C Y
• Upgrade from any minor version to any minor version!
• 1.2 —> 1.8 (no need to go through 1.3 to 1.7)
• Caveat: Doesn’t apply to deprecated features
• Deprecation period for a feature is 6 months
P H A S E 1 : C O M P L E T E
• v1 APIs
• New binary (mesos-agent)
• New flags (e.g., —agent_registration_timeout)
• Web UI
• Documentation
• Website
W E B U I S C R E E N S H O T
P H A S E 2 : I N T E R N A L
• Comments
• Module APIs and Hooks
• Internal APIs and classes
W H A T ’ S N E X T ?
M a s t e r A g e n t
HTTP Internal API
W H A T ’ S N E X T ?
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
/api/v1/scheduler /api/v1/executor
/api/v1/agent
/api/v1 /api/v1
O p e r a t o r O p e r a t o r
U N I F I E D A P I
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
/api/v2 /api/v2
/api/v2
/api/v2 /api/v2
O p e r a t o r O p e r a t o r
T H A N K Y O U
1 . 0 . 0 - R C 1

Mesos 1.0

  • 1.
    M E SO S 1 . 0 Vi n o d K o n e ( v i n o d @ m e s o s p h e re . c o m ) A n a n d M a z u m d a r ( a n a n d @ m e s o s p h e re . c o m )
  • 2.
    W H AT ’ S I N 1 . 0 ? New APIs Agent rename Unified Containerizer GPUs Windows Dynamic weights Release policy CNIXFS Fine-grained AuthZ
  • 3.
    W H Y1 . 0 ? • Versioned and documented APIs • Formal release and upgrade policy • Improved security features
  • 4.
    W H EN ? • 1.0.0 -RC1 is out • Please test it and vote it! • Official release will be end of June’16 • 2-3 weeks for vetting the RC(s)
  • 5.
    M E SO 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 Framework API Master API Agent API O p e r a t o r O p e r a t o r Operator API Internal API
  • 6.
    A P IV 1 G O A L S API versioning Easy to evolve API Well documented Allow pure language client libraries Work inside firewalls / containers
  • 7.
    P R OT O C O L • HTTP 1.1 • Based on Calls & Events • Client opens connections to the master/agent • One (or more) connection(s) to send Calls • A persistent connection to receive Events
  • 8.
    F R AM E W O R K P R O T O C O L • Every call is a HTTP POST request • Content-Type: application/json or application/x-protobuf • Successful SUBSCRIBE call results in a “200 OK” streaming response • Record-IO formatted events • Persistent connection • “Mesos-Stream-Id” header (schedulers only) • All successful non-SUBSCRIBE calls result in “202 Accepted” • Must include “Mesos-Stream-Id" header (schedulers only)
  • 9.
    W O RK F L O W S c h e d u l e r M a s t e r SUBSCRIBE
  • 10.
    POST /api/v1/scheduler HTTP/1.1 { "type": "SUBSCRIBE", "subscribe" : { "framework_info" : { "user" : "foo", "name" : "Example HTTP Framework" } } } W O R K F L O W SUBSCRIBE S c h e d u l e r M a s t e r SUBSCRIBE
  • 11.
    W O RK F L O W 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> <more events> SUBSCRIBE Streaming Response M a s t e rS c h e d u l e r
  • 12.
    W O RK F L O W S c h e d u l e r M a s t e r Offers Event <event-length> { "type" : "OFFERS", "offers" : [ { "offer_id":{"value": "12214-23523-O235235"}, "framework_id":{"value": "12124-235325-32425"}, "agent_id":{"value": "12325-23523-S23523"}, "hostname":"agent.host", "resources":[...], "attributes":[...], "executor_ids":[] } ] } A g e n t
  • 13.
    W O RK F L O W S c h e d u l e r M a s t e r ACCEPT POST /api/v1/scheduler HTTP/1.1 Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af { "framework_id" : {"value" : "12220-3440-12532-2345"}, "type" : "ACCEPT", "accept" : { "offer_ids" : [ {"value" : "12220-3440-12532-O12"}, {"value" : "12220-3440-12532-O12"} ], "operations" : [ {"type" : "LAUNCH", "launch" : {...}} ], "filters" : {...} } } A g e n t
  • 14.
    S c he d u l e r M a s t e r W O R K F L O W ACCEPT Response HTTP/1.1 202 Accepted A g e n t
  • 15.
    W O RK F L O W S c h e d u l e r M a s t e r ACCEPT Launch Task A g e n t
  • 16.
    W O RK F L O W S c h e d u l e r M a s t e r Launch Task E x e c u t o r SUBSCRIBE A g e n t ACCEPT
  • 17.
    W O RK F L O W S c h e d u l e r M a s t e r E x e c u t o r SUBSCRIBE POST /api/v1/executor HTTP/1.1 { "type": "SUBSCRIBE", "executor_id": { "value": "387aa966-8fc5-4428-a794-5a868a60d3eb" }, "framework_id": { "value": "49154f1b-8cf6-4421-bf13-8bd11dccd1f1" } } A g e n t
  • 18.
    W O RK F L O W S c h e d u l e r HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked <event length> { "type" : "SUBSCRIBED", "subscribed" : {…} } <more events> Streaming Response S c h e d u l e r M a s t e r E x e c u t o r A g e n tE x e c u t o r SUBSCRIBE
  • 19.
    W O RK F L O W S c h e d u l e r HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked <event-length> { "type": "LAUNCH", "launch": (…) } <more events> Launch Event S c h e d u l e r M a s t e r E x e c u t o r A g e n tE x e c u t o r
  • 20.
    S C HE D U L E R D I S C O N N E C T I O N S & PA R T I T I O N S • Master tracks the persistent subscription connection • Reconnect within framework failover timeout • Periodic HEARTBEAT events sent by master • If the scheduler does not receive a bunch of them within a time window, disconnect and trigger reconnection
  • 21.
    O P ER A T O R V 1 A P I • Similar to Framework API • Endpoint: /api/v1 • Calls, Responses and Events • Streaming support! • Subscribe to events happening on the cluster e.g., status updates etc.
  • 22.
    W O RK F L O W O p e r a t o r M a s t e r GET_VERSION POST /api/v1/ HTTP/1.1 Host: masterhost:5050 Content-Type: application/json { “type” : “GET_VERSION” }
  • 23.
    O p er a t o r M a s t e r GET_VERSION HTTP/1.1 200 OK { “type” : “VERSION”, “version”¹ : { “version” : “1.0.0” } } W O R K F L O W Response
  • 24.
    W O RK F L O W O p e r a t o r M a s t e r SUBSCRIBE POST /api/v1/ HTTP/1.1 Host: masterhost:5050 Content-Type: application/json { “type” : “SUBSCRIBE” }
  • 25.
    W O RK F L O W O p e r a t o r M a s t e r SUBSCRIBE Streaming Response HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked <event length>{ "type" : "UPDATE", "update" : { "status" : { "task_id" : { "value" : "12344-my-task"}, "state" : "TASK_RUNNING", "source" : "SOURCE_EXECUTOR", "uuid" : "adfadfadbhgvjayd23r2uahj", "bytes" : "uhdjfhuagdj63d7hadkf" } } }<more events> <more events>
  • 26.
    S C HE D U L E R A P I V 1 S TA T U S • API is stable today! • Ready to use • Documentation: http://mesos.apache.org/documentation/latest/ scheduler-http-api/ • Scheduler libraries • C++: https://github.com/apache/mesos/blob/master/src/ scheduler/scheduler.cpp • Java: https://github.com/mesosphere/mesos-rxjava • Go: https://github.com/mesos/mesos-go
  • 27.
    E X EC U T O R A P I V 1 S TA T U S • API is stable today! • Ready to use • Documentation: http://mesos.apache.org/documentation/latest/executor- http-api/ • Executor libraries • C++: https://github.com/apache/mesos/blob/master/src/executor/ executor.cpp • Java: https://github.com/mesosphere/mesos-rxjava • Go: https://github.com/mesos/mesos-go
  • 28.
    O P ER A T O R A P I V 1 S TA T U S • API will be stable by 1.0! • Implementation is in progress • MVP will be ready by 1.0 • Streaming support!
  • 29.
  • 30.
    R E LE A S E P O L I C Y • New release every 2 months • Supported for 6 months • Patch releases every month • Release branches to ease back ports
  • 31.
    U P GR A D E P O L I C Y • Upgrade from any minor version to any minor version! • 1.2 —> 1.8 (no need to go through 1.3 to 1.7) • Caveat: Doesn’t apply to deprecated features • Deprecation period for a feature is 6 months
  • 33.
    P H AS E 1 : C O M P L E T E • v1 APIs • New binary (mesos-agent) • New flags (e.g., —agent_registration_timeout) • Web UI • Documentation • Website
  • 34.
    W E BU I S C R E E N S H O T
  • 35.
    P H AS E 2 : I N T E R N A L • Comments • Module APIs and Hooks • Internal APIs and classes
  • 36.
    W H AT ’ S N E X T ? M a s t e r A g e n t HTTP Internal API
  • 37.
    W H AT ’ S N E X T ? 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 /api/v1/scheduler /api/v1/executor /api/v1/agent /api/v1 /api/v1 O p e r a t o r O p e r a t o r
  • 38.
    U N IF I E D A P I 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 /api/v2 /api/v2 /api/v2 /api/v2 /api/v2 O p e r a t o r O p e r a t o r
  • 39.
    T H AN K Y O U 1 . 0 . 0 - R C 1