Giter VIP home page Giter VIP logo

spring-graalvm-native's Introduction

0.8.1 documentation

This project goal is to incubate support for building Spring Boot applications as GraalVM native images.

Watch The Path Towards Spring Boot Native Applications SpringOne 2020 talk recording for more details: The Path Towards Spring Boot Native Applications

It is mainly composed of:

  • spring-graalvm-native-feature: this module is a GraalVM feature. It is a kind of plugin for the native-image compilation process (which creates the native-image from the built class files). The feature participates in the compilation lifecycle, being invoked at different compilation stages to offer extra information about the application to aid in the image construction.

  • spring-graalvm-native-configuration: this module contains configuration hints for Spring classes, including various Spring Boot auto-configurations.

  • spring-graalvm-native-substitutions: this module allows us to patch temporarily some part of Spring Boot and Spring Framework to improve compatibility and efficiency of Spring native images.

  • spring-graalvm-native: this module aggregates the feature, configuration, and substitutions ones to generate the artifact to consume.

  • spring-graalvm-native-samples: contains various samples that demonstrate the feature usage and are used as integration tests.

  • spring-graalvm-native-docs: contains the asciidoc documentation sources.

  • spring-graalvm-native-tools: tools used for reviewing image building configuration and output.

It supports the following modes using -Dspring.native.mode=<mode> on the native-image command line:

  • reflection (activated by default) provides resource, initialization, proxy, and reflection (using auto-configuration hints) configuration for native images as well as substitutions.

  • init (manually activated) should be used if only wishing to provide initialization configuration and substitutions.

  • agent (activated when the agent-generated config is present) is using the configuration generated by the tracing agent as a basis and also provides additional hints for components like controllers, etc.

  • functional (activated when (spring-fu or spring-init are in the classpath) is designed to work with functional bean registration. In this mode, the feature will provide initialization, resource configuration, substitutions, and spring.factories functional alternative (only Spring Boot spring.factories are supported for now).

Scope and status

This project status is alpha, which means that we are currently mainly working on the software design and on supporting the features of the current samples (work in progress). Supporting a wider range of Spring Boot applications, as well as optimizing efficiency (image size, memory consumption) and performances will happen as a second step.

Spring team collaborates with the GraalVM native team by raising issues in their bug tracker, to improve the production-readiness of native-images. These bugs on the GraalVM issue tracker are identified by the spring label.

Some changes incubated here are moved directly to Spring Framework and Spring Boot projects.

Quick start

For detailed information and walkthroughs of applying the techniques to your project, please see the documentation.

Artifacts

The latest 0.8.1 release supports GraalVM 20.2.0 and Spring Boot 2.4.0-M3.

Play with the samples

  • Download and extract sources from the latest release.

  • Go into the samples folder and pick one (e.g. cd spring-graalvm-native-samples/commandlinerunner)

  • Run ./build.sh which will run a maven build, then a native image compile, then test the result.

build.sh runs the compile.sh script and in that compile script you can see the invocation of the native-image command. The other samples follow a similar model. For more details on the samples see the samples documentation.

Contributing

This project is in the spring-projects-experimental org indicating it is not as mature as other Spring projects. Contributions are welcome (maybe read the extension guide if thinking about extending it to support your project). However, please recognize we aren’t at the polishing javadoc stage and whilst pre 1.0 there may be heavy evolution of APIs.

Baseline

The development version on master is currently based on GraalVM 20.3.0-dev and Spring Boot 2.4.0-M3. Mac and Linux are supported, Windows is untested.

spring-graalvm-native's People

Contributors

aclement avatar buzzardo avatar christophstrobl avatar dsyer avatar fhanik avatar jkroepke avatar michael-simons avatar mminella avatar mykelangelo avatar sdeleuze avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.