Using the FLaNK Stack for edge ai (flink, nifi, kafka, kudu)

A presentation at AI and IoT Bulgaria Summit 2021 in June 2021 in by Tim Spann

Slide 1

Slide 1

Using the FLaNK Stack for Edge AI Timothy Spann Principal DataFlow Field Engineer Cloudera @PaasDev AI and IoT Bulgaria Summit, 2021 th June 26

Slide 2

Slide 2

https://github.com/tspannhw https://www.datainmotion.dev/ https://www.meetup.com/futureofdata-princeton/ 2

Slide 3

Slide 3

Speaker Bio Principal Data Flow Field Engineer Cloudera DZone Zone Leader and Big Data MVB; ex-Real-Time Streaming Engineer @ Energy Device Startup Princeton NJ Future of Data Meetup; @PaasDev ex-Hortonworks Senior Sales Engineer ex-Pivotal Field Engineer ex-HPE Systems Architect V https://github.com/tspannhw https://www.datainmotion.dev/ https://github.com/tspannhw/SpeakerProfile https://dev.to/tspannhw https://sessionize.com/tspann/ https://www.slideshare.net/bunkertor

Slide 4

Slide 4

Welcome to Future of Data - Princeton - Virtual https://www.meetup.com/futureofdata-princeton/ From Big Data to AI to Streaming to Containers to Cloud to Analytics to Cloud Storage to Fast Data to Machine Learning to Microservices to … 4

Slide 5

Slide 5

Agenda • • • • • • • • • • • Who, What, Where, Why What Tools Deep Learning Integration Device Agents Agents, Server, Data, Action and Architecture What is the Data? What is the hardware? Continuous SQL Demo Takeaways Upcoming Events Thanks!

Slide 6

Slide 6

FLaNK Stack for Cloud Data Engineers - Edge AI Multiple users, frameworks, languages, clouds, data sources & clusters CLOUD DATA ENGINEER • Experience in ETL/ELT CAT AI / Deep Learning / ML / DS • Expert in ETL (Eating, Ties and Laziness) • Edge Camera Interaction • Typical User • Can run in Apache NiFi • No Coding Skills • Can run in Apache Flink • Experience with Streaming • Can use NiFi • Can run in MiNiFi Agents • Knowledge of Cloud Tools • Questions your cloud spend • Coding skills in Python or Java • Knowledge of database query languages such as SQL • Can run in Kafka Streams 6

Slide 7

Slide 7

Apache Tools and Frameworks Used 7

Slide 8

Slide 8

Apache MXNet Native Processor through DJL.AI for Apache NiFi This processor uses the DJL.AI Java Interface https://github.com/tspannhw/nifi-djl-processor https://dev.to/tspannhw/easy-deep-learning-in-apache-nifi-with-djl-2d79

Slide 9

Slide 9

MXNetm.. FLaNiFiKafka ● ● ● https://www.slideshare.net/bunkertor/apache-deep-learning-101-apach econ-montreal-2018-v031 https://www.slideshare.net/bunkertor/apache-deep-learning-202-washi ngton-dc-dws-2019 https://www.slideshare.net/bunkertor/apache-deep-learning-201-barce lona-dws-march-2019

Slide 10

Slide 10

MiNiFim.. FLaNK ● ● ● ● ● https://www.datainmotion.dev/2019/03/using-raspberry-pi-3bwith-apache-nifi.html https://www.datainmotion.dev/2019/05/cloudera-edge-manage ment-introduction.html https://www.datainmotion.dev/2019/11/running-demo-apacheflink-application.html https://www.datainmotion.dev/2019/11/learning-apache-flink19.html https://www.datainmotion.dev/2019/10/migrating-apache-flum e-flows-to-apache_42.html

Slide 11

Slide 11

What is Apache NiFi and MiNiFi used for? 11

Slide 12

Slide 12

Edge AI to Cloud Streaming Pipeline Edge Private Cloud Multi-Public Cloud Sensors Energy Logs Sensors Aggregates Analytics Energy Weather SQL Device Data MiNiFi Agent Deep Learning Classification 12

Slide 13

Slide 13

SHOW ME THE DATA {“uuid”: “rpi4_uuid_jfx_20200826203733”, “amplitude100”: 1.2, “amplitude500”: 0.6, “amplitude1000”: 0.3, “lownoise”: 0.6, “midnoise”: 0.2, “highnoise”: 0.2, “amps”: 0.3, “ipaddress”: “192.168.1.76”, “host”: “rp4”, “host_name”: “rp4”, “macaddress”: “6e:37:12:08:63:e1”, “systemtime”: “08/26/2020 16:37:34”, “endtime”: “1598474254.75”, “runtime”: “28179.03”, “starttime”: “08/26/2020 08:47:54”, “cpu”: 48.3, “cpu_temp”: “72.0”, “diskusage”: “40219.3 MB”, “memory”: 24.3, “id”: “20200826203733_28ce9520-6832-4f80-b17d-f36c21fd8fc9”, “temperature”: “47.2”, “adjtemp”: “35.8”, “adjtempf”: “76.4”, “temperaturef”: “97.0”, “pressure”: 1010.0, “humidity”: 8.3, “lux”: 67.4, “proximity”: 0, “oxidising”: 77.9, “reducing”: 184.6, “nh3”: 144.7, “gasKO”: “Oxidising: 77913.04 Ohms\nReducing: 184625.00 Ohms\nNH3: 144651.47 Ohms”} 13

Slide 14

Slide 14

WHERE DID THAT DATA COME FROM? BME280 - temperature, pressure, humidity sensor LTR-559 - light and proximity sensor MICS6814 - analog gas sensor ADS1015 ADC MEMS - microphone 0.96-inch, 160 x 80 color LCD 14

Slide 15

Slide 15

Flink SQL Examples INSERT INTO global_sensor_events SELECT scada.uuid, scada.systemtime , scada.temperaturef , scada.pressure , scada.humidity , scada.lux , scada.proximity , scada.oxidising , scada.reducing , scada.nh3 , scada.gasko,energy.current, energy.voltage ,energy.power , Energy.total,energy.fanstatus FROM energy, scada WHERE scada.system time >= energy.systemtime; 15

Slide 16

Slide 16

Demo

Slide 17

Slide 17

Takeaways • • • • • • • IoT can be easy with Open Source Download examples start today Start with a single device Capture data locally Send data to Azure securely Data provenance helps debugging, monitoring and metrics Share with the community

Slide 18

Slide 18

DEMO SOURCE CODE ● ● ● ● ● ● ● ● https://github.com/tspannhw/FlinkForwardGlobal2020 https://github.com/tspannhw/ApacheConAtHome2020 https://github.com/tspannhw/minifi-xaviernx https://github.com/tspannhw/minifi-jetson-nano https://github.com/tspannhw/minifi-enviroplus https://github.com/tspannhw/EverythingApacheNiFi https://github.com/tspannhw/CloudDemo2021 https://github.com/tspannhw/FlinkSQLWithCatalogsDemo The code, build scripts, schemas, table DDL, Flink SQL, Kafka Connect configuration, NiFi flows, HBase tables, Kudu tables, Hive tables, HDFS directories, alerts, images, HTML, docs, links and all the goodies are here. Please fork and contribute. 18

Slide 19

Slide 19

DEEPER CONTENT ● ● ● ● ● https://www.datainmotion.dev/2020/10/running-flink-sql-against-kafka-using.html https://www.datainmotion.dev/2020/10/top-25-use-cases-of-cloudera-flow.html https://github.com/tspannhw/EverythingApacheNiFi https://github.com/tspannhw/CloudDemo2021 https://github.com/tspannhw/StreamingSQLExamples 19

Slide 20

Slide 20

20

Slide 21

Slide 21

Upcoming Events Data Saturday Plovdiv, 2021 August 28 Eventbrite Data Saturday Sofia, 2021 October 09 Eventbrite jsTalks (Bulgaria), 2021 Nov 19-20 http://jstalks.net/

Slide 22

Slide 22

Thanks to our Sponsors

Slide 23

Slide 23

TH N Y U 23