Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

71
Data science lifecycle with Apache Flink and Apache Zeppelin (incubating) Flink Forward Moon moon@nflabs.com NFLabs www.nflabs.com

Transcript of Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Page 1: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Data science lifecycle with Apache Flink and

Apache Zeppelin (incubating)

Flink Forward

Moon [email protected] NFLabs www.nflabs.com

Page 2: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Content

1. Data science lifecycle 2. Zeppelin for data science3. Zeppelin and Flink4. Project Roadmap

Page 3: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Data science lifecycle

Page 4: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Data Science: process

https://en.wikipedia.org/wiki/Data_analysis

Page 5: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Data Science: tools

MLlib

Page 6: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Data Science: people

Engineer Data Scientist

DevOps Business

http://aarondavis.design/

Page 7: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Content

1. Data science lifecycle2. Zeppelin for data science 3. Zeppelin and Flink4. Project Roadmap

Page 8: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin for data scientist

Page 9: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Project Timeline

ASF Incubation12.2014

08.2014 Started getting adoption

http://zeppelin.incubator.apache.org

12.2012 Commercial Product for data analysis

10.2013 Open sourced a single feature

Page 10: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Hadoop Landscape

Cloudera-ML

ML-base

MRQL

Shark

?

Page 11: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Commercial Product 12.2012

Page 12: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin 10.2013

Page 13: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin10.2013

Page 14: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin08.2014

Page 15: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin08.2014

Page 16: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Third-party Products 10.2014

Page 17: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Apache Incubation Proposal11.2014

Page 18: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Acceptance by Incubator 23.12.2014

Page 19: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Current Status

1 Release

68 Contributors worldwide

722 Stars on GH

300/900 Emails at users/dev @i.a.o

Page 20: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Interactive Notebooks

Page 21: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Interactive Visualization

Page 22: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Multiple Backends

Page 23: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin & Friends

Z-Manager

ZeppelinHub

…⋯

Collaboration/Sharing

Packaging & Deployment Zeppelin + Full stack on a cloud

Packages Backend Integration

Page 24: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Online Viewer

Page 25: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Deployment

https://github.com/hortonworks-gallery/ambari-zeppelin-service

Page 26: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Deployment

Page 27: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

As a Service

Page 28: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Before

Cloudera-ML

ML-base

MRQL

Shark

?

Page 29: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

After

Cloudera-ML

ML-base

MRQL

Shark

Page 30: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Content

1. Data science lifecycle2. Zeppelin for data science3. Zeppelin and Flink 4. Project Roadmap

Page 31: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Flink integration

Integrated through Interpreter Data processing system abstraction in Zeppelin

Page 32: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Interpreter

http://zeppelin.incubator.apache.org/docs/development/writingzeppelininterpreter.html

Page 33: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Writing an Interpreter

public abstract void open();

public abstract void close();

public abstract InterpreterResult interpret(String st, InterpreterContext context);

public abstract void cancel(InterpreterContext context);

public abstract int getProgress(InterpreterContext context);

public abstract List<String> completion(String buf, int cursor);

public abstract FormType getFormType();

public Scheduler getScheduler();

Must have

Good to have

Advanced

Page 34: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Flink Interpreter

https://github.com/apache/incubator-zeppelin/blob/master/flink/src/main/java/org/apache/zeppelin/flink/FlinkInterpreter.java

Zeppelin Server

Thrift

Flink InterpreterInterpreter JVM

processFlinkILoop

ExecutionEnvironment

Page 35: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Using interpreter

Configure Bind use

Page 36: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Using interpreter

Use different interpreters in the same notebook

Page 37: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Display System

Zeppelin Server

Flink Interpreter Other Interpreter

Zeppelin webapp

Websocket, REST

Text Html Table Angular

Page 38: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Display System

Select display system through output

Page 39: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Built in scheduler

Built-in scheduler runs your notebook with cron expression.

Page 40: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Flexible layout

Flexible layout

Page 41: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

DEMO

Page 42: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Content

1. Data science lifecycle2. Zeppelin for data science3. Zeppelin and Flink4. Project Roadmap

Page 43: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Flink Integration

• ZeppelinContext : Access to Zeppelin provided features• - Dynamic form• - Angular display system

• Dependency loading

• Auto completion• Cancel• Get progress information

Page 44: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Thank you

Q & A

Moon [email protected]

NFLabs www.nflabs.com

http://zeppelin.incubator.apache.org/

Page 45: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Project roadmap

Page 46: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Multi-tenancy

Two approaches

1. Implement authentication, ACL inside of Zeppelin

https://github.com/apache/incubator-zeppelin/pull/53

2. Run Zeppelin on top of Docker http://github.com/NFLabs/z-manager

Page 47: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Zeppelin for organizations

Page 48: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

An Engineer

engineer by http://aarondavis.design/

Page 49: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

A Team

engineer by http://aarondavis.design/

Page 50: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

An Organization

engineer by http://aarondavis.design/

Page 51: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

That’s too many!

engineer by http://aarondavis.design/

Page 52: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

What is the problem?

Too much:Install

Configure

Cluster resources

Page 53: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Solution?

We have containers

+

reverse proxy

Page 54: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin
Page 55: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Z Manager PoC

httpd + mod_php

nginx

Linux box

engineer by http://aarondavis.design/

2 days, bash + php :(

Page 56: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Z Manager PoC

Page 57: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Z Manager

http://github.com/NFLabs/z-manager

Apache 2.0 Licence

Containerized deployment per user

Reverse proxy

Single binary

Simple web application

Z Manager

SGA to ASF coming *

Page 58: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Z Manager

Auto-update

engineer by http://aarondavis.design/

Linux box

go + react :)

Z Manager process

Page 59: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Z Manager

Page 60: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Helium

Page 61: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

People do the similar workwith different data

New visualizationModel & AlgorithmData process pipeline

engineer by http://aarondavis.design/

Page 62: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Package and distribute work

New visualizationModel & AlgorithmData process pipeline

PkgRepo

engineer by http://aarondavis.design/

Page 63: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Helium

https://s.apache.org/helium

Platform for

on top of Apache Zeppelin

Data Analytics Application

Page 64: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Helium Application

= +View Algorithm

Zeppelin provided Resources

Page 65: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Resources

Data

Computing

Any java object

����������� ������������������  -����������� ������������������  Result����������� ������������������  of����������� ������������������  last����������� ������������������  execution����������� ������������������  -����������� ������������������  JDBC����������� ������������������  connection����������� ������������������  (from����������� ������������������  JDBC����������� ������������������  Interpreter)*

����������� ������������������  -����������� ������������������  SparkContext����������� ������������������  (from����������� ������������������  SparkInterpreter)����������� ������������������  -����������� ������������������  Flink����������� ������������������  environment����������� ������������������  (from����������� ������������������  FlinkInterpreter)*

-����������� ������������������  Provided����������� ������������������  by����������� ������������������  user����������� ������������������  created����������� ������������������  Interpreter-����������� ������������������  Provided����������� ������������������  by����������� ������������������  user����������� ������������������  created����������� ������������������  Helium����������� ������������������  application����������� ������������������  

Page 66: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Application Examples

Data

Computing

-����������� ������������������  ex)����������� ������������������  get����������� ������������������  git����������� ������������������  commit����������� ������������������  log����������� ������������������  data����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  https://github.com/Leemoonsoo/zeppelin-gitcommitdata

Visualization

����������� ������������������  ����������� ������������������  -����������� ������������������  ex)����������� ������������������  run����������� ������������������  cpu����������� ������������������  usage����������� ������������������  monitoring����������� ������������������  code����������� ������������������  across����������� ������������������  spark����������� ������������������  cluster,����������� ������������������  using����������� ������������������  SparkContext ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  https://github.com/Leemoonsoo/zeppelin-sparkmon

-����������� ������������������  ex)����������� ������������������  display����������� ������������������  result����������� ������������������  data����������� ������������������  as����������� ������������������  a����������� ������������������  wordcloud����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  https://github.com/Leemoonsoo/zeppelin-wordcloud

Page 67: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

How it works

Zeppelin����������� ������������������  Server

Web����������� ������������������  browser

View

Interpreter����������� ������������������  Process

Algorithm

Resource����������� ������������������  pool

Resource����������� ������������������  pool

Resource����������� ������������������  pools����������� ������������������  are����������� ������������������  connected

“Algorithm����������� ������������������  runs����������� ������������������  where����������� ������������������  resource����������� ������������������  exists”

Page 68: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

API

class YourApplication extends org.apache.zeppelin.helium.Application { @Override public void run(ApplicationArgument arg, InterpreterContext context) { ….. } }

Easy����������� ������������������  API

Just����������� ������������������  extend����������� ������������������  helium.Application

Page 69: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Application Spec

{ mavenArtifact : "groupId:artifactId:version", className : "your.helium.application.Class", icon : "fa fa-cloud", name : "My app name", description : “some description", consume : [ "org.apache.spark.SparkContext" ] }

Simple

Writing����������� ������������������  a����������� ������������������  spec����������� ������������������  file����������� ������������������  allow����������� ������������������  Zeppelin����������� ������������������  load����������� ������������������  application

Page 70: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Deploy

Public

Repository

Private

Repository

Handy����������� ������������������  

Private

Public

Packaged����������� ������������������  to����������� ������������������  Jar����������� ������������������  and����������� ������������������  ����������� ������������������  

Distributed����������� ������������������  through����������� ������������������  

Maven

Downloaded����������� ������������������  on����������� ������������������  the����������� ������������������  fly����������� ������������������  

and����������� ������������������  run����������� ������������������  when����������� ������������������  user����������� ������������������  selects����������� ������������������  

it

Page 71: Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin

Thank you

Q & A

Moon [email protected]

NFLabs www.nflabs.com

http://zeppelin.incubator.apache.org/