SlideShare una empresa de Scribd logo
1 de 20
Yahoo!
Joshua Harlow
TaskFlow
and
OpenStack
HP
Min Pae
● Joshua Harlow
○ Yahoo! dev. for ~7 years
○ OpenStack dev. for ~3.5 years
○ Master Trouble-maker
○ Oslo, kazoo, anvil, taskflow, cloudinit… more …
● Min Pae
○ HP dev. for ~7 months
○ OpenStack dev. for ~7 months
○ Lead spell checker
○ Cue, taskflow, automaton… period ...
Who are we
- Distributed systems are complex
- Scale out, resumption, resilency, HA, visibility
into active work … are not easily solveable
problems (some learn this the hard way)
- Understanding your states and workflows (and
managing, transitioning and running) is key to
solving many of these complex problems
The problem
- Declarative workflows
- Persisted execution state (checkpoints)
- Automatic migration of workflows/jobs
- Horizontal scalability
- Magic!
Taskflow does ...
- Atom (task and retry execution units)
- Flow (composition unit)
- Engine (work execution <-> persistence)
- Job / Jobboard (work discovery/ownership unit)
- Conductor (‘conducts’ automated
discovery/ownership, flow construction and
execution)
Taskflow is ...
- Execution unit
- Has
- dependencies (“requires”)
- data (“provides”)
- Defines
- execute(...) - business logic
- revert(...) - exception handler
Taskflow - Atom:Task
class TakeABottleDown(task.Task):
def execute(self, bottles_left):
sys.stdout.write('Take one down, ')
sys.stdout.flush()
time.sleep(TAKE_DOWN_DELAY)
return bottles_left - 1
def revert(self, **kwargs):
…
class PassItAround(task.Task):
…
class Conclusion(task.Task):
...
- Controls retry semantics of
associated flow (and subflows and
…)
- Has
- dependencies (“requires”)
- data (“provides”)
- Defines
- execute(...) - business logic
- revert(...) - exception handler
- on_failure(...) - decision maker
that affects retry semantics
Taskflow - Atom:Retry
class Retry1(retry.Retry):
def execute(self, param1):
print param1
return param1 + ‘ printed’
def revert(self, **kwargs)
print “reverting...”
def on_failure(self, **kwargs):
if self.attempts < 5:
return retry.RETRY
else:
return retry.REVERT_ALL
- Composition of Tasks
- Defines transitions between Tasks
- Allows implicit and explicit
dependencies
- Required methods(?)
- add(...) - add (and link) task(s),
flow(s)
- iter_links(...) - iterator over the
created links (links are created
during add)
Taskflow - Flow
s = linear_flow.Flow(‘bottle-song’)
take_bottle = TakeABottleDown(...)
pass_it = PassItAround(...)
next_bottles = Conclusion(...)
s.add(take_bottle, pass_it, next_bottles)
- Run flows (and associated tasks) to completion
- Decompose flows into a DAG
- Edge dependencies mandated by flow(s)
patterns are always retained
- Prepare persistence layer
- Run tasks/retries as they are ready
- Optionally in parallel (and/or remotely)...
- Save and fetch results from persistence layer
and run next tasks/retries (and repeat)
- State machine based:
- http://docs.openstack.org/developer/taskflow/st
ates.html#engine
Taskflow - Engines(s)
- Place where work can be placed by producer
entities and consumed/owned (and worked on) by
other consumer entities
- Similar to a job queue but builds in liveness
semantics/capabilities (and semantics expect single
ownership via a claim concept)
- If a owner of a unit of work dies, the claim on the
work they are performing is automatically lost and
freed up for others
- Typically tied to a unit of work (being a flow) and its
optional persistence location (so that prior work can
be resumed)
Taskflow - Job(s) & Jobboard(s)
● Essentially an advanced/specialized job processor
- Connects to a jobboard
- Periodically fetches contents of jobboard
- Attempts to claim a job
- Constructs jobs work (flow, other...)
- Performs jobs work (using engines of various
types and persistence backends to enable
reliablility)
- Removes job (on completion)
- (rinse and repeat)
● Expected to be scaled out (run as many conductors
as needed/desired)
Taskflow - Conductor
Why would u want this?
- Jobs and Jobboards provide work ownership and
work discovery
- Horizontal scaling via conductors
- Automatic migration of work between conductors
- Persistence of execution state enable resumption
and automated ownership transfer
- When a conductor fails, job(s) in progress is
picked up (and resumed to last checkpoint) by the
next worker that frees up, no need to wait for the
worker to come back.
- Turn your software off safely and handle failures
gracefully!
Wherefore Taskflow?
- Declarative definition of work
- Decouples what (Task, Flow) from how (Engine)
- Coroutines are not separable from the
surrounding code, and can not be automatically
parallelized
- Separation of declaration and execution allows
flexibility in execution strategy
- Engine tracks execution state and transitions
- Parallel (green)threaded execution…
- Remote worker execution…
Wherefore Taskflow? (cont.)
- Not strongly tied into python as a language (for
better or worse); concepts are easily transferable to
java/go/….
- Alacarte: use what you want
- Use the basics until you are ready to use
jobboards, or select a local engine until you are
ready to run remote workers…
Wherefore Taskflow? (cont.)
Wherefore Taskflow? (cont.)
Notifications
Remote task workers
Dynamic flow modification
Real time dashboard of atom/flow/job transitions (WIP)
Applications that can be paused
DDOS your favorite site (joke)
The potential is nearly limitless!!
Wherefore Taskflow? (cont.)
DEMO
?? Questions ??
- High level (overview)
- https://wiki.openstack.org/wiki/TaskFlow
- https://wiki.openstack.org/wiki/TaskFlow#Big_picture
- Developer oriented (more detail)
- http://docs.openstack.org/developer/taskflow/
- Extreme!! developer oriented (ultra detail)
- Freenode
- #openstack-state-management
- #openstack-oslo
- ML: openstack-dev@lists.openstack.org
- Moar examples!
More information!

Más contenido relacionado

Similar a TaskFlow Y! + HP brownbag

Apache Spark at Viadeo
Apache Spark at ViadeoApache Spark at Viadeo
Apache Spark at ViadeoCepoi Eugen
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipseanshunjain
 
Airflow tutorials hands_on
Airflow tutorials hands_onAirflow tutorials hands_on
Airflow tutorials hands_onpko89403
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentationIlias Okacha
 
U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)Michael Rys
 
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Skilld
 
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Holden Karau
 
Parallel programming
Parallel programmingParallel programming
Parallel programmingSwain Loda
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINEKafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINEkawamuray
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And DesignYaroslav Tkachenko
 
Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model examIndhujeni
 
The dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetupThe dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetupkrivachy
 
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container DayQuantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container DayPhil Estes
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 

Similar a TaskFlow Y! + HP brownbag (20)

Apache Spark at Viadeo
Apache Spark at ViadeoApache Spark at Viadeo
Apache Spark at Viadeo
 
Microservices in Clojure
Microservices in ClojureMicroservices in Clojure
Microservices in Clojure
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
Airflow tutorials hands_on
Airflow tutorials hands_onAirflow tutorials hands_on
Airflow tutorials hands_on
 
PostgreSQL Prologue
PostgreSQL ProloguePostgreSQL Prologue
PostgreSQL Prologue
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentation
 
U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)U-SQL Query Execution and Performance Basics (SQLBits 2016)
U-SQL Query Execution and Performance Basics (SQLBits 2016)
 
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
 
Loom and concurrency latest
Loom and concurrency latestLoom and concurrency latest
Loom and concurrency latest
 
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
 
Parallel programming
Parallel programmingParallel programming
Parallel programming
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINEKafka meetup JP #3 - Engineering Apache Kafka at LINE
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And Design
 
Big data unit iv and v lecture notes qb model exam
Big data unit iv and v lecture notes   qb model examBig data unit iv and v lecture notes   qb model exam
Big data unit iv and v lecture notes qb model exam
 
The dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetupThe dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetup
 
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container DayQuantifying Container Runtime Performance: OSCON 2017 Open Container Day
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 

Último

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

TaskFlow Y! + HP brownbag

  • 2. ● Joshua Harlow ○ Yahoo! dev. for ~7 years ○ OpenStack dev. for ~3.5 years ○ Master Trouble-maker ○ Oslo, kazoo, anvil, taskflow, cloudinit… more … ● Min Pae ○ HP dev. for ~7 months ○ OpenStack dev. for ~7 months ○ Lead spell checker ○ Cue, taskflow, automaton… period ... Who are we
  • 3. - Distributed systems are complex - Scale out, resumption, resilency, HA, visibility into active work … are not easily solveable problems (some learn this the hard way) - Understanding your states and workflows (and managing, transitioning and running) is key to solving many of these complex problems The problem
  • 4. - Declarative workflows - Persisted execution state (checkpoints) - Automatic migration of workflows/jobs - Horizontal scalability - Magic! Taskflow does ...
  • 5. - Atom (task and retry execution units) - Flow (composition unit) - Engine (work execution <-> persistence) - Job / Jobboard (work discovery/ownership unit) - Conductor (‘conducts’ automated discovery/ownership, flow construction and execution) Taskflow is ...
  • 6. - Execution unit - Has - dependencies (“requires”) - data (“provides”) - Defines - execute(...) - business logic - revert(...) - exception handler Taskflow - Atom:Task class TakeABottleDown(task.Task): def execute(self, bottles_left): sys.stdout.write('Take one down, ') sys.stdout.flush() time.sleep(TAKE_DOWN_DELAY) return bottles_left - 1 def revert(self, **kwargs): … class PassItAround(task.Task): … class Conclusion(task.Task): ...
  • 7. - Controls retry semantics of associated flow (and subflows and …) - Has - dependencies (“requires”) - data (“provides”) - Defines - execute(...) - business logic - revert(...) - exception handler - on_failure(...) - decision maker that affects retry semantics Taskflow - Atom:Retry class Retry1(retry.Retry): def execute(self, param1): print param1 return param1 + ‘ printed’ def revert(self, **kwargs) print “reverting...” def on_failure(self, **kwargs): if self.attempts < 5: return retry.RETRY else: return retry.REVERT_ALL
  • 8. - Composition of Tasks - Defines transitions between Tasks - Allows implicit and explicit dependencies - Required methods(?) - add(...) - add (and link) task(s), flow(s) - iter_links(...) - iterator over the created links (links are created during add) Taskflow - Flow s = linear_flow.Flow(‘bottle-song’) take_bottle = TakeABottleDown(...) pass_it = PassItAround(...) next_bottles = Conclusion(...) s.add(take_bottle, pass_it, next_bottles)
  • 9. - Run flows (and associated tasks) to completion - Decompose flows into a DAG - Edge dependencies mandated by flow(s) patterns are always retained - Prepare persistence layer - Run tasks/retries as they are ready - Optionally in parallel (and/or remotely)... - Save and fetch results from persistence layer and run next tasks/retries (and repeat) - State machine based: - http://docs.openstack.org/developer/taskflow/st ates.html#engine Taskflow - Engines(s)
  • 10. - Place where work can be placed by producer entities and consumed/owned (and worked on) by other consumer entities - Similar to a job queue but builds in liveness semantics/capabilities (and semantics expect single ownership via a claim concept) - If a owner of a unit of work dies, the claim on the work they are performing is automatically lost and freed up for others - Typically tied to a unit of work (being a flow) and its optional persistence location (so that prior work can be resumed) Taskflow - Job(s) & Jobboard(s)
  • 11. ● Essentially an advanced/specialized job processor - Connects to a jobboard - Periodically fetches contents of jobboard - Attempts to claim a job - Constructs jobs work (flow, other...) - Performs jobs work (using engines of various types and persistence backends to enable reliablility) - Removes job (on completion) - (rinse and repeat) ● Expected to be scaled out (run as many conductors as needed/desired) Taskflow - Conductor
  • 12. Why would u want this?
  • 13. - Jobs and Jobboards provide work ownership and work discovery - Horizontal scaling via conductors - Automatic migration of work between conductors - Persistence of execution state enable resumption and automated ownership transfer - When a conductor fails, job(s) in progress is picked up (and resumed to last checkpoint) by the next worker that frees up, no need to wait for the worker to come back. - Turn your software off safely and handle failures gracefully! Wherefore Taskflow?
  • 14. - Declarative definition of work - Decouples what (Task, Flow) from how (Engine) - Coroutines are not separable from the surrounding code, and can not be automatically parallelized - Separation of declaration and execution allows flexibility in execution strategy - Engine tracks execution state and transitions - Parallel (green)threaded execution… - Remote worker execution… Wherefore Taskflow? (cont.)
  • 15. - Not strongly tied into python as a language (for better or worse); concepts are easily transferable to java/go/…. - Alacarte: use what you want - Use the basics until you are ready to use jobboards, or select a local engine until you are ready to run remote workers… Wherefore Taskflow? (cont.)
  • 17. Notifications Remote task workers Dynamic flow modification Real time dashboard of atom/flow/job transitions (WIP) Applications that can be paused DDOS your favorite site (joke) The potential is nearly limitless!! Wherefore Taskflow? (cont.)
  • 18. DEMO
  • 20. - High level (overview) - https://wiki.openstack.org/wiki/TaskFlow - https://wiki.openstack.org/wiki/TaskFlow#Big_picture - Developer oriented (more detail) - http://docs.openstack.org/developer/taskflow/ - Extreme!! developer oriented (ultra detail) - Freenode - #openstack-state-management - #openstack-oslo - ML: openstack-dev@lists.openstack.org - Moar examples! More information!