Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java and GraalVM for ARMv8

Java and GraalVM for ARMv8

Andrea Battaglia

December 04, 2020
Tweet

Other Decks in Programming

Transcript

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

    View Slide

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

    View Slide

  3. 3
    WHO AM I
    Java and GraalVM for ARMv8

    View Slide

  4. 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

    View Slide

  5. 5
    OVERVIEW
    Java and GraalVM for ARMv8

    View Slide

  6. 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

    View Slide

  7. 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

    View Slide

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

    View Slide

  9. Architectural Overview
    9
    Edge Device / Server

    View Slide

  10. 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

    View Slide

  11. 11
    Datacenter
    Architectural Overview

    View Slide

  12. 12
    WHAT IS
    QUARKUS
    Java and GraalVM for ARMv8

    View Slide

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

    View Slide

  14. 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?

    View Slide

  15. 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

    View Slide

  16. 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

    View Slide

  17. 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

    View Slide

  18. 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

    View Slide

  19. 19
    HOW DOES
    QUARKUS
    WORK?
    Java and GraalVM for ARMv8

    View Slide

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

    View Slide

  21. 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

    View Slide

  22. 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

    View Slide

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

    View Slide

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

    View Slide

  25. 25
    RESOURCES
    Java and GraalVM for ARMv8

    View Slide

  26. 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

    View Slide

  27. 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

    View Slide