Skip to content

Commit

Permalink
Upgrade to Spring Boot 2.3.0.M1
Browse files Browse the repository at this point in the history
Update CI and documentation as well to use GraalVM dev builds.

See spring-atticgh-45
  • Loading branch information
sdeleuze committed Jan 27, 2020
1 parent f69f499 commit d6d5974
Show file tree
Hide file tree
Showing 30 changed files with 113 additions and 75 deletions.
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -9,13 +9,11 @@ Once built, native images have very fast startup!

This feature supports:

- GraalVM 19.3.1 *1
- Spring Boot 2.2.X

*1 Some of the samples work with Graal 19.3.1, whilst some do not, we are working hard with the GraalVM team to address all issues on both sides.
- GraalVM 20.1 dev builds
- Spring Boot 2.3.0.M1

## Download Graal
To try it out, install GraalVM 19.3.1 from: [https://github.com/graalvm/graalvm-ce-builds/releases](),
To try it out, install [GraalVM 20.1.0-dev_20200125-1203](https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/20.1.0-dev_20200125-1203),
then once having set your `PATH` to that new java home, install `native-image` by running `gu install native-image`.

## Building the feature
Expand Down
41 changes: 40 additions & 1 deletion ci/build.sh
Expand Up @@ -2,6 +2,46 @@

set -e

# Beginning of GraalVM dev build install

GRAALVM_VERSION=20.1.0-dev
GRAALVM_BUILD=20200125-1203
JAVA_VERSION=java8
GRAALVM_PKG=https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${GRAALVM_VERSION}_${GRAALVM_BUILD}/graalvm-ce-${JAVA_VERSION}-linux-amd64-${GRAALVM_VERSION}.tar.gz

export ENV LANG=en_US.UTF-8
export JAVA_HOME=/opt/graalvm-ce-${JAVA_VERSION}-${GRAALVM_VERSION}/

yum update -y oraclelinux-release-el7 \
&& yum install -y oraclelinux-developer-release-el7 oracle-softwarecollection-release-el7 \
&& yum-config-manager --enable ol7_developer \
&& yum-config-manager --enable ol7_developer_EPEL \
&& yum-config-manager --enable ol7_optional_latest \
&& yum install -y bzip2-devel ed gcc gcc-c++ gcc-gfortran gzip file fontconfig less libcurl-devel make openssl openssl-devel readline-devel tar vi which xz-devel zlib-devel \
&& yum install -y glibc-static libcxx libcxx-devel libstdc++-static zlib-static

fc-cache -f -v

cp gu-wrapper.sh /usr/local/bin/gu

set -eux \
&& curl --fail --silent --location --retry 3 ${GRAALVM_PKG} \
| gunzip | tar x -C /opt/ \
&& mkdir -p "/usr/java" \
&& ln -sfT "$JAVA_HOME" /usr/java/default \
&& ln -sfT "$JAVA_HOME" /usr/java/latest \
&& for bin in "$JAVA_HOME/bin/"*; do \
base="$(basename "$bin")"; \
[ ! -e "/usr/bin/$base" ]; \
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
done \
&& chmod +x /usr/local/bin/gu

java -version
gu install native-image

# End of GraalVM dev build install

npm install tty-table -g
yum install -y unzip wget procps bc perl util-linux golang git

Expand All @@ -12,7 +52,6 @@ wget https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-m
unzip apache-maven-3.5.3-bin.zip
export PATH=$PATH:`pwd`/apache-maven-3.5.3/bin:/root/go/bin:/opt/graalvm-ce-java8-19.3.1/jre/languages/js/bin

gu install native-image
cd spring-graal-native
./build-feature.sh
./build-key-samples.sh
4 changes: 2 additions & 2 deletions ci/build.yml
Expand Up @@ -4,8 +4,8 @@ platform: linux
image_resource:
type: docker-image
source:
repository: oracle/graalvm-ce
tag: 19.3.1-java8
repository: oraclelinux
tag: 7-slim

inputs:
- name: spring-graal-native
Expand Down
30 changes: 30 additions & 0 deletions ci/gu-wrapper.sh
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
#
# LICENSE UPL 1.0
#
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
#

$JAVA_HOME/bin/gu "${@}"
RT=$?
if [ $RT -ne 0 ]; then
exit $RT
fi

# Only run on *install operations
if [[ "$@" == *"install"* ]]; then

# Add new links for newly installed components
for bin in "$JAVA_HOME/bin/"*; do
base="$(basename "$bin")";
if [[ ! -e "/usr/bin/$base" ]]; then
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000;
fi
done;

# Remove dead links from uninstalled components
find /usr/bin -xtype l -delete

echo "Refreshed alternative links in /usr/bin/"
fi

2 changes: 1 addition & 1 deletion spring-graal-native-feature/pom.xml
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
6 changes: 6 additions & 0 deletions spring-graal-native-feature/src/main/resources/reflect.json
Expand Up @@ -1703,5 +1703,11 @@
{
"name": "reactor.core.publisher.Traces$ExceptionCallSiteSupplierFactory",
"allDeclaredConstructors": true
},
// Boot 2.3.0.M1
{
"name": "org.springframework.boot.context.properties.BoundConfigurationProperties",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
}
]
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath />
</parent>
<groupId>com.example</groupId>
Expand Down
4 changes: 0 additions & 4 deletions spring-graal-native-samples/commandlinerunner/agent/4patch.sh

This file was deleted.

5 changes: 1 addition & 4 deletions spring-graal-native-samples/commandlinerunner/agent/build.sh
Expand Up @@ -9,11 +9,8 @@
# Run the application with the agent to populate the configuration files
../../../3runWithAgent.sh

# Patch in the missing entries to that configuration
../../../4patch.sh

# Run native image to compile the application
../../../5compile.sh
../../../4compile.sh

# Test the application

Expand Down
2 changes: 1 addition & 1 deletion spring-graal-native-samples/commandlinerunner/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
Expand Down
24 changes: 9 additions & 15 deletions spring-graal-native-samples/jafu-webmvc/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
Expand All @@ -22,19 +22,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>graal-hotspot-library</artifactId>
<version>19.3.0</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -60,10 +47,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>graal-hotspot-library</artifactId>
<version>19.3.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.fu</groupId>
<artifactId>spring-fu-autoconfigure-adapter</artifactId>
<version>0.2.2</version>
<version>0.3.0.M1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Expand Up @@ -7,14 +7,12 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.context.MessageSourceInitializer;
import org.springframework.boot.autoconfigure.http.HttpProperties;
import org.springframework.boot.autoconfigure.web.ResourceProperties;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.servlet.ResourceConverterInitializer;
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerInitializer;
import org.springframework.boot.autoconfigure.web.servlet.StringConverterInitializer;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties;
import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
Expand All @@ -31,8 +29,6 @@ public class JafuApplication {

private ServerProperties serverProperties = new ServerProperties();

private HttpProperties httpProperties = new HttpProperties();

private WebMvcProperties webMvcProperties = new WebMvcProperties();

private ResourceProperties resourceProperties = new ResourceProperties();
Expand All @@ -46,7 +42,7 @@ protected JafuApplication() {
serverProperties.setPort(8080);
new StringConverterInitializer().initialize(context);
new ResourceConverterInitializer().initialize(context);
new ServletWebServerInitializer(serverProperties, httpProperties, webMvcProperties, resourceProperties).initialize(context);
new ServletWebServerInitializer(serverProperties, webMvcProperties, resourceProperties).initialize(context);
};
}

Expand Down
2 changes: 0 additions & 2 deletions spring-graal-native-samples/jafu-webmvc/tomcat-resource.json
@@ -1,6 +1,5 @@
{
"bundles":[
{"name":"javax.el.LocalStrings"},
{"name":"javax.servlet.LocalStrings"},
{"name":"javax.servlet.http.LocalStrings"},
{"name":"org.apache.catalina.authenticator.LocalStrings"},
Expand Down Expand Up @@ -28,7 +27,6 @@
{"name":"org.apache.coyote.http11.filters.LocalStrings"},
{"name":"org.apache.coyote.http11.upgrade.LocalStrings"},
{"name":"org.apache.coyote.http2.LocalStrings"},
{"name":"org.apache.el.Messages"},
{"name":"org.apache.naming.LocalStrings"},
{"name":"org.apache.naming.factory.LocalStrings"},
{"name":"org.apache.naming.factory.webservices.LocalStrings"},
Expand Down
4 changes: 2 additions & 2 deletions spring-graal-native-samples/jafu/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>org.springframework.fu</groupId>
<artifactId>spring-fu-autoconfigure-adapter</artifactId>
<version>0.2.2</version>
<version>0.3.0.M1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
8 changes: 1 addition & 7 deletions spring-graal-native-samples/kotlin-webmvc/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand All @@ -23,12 +23,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand Down
@@ -1,6 +1,5 @@
{
"bundles":[
{"name":"javax.el.LocalStrings"},
{"name":"javax.servlet.LocalStrings"},
{"name":"javax.servlet.http.LocalStrings"},
{"name":"org.apache.catalina.authenticator.LocalStrings"},
Expand Down Expand Up @@ -29,7 +28,6 @@
{"name":"org.apache.coyote.http11.filters.LocalStrings"},
{"name":"org.apache.coyote.http11.upgrade.LocalStrings"},
{"name":"org.apache.coyote.http2.LocalStrings"},
{"name":"org.apache.el.Messages"},
{"name":"org.apache.naming.LocalStrings"},
{"name":"org.apache.naming.factory.LocalStrings"},
{"name":"org.apache.naming.factory.webservices.LocalStrings"},
Expand Down
2 changes: 1 addition & 1 deletion spring-graal-native-samples/logger/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
2 changes: 1 addition & 1 deletion spring-graal-native-samples/messages/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
6 changes: 5 additions & 1 deletion spring-graal-native-samples/spring-petclinic-jpa/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath />
</parent>
<name>spring-petclinic-jpa</name>
Expand Down Expand Up @@ -64,6 +64,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
Expand Down
@@ -1,7 +1,6 @@
{
"bundles": [
{"name":"messages.messages"},
{"name":"javax.el.LocalStrings"},
{"name":"javax.servlet.LocalStrings"},
{"name":"javax.servlet.http.LocalStrings"},
{"name":"org.apache.catalina.authenticator.LocalStrings"},
Expand Down Expand Up @@ -30,7 +29,6 @@
{"name":"org.apache.coyote.http11.filters.LocalStrings"},
{"name":"org.apache.coyote.http11.upgrade.LocalStrings"},
{"name":"org.apache.coyote.http2.LocalStrings"},
{"name":"org.apache.el.Messages"},
{"name":"org.apache.naming.LocalStrings"},
{"name":"org.apache.naming.factory.LocalStrings"},
{"name":"org.apache.naming.factory.webservices.LocalStrings"},
Expand Down
2 changes: 1 addition & 1 deletion spring-graal-native-samples/springmvc-tomcat/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<version>2.3.0.M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down
@@ -1,6 +1,5 @@
{
"bundles":[
{"name":"javax.el.LocalStrings"},
{"name":"javax.servlet.LocalStrings"},
{"name":"javax.servlet.http.LocalStrings"},
{"name":"org.apache.catalina.authenticator.LocalStrings"},
Expand Down Expand Up @@ -29,7 +28,6 @@
{"name":"org.apache.coyote.http11.filters.LocalStrings"},
{"name":"org.apache.coyote.http11.upgrade.LocalStrings"},
{"name":"org.apache.coyote.http2.LocalStrings"},
{"name":"org.apache.el.Messages"},
{"name":"org.apache.naming.LocalStrings"},
{"name":"org.apache.naming.factory.LocalStrings"},
{"name":"org.apache.naming.factory.webservices.LocalStrings"},
Expand Down

0 comments on commit d6d5974

Please sign in to comment.