Skip to content

alina-yur/graalvm-deep-dive

Repository files navigation

GraalVM Deep Dive

Bring the Action: Using GraalVM in Production (recording)

Structure

  • GraalVM overview 🐰
  • Migrating an app to GraalVM 🤖
    • 👩‍💻 use Native Build Tools 🛠️
    • 👩‍💻 basic performance measurements with time 📈
  • Using libraries 📚
    • A library might be designed to be Native-Image friendly out of the box;
    • A library might add config files to its source code;
    • Library configuration can be provided via GraalVM Reachability Metadata Repository;
    • 👩‍💻 You can programmatically generate configuration via framework annotations, such as @ReflectiveAccess (Micronaut)
    • You can use Native Image's Tracing Agent (java -agentlib:native-image-agent -jar ./target/demo.jar)
    • You can provide configuration manually via json.
  • Performance optimizations 🚀
  • Testing 👨‍🔬
  • Deployment 📦
    • 👩‍💻 Packaging and linking options
      • JDK
      • JDK | Distroless
      • JDK | JLink
      • Native | Dynamic |
        • docker build -f Dockerfiles/Dockerfile.native -t native-spring-boot-native:latest .
        • docker run -p 8080:8080 native-spring-boot-native:latest .
      • Native | Mostly static | Distroless
      • Native | Static | From scratch
      • Native | Static | From scratch | Optimize for size
      • You can significantly reduce the size by going with Native Image:
➜ docker images | grep "native"                                                                
localhost/native-spring-boot-static-size            latest         ... ...    58.5 MB
localhost/native-spring-boot-static-scratch         latest         ... ...    84.4 MB
localhost/native-spring-boot-native                 latest         ... ...    125 MB
localhost/native-spring-boot-jdk-jlink              latest         ... ...    126 MB
localhost/native-spring-boot-jdk-distroless         latest         ... ...    218 MB
localhost/native-spring-boot-jdk                    latest         ... ...    480 MB
  • Scan the images for vulnerabilities & packages 🛡️
  • Buildpacks
  • GitHub actions
  • Security 🛡️
    • Security by design
    • 👩‍💻 Vulnerability Scanning
      • grype: native-image-inspect --sbom ./target/demo-sbom | grype -v
      • native-image-inspect --sbom ./target/demo-sbom>output.json
    • 👩‍💻 SBOM support: exposing in Spring Actuator
    • 👩‍💻 SBOM support in Micronaut
    • GitHub Action
    • Demo: native-spring-boot-sbom
  • Monitoring 📈
    • 👩‍💻 Micrometer
      • (Tempo -> service graph)
    • 👩‍💻 jvmstat
    • JFR, JMX, jcmd
    • perf stat <./target/demo>
  • Tooling 🔮
    • 👩‍💻 Build reports
  • In the lab 👩‍🔬

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published