jim dowling - multi-tenant flink-as-a-service on yarn

27
Multi-Tenant Flink-as-a-Service on YARN Jim Dowling Associate Prof @ KTH Senior Researcher @ SICS CEO @ Logical Clocks AB Slides by Jim Dowling, Theofilos Kakantousis Berlin, 13 th September 2016 www.hops.io @hopshadoop

Upload: flink-forward

Post on 08-Jan-2017

157 views

Category:

Data & Analytics


2 download

TRANSCRIPT

Page 1: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Multi-Tenant Flink-as-a-Service on YARNJim Dowling

Associate Prof @ KTHSenior Researcher @ SICSCEO @ Logical Clocks AB

Slides by Jim Dowling, Theofilos Kakantousis

Berlin, 13th September 2016

www.hops.io @hopshadoop

Page 2: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

2

A Polyglot

Page 3: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

3

Polyglot Data Parallel Processing• Stream Processing

- Beam/Flink, Spark

• ETL/Batch Processing- Spark, MapReduce

• SQL-on-hadoop- Hive, Presto, SparkSQL

• Distributed ML- SparkML, FlinkML

• Deep Learning- Distributed Tensorflow

Page 4: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

4

Flink Standalone good enough for some• Enterprises are polyglot due to economies of scale• Standalone Flink works great for enterprises

- Dedicate some servers- Dedicate some SREs

Page 5: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

5

Polyglot Data Parallel Processing In Context

Data ProcessingSpark, MR, Flink, Presto, Tensorflow

StorageHDFS, MapR, S3, WAS

Resource ManagementYARN, Mesos, Kubernetes

MetadataHive, Parquet, Authorization, Search

Page 6: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

6

Flink for the Little Guy• Flink-as-a-Service on Hops Hadoop

- Fully UI Driven, Easy to Install

• Project-Based Multi-tenancy

Hops

Page 7: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

7

Flink-as-a-Service running on hops.siteSICS ICE: A datacenter research and test environment

Purpose: Increase knowledge, strengthen universities, companies and researchers

Page 8: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

8

HopsFS Architecture

NameNodes

NDB

Leader

HDFS Client

DataNodes

Page 9: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

9

Hops-YARN Architecture

ResourceMgrs

NDB

Scheduler

YARN Client

NodeManagers

Resource Trackers

Heartbeats(70-95%)

AM Reqs (5-30%)

Page 10: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

10

HopsFS Throughput (Spotify Workload)

NDB Setup: 8 Nodes using Xeon E5-2620 2.40GHz Processors and 10GbE. NameNodes: Xeon E5-2620 2.40GHz Processors machines and 10GbE.

Page 11: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

11

HopsFS Metadata Scaleout

Assuming 256MB Block Size, 100 GB JVM Heap for Apache Hadoop

Page 12: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Hopsworks

12

Page 13: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

13

Hopsworks – Project-Based Multi-Tenancy• A project is a collection of

- Users with Roles- HDFS DataSets- Kafka Topics- Notebooks, Jobs

• Per-Project quotas- Storage in HDFS- CPU in YARN• Uber-style Pricing

• Sharing across Projects- Datasets/Topics

projectdataset 1

dataset N

Topic 1

Topic N

Kafka

HDFS

Page 14: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Hopsworks – Dynamic Roles

14

[email protected]

NSA__Alice

Authenticate

Users__Alice

Glassfish

HopsFS

HopsYARN

ProjectsSecure

Impersonation

Kafka

X.509 Certificates

Page 15: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Look Ma, No Kerberos!• For each project, a user is issued with a X.509 certificate, containing the project-specific userID.

• Services are also issued with X.509 certificates.- Both user and service certs are signed with the same CA.- Services extract the userID from RPCs to identify the caller.

• Netflix’ BLESS system is a similar model, with short-lived certificates.

Page 16: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

X.509 Certificate Per Project-Specific User

16

[email protected]

Authenticate

Add/DelUsers

Distributed Database

Insert/Remove CertsProject Mgr

RootCA

ServicesHadoopSparkKafkaetc

Cert Signing Requests

Page 17: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Flink on YARN• Two modes: detached or blocking

• Hopsworks supports detached mode- Client started locally, then exits after the job is submitted to

YARN- No accumulator results or exceptions from the

ExecutionEnvironment.execute() - Can only kill YARN job, not Flink session. Cleanup issues.

• New Architecture proposal for a Flink Dispatcher

Page 18: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

A Flink/Kafka Job on YARN with Hopsworks

18

[email protected]

1. Launch Flink Job

Distributed Database

2. Get certs, service endpoints

YARN Private LocalResources

Flink/Kafka Streaming App

4. Materialize certs

3. YARN Job + config

6. Get Schema

7. Consume Produce

5. Read Certs

HopsworksKafkaUtil

Page 19: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Flink Stream Producer in Secure KafkaStreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();String topic = parameterTool.get("topic");

1. Discover: Schema Registry and Kafka Broker Endpoints2. Create: Kafka Properties file with certs and broker details3. Create: producer using Kafka Properties4. Distribute: X.509 certs to all hosts on the cluster5. Download: the Schema for the Topic from the Schema Registry6. Do this all securely

DataStream<…> messageStream = env.addSource(…);

messageStream.addSink(producer);env.execute("Write to Kafka");

19

Developer

Operations

Page 20: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Flink/Kafka Stream Producer in HopsworksStreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();String topic = parameterTool.get("topic");

FlinkProducer producer = KafkaUtil.getFlinkProducer(topic);

DataStream<…> messageStream = env.addSource(…);

messageStream.addSink(producer);env.execute("Write to Kafka");

20https://github.com/hopshadoop/hops-kafka-examples

Page 21: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Flink/Kafka Stream Consumer in HopsworksStreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();String topic = parameterTool.get("topic");

FlinkConsumer consumer = KafkaUtil.getFlinkConsumer(topic);

DataStream<…> messageStream = env.addSource(consumer);RollingSink<String> rollingSink = ... // HDFS pathmessageStream.addSink(rollingSink);env.execute(“Read from Kafka, write to HDFS");

21https://github.com/hopshadoop/hops-kafka-examples

Page 22: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

22

Zeppelin Support for Flink

Page 23: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

23

Karamel/Chef for Automated Installation

Google Compute Engine BareMetal

Page 24: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Demo

24

Page 25: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

25

Summary• Hopsworks provides first-class support for Flink-as-a-Service- Streaming or Batch Jobs- Zeppelin Notebooks

• Hopworks simplifies secure use of Kafka in Flink on YARN

• YARN support for Flink still a work-in-progress

Page 26: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Hops TeamActive: Jim Dowling, Seif Haridi, Tor Björn Minde,

Gautier Berthou, Salman Niazi, Mahmoud Ismail,Theofilos Kakantousis, Johan Svedlund Nordström, Konstantin Popov, Antonios Kouzoupis.Ermias Gebremeskel, Daniel Bekele

Alumni: Vasileios Giannokostas, Misganu Dessalegn, Rizvi Hasan, Paul Mälzer, Bram Leenders, Juan Roca,K “Sri” Srijeyanthan, Steffen Grohsschmiedt, Alberto Lorente, Andre Moré, Ali Gholami, Davis Jaunzems,Stig Viaene, Hooman Peiro, Evangelos Savvidis, Jude D’Souza, Qi Qi, Gayana Chandrasekara,Nikolaos Stanogias, Daniel Bali, Ioannis Kerkinos,Peter Buechler, Pushparaj Motamari, Hamid Afzali,Wasif Malik, Lalith Suresh, Mariano Valles, Ying Lieu.

Page 27: Jim Dowling - Multi-tenant Flink-as-a-Service on YARN

Hops[Hadoop For Humans]

Join us!http://github.com/hopshadoop