Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mesos 1.0 (MesosCon NA 2016)

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Mesos 1.0 (MesosCon NA 2016)

Mesos will soon reach the 1.0 milestone. In addition to new features, this would mean a more stable user-facing API and stricter support/release guarantees for operators/framework developers. The aim of this talk is to apprise the operators/framework developers/users about the new API and also discuss the support/compatibility guarantees offered by Mesos going forward.

This talk is a sequel to the last year’s MesosCon Seattle talk on “Mesos HTTP API” and continues from where it left off.

This talk will cover the following specific topics:
- Discuss the newly introduced Operator APl.
- Update on the recent improvements to the Framework API.
- Update on client libraries for the new Framework API.
- Release cadence for Mesos going forward.
- Support/Compatibility guarantees for operators/framework developers e.g., backporting of patches etc.

Avatar for Anand Mazumdar

Anand Mazumdar

June 01, 2016
Tweet

More Decks by Anand Mazumdar

Other Decks in Technology

Transcript

  1. 1 . 0 Vi n o d K o n

    e ( v i n o d @ m e s o s p h e re . i o ) 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 . i o )
  2. M E S O S 1 . 0 • 1.0

    • Released on July 27th 2016 • Biggest release ever! • 1.0.1 • Released on Aug 24th 2016 • Please use this one!
  3. W H A T ’ S I N 1 .

    0 ? New APIs Agent rename Unified Containerizer GPUs Windows Dynamic weights Release policy CNI XFS Fine-grained AuthZ Docker Volume
  4. W H Y 1 . 0 ? • Versioned and

    documented APIs • Formal release and upgrade policy
  5. 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
  6. A P I V 1 G O A L S

    API versioning Backwards compatible API evolution Allow pure language client libraries Work inside firewalls / containers Well documented
  7. P R O T O C O L • HTTP

    1.1 - RPC based • Based on Calls, Responses and Events • Client opens connections to the master/agent • One (or more) connection(s) to send Calls • A Call might get a Response, stream of Events, or no response
  8. 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 for now) • All successful non-SUBSCRIBE calls result in “202 Accepted” • Must include “Mesos-Stream-Id" header (schedulers only for now)
  9. W O R K 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 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 r S c h e d u l e r
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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 t E x e c u t o r SUBSCRIBE
  19. 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 t E x e c u t o r
  20. 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
  21. O P E R A T O R V 1

    A P I • Similar to Framework API • Some Calls get Responses • Streaming support! • Subscribe to events happening on the cluster e.g., SUBSCRIBED, TASK_ADDED, TASK_UPDATED • SUBSCRIBED includes the snapshot of the state
  22. 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” }
  23. O p e r a t o r M a

    s t e r GET_VERSION HTTP/1.1 200 OK { “type” : “GET_VERSION”, “get_version”¹ : { “version_info” : { “version“ “ 1.0.1” } } } W O R K F L O W Response
  24. 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” }
  25. 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" : “SUBSCRIBED”, “subscribed" : { “get_state" : { “get_tasks” : {} “get_executors” : {} “get_frameworks” : {} “get_agents” : {} } } }<more events>
  26. W O R K F L O W O p

    e r a t o r M a s t e r TASK_ADDED Event <event-length> { "type": "TASK_ADDED", "task_added": { "task": { "name": "dummy-task", "task_id": {"value": "12344-my-task"}, "agent_id": {"value": “1424-32423-S0”}, … } } }<more events>
  27. W O R K F L O W O p

    e r a t o r M a s t e r TASK_UPDATED Event <event length>{ "type" : “TASK_UPDATED”, “task_updated" : { "task_id" : { "value" : “12344-my-task"}, “framework_id" : { "value" : “1144-12-123"}, "agent_id" : { "value" : "1424-32423-S0"}, "state" : "TASK_RUNNING", } }<more events>
  28. A P I S TA T U S • Scheduler

    API & Executor API : Stable • Operator API : Experimental • Client library implementations • http://mesos.apache.org/documentation/latest/ api-client-libraries/
  29. 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
  30. 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
  31. W H A T ’ S N E X T

    ? M a s t e r A g e n t HTTP Internal API
  32. 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
  33. 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
  34. P R O T O C O L • gRPC

    • Auto-generated client libs! • HTTP/2 • Single bi-directional connection!