pipes, arrows,

28
Pipes, Arrows, and the Universe DECLARATIVE TYPED SPECIFICATIONS FOR CONCURRENT AND COMPOSABLE WORKFLOWS 1 Albert Schimpf

Upload: others

Post on 16-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pipes, Arrows,

Pipes, Arrows, and the UniverseD E C L A R AT I V E T Y P E D S P E C I F I CAT I O N S FO R C O N C U R R E N T A N D C O M P O S A B L E WO R K F L OWS

1

Albert Schimpf

Page 2: Pipes, Arrows,

Tools & Toolboxes

Do one thing well

Compose tools together

What about the interface?

2

Page 3: Pipes, Arrows,

Universal Interface

3

"Write programs that handle text streams, because that is a universal

interface"

"Expect the output of every program to become the input of

another, as yet unknown, program"

THE BELL SYSTEM TECHNICAL JOURNAL. M. D. MCILROY, ET. AL. “UNIX TIME-SHARING SYSTEM FORWARD”. 1978A QUARTER-CENTURY OF UNIX, PETER H. SALUS, 1994

Page 4: Pipes, Arrows,

Pipe = 42

ls -1

wc -l

4

Page 5: Pipes, Arrows,

Pipe

Stringp1

Stringp2

5

Page 6: Pipes, Arrows,

What's nice?

Separation of business logic and control flow

Composition always works

Good for small chains

Easy (implicit) wiring

6

Page 7: Pipes, Arrows,

ShortcomingsConveniently access output previous steps

Graph-structured control flow

Parsing embedded data structures

7

Page 8: Pipes, Arrows,

Universal Interface II

"Expect the output of every program to become the input of another, as yet

unknown, program."

Write programs that handle maps1,

because that is a universal interface.

81: HTTPS://WWW.JSON.ORG/JSON-EN.HTML

Page 9: Pipes, Arrows,

Workflows COMPOSITION

MAP INTERFACE

9

Page 10: Pipes, Arrows,

Workflows COMPOSITION

MAP INTERFACE

10

Page 11: Pipes, Arrows,

Map Interface

?

Workflow Systems

Kernmantle ('20), Funflow, Porcupine, iTasks, Luigi, Argo, Oozie, NiFi, Azkaban,

Apache Airflow, AWS Data Pipeline, … (>280) Github

Actions

11HTTPS://GITHUB.COM/COMMON-WORKFLOW-LANGUAGE/COMMON-WORKFLOW-LANGUAGE/WIKI/EXISTING-WORKFLOW-SYSTEMS

Page 12: Pipes, Arrows,

WorkflowsCOMPOSITION

MAP INTERFACE

TYPES?

12

Page 13: Pipes, Arrows,

Map Interface

1.Chaining tasks 2.Graph of tasks (DAG)

13

Page 14: Pipes, Arrows,

Configuration (input, output) of components

Data flow: Map instead of String

p can access any data in the map that accesses p

Transitive implicit dependencies on input possible

ls

wc

p

Configuration

Input Output

14

Page 15: Pipes, Arrows,

Configuration (input, output) of components

Data flow: Map instead of String

p can access any data in the map that accesses p

Transitive implicit dependencies on input possible

ls

wc

p

{@x = […]}

{@x = […], @out = 42}

Configuration

Input Output

@x

@x @out

@x@out

15

Page 16: Pipes, Arrows,

Graph of Tasks – Semantics

Multiple incoming arrows

Multiple outgoing arrows

Concurrency, isolation??

16

Page 17: Pipes, Arrows,

Multiple Outgoing

ArrowsIfThenElse

true

false

λ

λ

17

Page 18: Pipes, Arrows,

Isolation:

Dispatched Arrows

Fork

Map

λ

λ

λ

18

Page 19: Pipes, Arrows,

Isolation:

Dispatched Arrows

Fork

Map

λ

λ

λ

19

Page 20: Pipes, Arrows,

Multiple Incoming

Arrowsλ

20

Page 21: Pipes, Arrows,

How to Join?FUTURES!

ForkJoin

?

21

Page 22: Pipes, Arrows,

Futures

ForkJoin

join

22

Page 23: Pipes, Arrows,

DemoS I M P L E E X A M P L E S & P I P E I N T E R AC T I O N

23

Page 24: Pipes, Arrows,

Types!

Atomic values

Lists

Maps

Custom records

Polymorphic types

24

Page 25: Pipes, Arrows,

Generated Documentation

25

Page 26: Pipes, Arrows,

Design & DemoK E Y WO R D M O N I T O R I N G

26

Page 27: Pipes, Arrows,

Summary

The universal string interface is not the only truth

Map interface allows for static type

checking and more

Try it out yourself!

27

Page 28: Pipes, Arrows,

Pipes, Arrows, and the UniverseD E C L A R AT I V E T Y P E D S P E C I F I CAT I O N S FO R C O N C U R R E N T A N D C O M P O S A B L E WO R K F L OWS

28

Albert Schimpf

wiki.scraper.server1.link

docs.scraper.server1.link

github.com/scraperflow

hello-world.yml

docker run -v "$PWD":/rt/ --rm albsch/scraper:latest

Install scraper scraper hello-world.yml