native-spring-on-k8s-with-graalvm-complete

APACHE-2.0 License

Stars
5

native-spring-on-k8s-with-graalvm-workshop

This repo contains all the materials required for the Native Spring on K8s with GraalVM workshop.

The workshop is designed to help Spring Boot developers build new / modernize existing applications using Spring Native and deploy them in Kubernetes. Basic knowledge of Spring Boot and Kubernetes is assumed for successful completion.


Context

This content contains sample code supporting the workshop agenda, with a focus on building Native Applications using Spring Native and GraalVM.

The content is organized around a number of independent sections, each with a README.md file explaining how to build and run the samples, or pointing out areas of interest, for further exploration.

The content focuses on the following main areas:


Repository

This workshop repository can be cloned to your machine as follows:

> git clone https://github.com/ddobrin/native-spring-on-k8s-with-graalvm

Full samples are provided for each lab or demo!

All samples are relative to the repository root, for ex.:

# Petclinic
<repo-root>/complete/petclinic-jdbc

Environment setup and validation

Please start by cloning the repo, then follow the environment setup and validation section prior to the start of the workshop.


Workshop - Detailed Agenda

  1. Introductions
  2. Setup Validation - say "Hello Workshop"
  3. Let's get started - How fast are your pets? Let's build some images for them !
  4. Demystifying Native Images
    • Let's talk about JVM vs Native
    • Introducing ahead-of-time compilation (AOT)
    • Making close-world assumptions
    • When to modernize apps with native images ? Let's see the use-cases
  5. Understanding GraalVM
    • GraalVM Architecture
    • Native Image technology for ahead-of-time compilation
    • Build configuration for a native image build process
      • How to configure Native Image Builds using the Java Agent -- Demo
    • Initialization
      • Runtime vs Build-Time Initialization
      • Understanding the Class Initialization strategy for Native Images
    • AOT compilation limitations - what do I need to know ?
      • Dynamic Class Loading, Reflection, Dynamic Proxies, Accessing Resources, Serialization
      • Mitigating AOT limitations -- Demo(s)
    • Building and Containerizing native images with the GraalVM Maven plugin and Docker -- Demo
    • Visualization Tools
      • GraalVM Dashboard -- Demo
  6. Building Spring Native Applications with GraalVM
    • What is Spring Native and why use it ?
    • AOT compilation limitations - how do Native Hints in Spring help bypass them ? -- Demo(s)
    • Spring Native's limitations - what do I need to know ?
    • Building with the Spring AOT Maven plugin
    • Cloud Native Buildpacks -support source-to-image for native images
    • Using a container-based Spring Native build environment
    • Troubleshooting tips
  7. Best Practices for designing native-friendly Spring apps and libraries
    • Identification of AOT limitations in the app - Demo
    • Building a Spring Native Shared Library - Demo
    • Comparing Images
  8. Spring Native Roadmap

Appendix: