Slide 1

Slide 1 text

Empowering IoT devices through innovative solutions Java and GraalVM for ARMv8 Andrea Battaglia

Slide 2

Slide 2 text

What we’ll discuss today Agenda 2 Who am I Architectural Overview What is Quarkus Quarkus role in the project Resources Q&A

Slide 3

Slide 3 text

3 WHO AM I Java and GraalVM for ARMv8

Slide 4

Slide 4 text

Self Introduction 4 Name: Andrea Battaglia Email: [email protected] Base: Italy (Far south) Works for: Red Hat Role: EMEA Technical Partner Development Manager - DX and Cloud-Native Experience: Red Hat Technical Head of DX EMEA Self introduction

Slide 5

Slide 5 text

5 OVERVIEW Java and GraalVM for ARMv8

Slide 6

Slide 6 text

6 Project idea Setup a European environmental sensor network with our App Dev Partners based on Red Hat technology to document the effects of COVID-19 on the air quality over time Architectural Overview

Slide 7

Slide 7 text

7 Technology involved Edge The edge software stack, excluding the sensor drivers (also Open Source), is upstream technology Red Hat: ▸ OS: Fedora IoT * ・ The new generation of Operating System for edge devices. Productization TBD ▸ Quarkus * + GraalVM ** ・ Cost Savings: Low memory, fast startup, cloud efficiency, low learning curve, serverless, high density on K8s & cloud ・ Faster time to value/market: Developer productivity, extensions ecosystem, low learning curve, keep competitive edge ・ Reliability: Trusted technology, active community, trusted sponsor, fast release cadence, unnoticed failovers Data Center The Data Center Software stack is entirely composite of Red Hat enterprise technologies: ▸ Openshift ▸ Red Hat A-MQ ▸ Red Hat AMQ-Streams ▸ Red Hat Runtimes ・ Quarkus ・ Node.js Architectural Overview

Slide 8

Slide 8 text

Architectural Overview 8 Edge Device ▸ Used Red Hat upstream technologies ・ Fedora IoT ・ Quarkus ▸ No Enterprise support, so far * ▸ Quarkus runs potentially everywhere

Slide 9

Slide 9 text

Architectural Overview 9 Edge Device / Server

Slide 10

Slide 10 text

Architectural Overview 10 OS ▸ Must be fully-fledged 64 bit OS (not just its kernel) ▸ Must have a very small memory footprint ▸ Must be immutable or at least, modular ▸ Must have the ability to run a container engine with the minimum memory footprint, like Podman or CRI-O ▸ Must support all of the following hardware component used by the sensor board: ・ I2C ・ SPI ・ Serial port Sensors Service ▸ Small memory footprint ▸ Python library from technology vendor ▸ Flask project guarantees multithreading and performance (for a PoC) ▸ Container-Ready EdgeService ▸ Small memory footprint ▸ Optimized performance ▸ Container-Native ▸ Integration with server-side endpoints

Slide 11

Slide 11 text

11 Datacenter Architectural Overview

Slide 12

Slide 12 text

12 WHAT IS QUARKUS Java and GraalVM for ARMv8

Slide 13

Slide 13 text

Experts from cloud-native Java OS projects 13 Eclipse Vert.x Hibernate Eclipse MicroProfile RESTEasy WildFly Undertow OpenJDK What is Quarkus

Slide 14

Slide 14 text

Quarkus - Optimizing the Java Stack 14 Optimized Application Frameworks Vert.x + Netty Architecture: Microservices, Serverless Deployment: Single App App Lifecycle: Milliseconds to Days Memory: 10MBs+ RAM Startup Time: Milliseconds Java Virtual Machine (Hotspot) Optional App How does Quarkus work?

Slide 15

Slide 15 text

Benefit No. 1: Container First 15 “We went from 1-min startup times to 400 milliseconds” Quarkus + Native 12 MB Quarkus + JVM 73 MB Traditional Cloud-Native Stack 136 MB Reduced Memory Footprint Quarkus + Native (.016 secs) Quarkus + JVM (0.943 secs) Traditional Cloud-Native Stack (4.3 secs) Fast Startup Time Smaller Disk Footprint What is Quarkus

Slide 16

Slide 16 text

Benefit No. 2: Developer Joy 16 “Our developers used to wait 2 to 3 mins to see their changes. Live coding does away with this.” A cohesive platform for optimized developer joy: ▸ Based on standards and more ▸ Unified configuration ▸ Live coding ▸ Streamlined code for the 80% common usages, flexible for the 20% ▸ No hassle native executable generation What is Quarkus

Slide 17

Slide 17 text

Benefit No. 3: Unifies Imperative and Reactive 17 ▸ Combine both Reactive and imperative development in the same application ▸ Inject the EventBus or the Vertx context ▸ Use the technology that fits your use-case ▸ Key for reactive systems based on event driven apps @Inject SayService say; @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { return say.hello(); } @Inject @Stream(”kafka”) Publisher reactiveSay; @GET @Produces(MediaType.SERVER_SENT_EVENTS) public Publisher stream() { return reactiveSay; } What is Quarkus

Slide 18

Slide 18 text

Benefit No. 4: Best of Breed Frameworks & Standards 18 “When you adopt Quarkus, you will be productive from day one since you don’t need to learn new technologies.” Eclipse Vert.x Hibernate RESTEasy Apache Camel Eclipse MicroProfile Netty Kubernetes OpenShift Jaeger Prometheus Apache Kafka Infinispan Flyway Neo4j MongoDB MQTT KeyCloak Apache Tika What is Quarkus

Slide 19

Slide 19 text

19 HOW DOES QUARKUS WORK? Java and GraalVM for ARMv8

Slide 20

Slide 20 text

Quarkus role in the project Use the compiler of choice The red pill... Or the blue pill? 20

Slide 21

Slide 21 text

21 Substrate VM Classes JDK Classes JDK Classes Substrate VM Classes Java Application Classes Java Application Classes Native Executable AOTC - GraalVM native image - Dead code elimination Quarkus role in the project

Slide 22

Slide 22 text

How Does a Framework Start? 22 @ @ Packaging (maven, gradle…) Build Time Runtime Load config file from file system Parse it Classpath scanning to find annotated classes Attempt to load class to enable/disable features Build its model of the world. Start the management (thread, pool…) Quarkus role in the project

Slide 23

Slide 23 text

The Quarkus way 23 @ @ @ @ Build Time Runtime Runtime Build Time Quarkus role in the project

Slide 24

Slide 24 text

Compiling for RPi 24 How does Quarkus work? Hosted VM Multiarch project

Slide 25

Slide 25 text

25 RESOURCES Java and GraalVM for ARMv8

Slide 26

Slide 26 text

Additional Resources 26 REDHAT.COM Red Hat build of Quarkus Red Hat Runtimes Red Hat Middleware Portfolio LEARN MORE IDC Quarkus Report (Coming Soon!) Four Reasons To Try Quarkus What is a Java Framework? DEVELOPERS Documentation Interactive Tutorials Start Coding QUARKUS COMMUNITY My article reproducing the whole process step by step: https://quarkus.io/blog/quarkus-native-on-a-raspberry-pi/ Resources

Slide 27

Slide 27 text

linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you 27