SlideShare a Scribd company logo
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!

More Related Content

PPTX
Presto Functions
Dain Sundstrom
 
PDF
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
Miles Sabin
 
PDF
Plpgsql russia-pgconf
Pavel Stěhule
 
PDF
Plpgsql internals
Pavel Stěhule
 
PPTX
Nova states summit
Joshua Harlow
 
PPT
Taskflow
Joshua Harlow
 
PPTX
airflowpresentation1-180717183432.pptx
VIJAYAPRABAP
 
PPTX
airflow web UI and CLI.pptx
VIJAYAPRABAP
 
Presto Functions
Dain Sundstrom
 
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
Miles Sabin
 
Plpgsql russia-pgconf
Pavel Stěhule
 
Plpgsql internals
Pavel Stěhule
 
Nova states summit
Joshua Harlow
 
Taskflow
Joshua Harlow
 
airflowpresentation1-180717183432.pptx
VIJAYAPRABAP
 
airflow web UI and CLI.pptx
VIJAYAPRABAP
 

Similar to TaskFlow Y! + HP brownbag (20)

PDF
Apache Spark at Viadeo
Cepoi Eugen
 
PDF
Microservices in Clojure
Lucas Cavalcanti dos Santos
 
PPT
Understanding Framework Architecture using Eclipse
anshunjain
 
PDF
Airflow tutorials hands_on
pko89403
 
PDF
PostgreSQL Prologue
Md. Golam Hossain
 
PDF
Airflow presentation
Ilias Okacha
 
PPTX
U-SQL Query Execution and Performance Basics (SQLBits 2016)
Michael Rys
 
PDF
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Skilld
 
PDF
Lobos Introduction
Nicolas Buduroi
 
PDF
Loom and concurrency latest
Srinivasan Raghavan
 
PPT
JAVA MULTITHREDED PROGRAMMING - LECTURES
rm170484
 
PDF
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Holden Karau
 
PPT
Parallel programming
Swain Loda
 
PDF
Solid And Sustainable Development in Scala
Kazuhiro Sera
 
PDF
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
kawamuray
 
PDF
Solid and Sustainable Development in Scala
scalaconfjp
 
PPTX
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
DOCX
Big data unit iv and v lecture notes qb model exam
Indhujeni
 
PPTX
The dark side of Akka and the remedy - bp.scala meetup
krivachy
 
PDF
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Phil Estes
 
Apache Spark at Viadeo
Cepoi Eugen
 
Microservices in Clojure
Lucas Cavalcanti dos Santos
 
Understanding Framework Architecture using Eclipse
anshunjain
 
Airflow tutorials hands_on
pko89403
 
PostgreSQL Prologue
Md. Golam Hossain
 
Airflow presentation
Ilias Okacha
 
U-SQL Query Execution and Performance Basics (SQLBits 2016)
Michael Rys
 
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...
Skilld
 
Lobos Introduction
Nicolas Buduroi
 
Loom and concurrency latest
Srinivasan Raghavan
 
JAVA MULTITHREDED PROGRAMMING - LECTURES
rm170484
 
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Holden Karau
 
Parallel programming
Swain Loda
 
Solid And Sustainable Development in Scala
Kazuhiro Sera
 
Kafka meetup JP #3 - Engineering Apache Kafka at LINE
kawamuray
 
Solid and Sustainable Development in Scala
scalaconfjp
 
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
Big data unit iv and v lecture notes qb model exam
Indhujeni
 
The dark side of Akka and the remedy - bp.scala meetup
krivachy
 
Quantifying Container Runtime Performance: OSCON 2017 Open Container Day
Phil Estes
 
Ad

Recently uploaded (20)

PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
oapresentation.pptx
mehatdhavalrajubhai
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Ad

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: [email protected] - Moar examples! More information!