Skip to content

Commit

Permalink
Upgrade GraalVM to 21.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
  • Loading branch information
tomas-langer committed Feb 18, 2021
1 parent cec5c99 commit c589951
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<version.lib.failsafe>2.3.1</version.lib.failsafe>
<version.lib.google-api-client>1.30.11</version.lib.google-api-client>
<version.lib.google-error-prone>2.3.3</version.lib.google-error-prone>
<version.lib.graalvm>20.2.0</version.lib.graalvm>
<version.lib.graalvm>21.0.0</version.lib.graalvm>
<version.lib.graphql-java>15.0</version.lib.graphql-java>
<version.lib.graphql-java.extended.scalars>15.0.0</version.lib.graphql-java.extended.scalars>
<version.lib.grpc>1.35.0</version.lib.grpc>
Expand Down
6 changes: 3 additions & 3 deletions docs/common/guides/graalnative.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2020 Oracle and/or its affiliates.
Copyright (c) 2020, 2021 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ In this guide you will learn how to build a native image locally on your machine
|===
|About 10 minutes
| <<about/03_prerequisites.adoc,Helidon Prerequisites>>
| GraalVM CE https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-20.2.0[20.2.0]
| GraalVM CE https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.0.0[21.0.0]
|===
== Install GraalVM and the Native Image Command
Expand All @@ -41,7 +41,7 @@ set the `GRAALVM_HOME` environment variable to point at your GraalVM installatio
[source,bash]
----
# Your path might be different
export GRAALVM_HOME=/usr/local/graalvm-ce-20.2.0/Contents/Home/
export GRAALVM_HOME=/usr/local/graalvm-ce-21.0.0/Contents/Home/
----
Then install the optional `native-image` command:
Expand Down
40 changes: 3 additions & 37 deletions etc/dependency-check-suppression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,59 +53,25 @@
<cpe>cpe:/a:java-websocket_project:java-websocket</cpe>
</suppress>


<!-- GraalVM -->
<!-- JDK CVE for remote code execution in Java Web Start and applets running untrusted code.
Does not apply to our use of GraalVM -->
<suppress>
<notes><![CDATA[
file name: graal-sdk-20.2.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.sdk/graal\-sdk@.*$</packageUrl>
<cve>CVE-2020-14803</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: objectfile-20.2.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.nativeimage/objectfile@.*$</packageUrl>
<cve>CVE-2020-14803</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: pointsto-20.2.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.nativeimage/pointsto@.*$</packageUrl>
<cve>CVE-2020-14803</cve>
</suppress>
<suppress>
<notes><![CDATA[
file name: svm-20.2.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.nativeimage/svm@.*$</packageUrl>
<cve>CVE-2020-14803</cve>
</suppress>


<!-- GraalVM -->
<!-- This suppresses multiple CVEs related to old versions of the JDK -->
<suppress>
<notes><![CDATA[
file name: truffle-nfi-20.2.0.jar
file name: truffle-nfi-21.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.truffle/truffle\-nfi@.*$</packageUrl>
<cpe>cpe:/a:oracle:graalvm</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: truffle-nfi-20.2.0.jar
file name: truffle-nfi-21.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.truffle/truffle\-nfi@.*$</packageUrl>
<cpe>cpe:/a:oracle:openjdk</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: truffle-nfi-20.2.0.jar
file name: truffle-nfi-21.0.0.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.graalvm\.truffle/truffle\-nfi@.*$</packageUrl>
<cpe>cpe:/a:sun:openjdk</cpe>
Expand Down
6 changes: 3 additions & 3 deletions etc/dockerfiles/Dockerfile.jdk11-graalvm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,7 +55,7 @@ RUN set -x \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log

# BEGIN PRE-REQUISITES FOR STATIC NATIVE IMAGES FOR GRAAL 20.2.0
# BEGIN PRE-REQUISITES FOR STATIC NATIVE IMAGES FOR GRAAL
# SEE: https://www.graalvm.org/reference-manual/native-image/StaticImages/
ARG RESULT_LIB="/staticlibs"

Expand Down Expand Up @@ -85,7 +85,7 @@ RUN curl -L -o zlib.tar.gz https://zlib.net/zlib-1.2.11.tar.gz && \
cd / && \
rm -rf /zlib && \
rm -f /zlib.tar.gz
#END PRE-REQUISITES FOR STATIC NATIVE IMAGES FOR GRAAL 20.2.0
#END PRE-REQUISITES FOR STATIC NATIVE IMAGES FOR GRAAL

WORKDIR /graal
COPY --from=build /build/graalvm /graal/graalvm
Expand Down
2 changes: 1 addition & 1 deletion etc/dockerfiles/Dockerfile.jdk11-graalvm-maven
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
30 changes: 30 additions & 0 deletions etc/dockerfiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Upgrading GraalVM version

## Maven dependency
Go to `dependencies/pom.xml` and update the property `version.lib.graalvm` to the desired version.

This defines the dependencies used by Helidon native image feature used during native image build.

## Docker images
In `etc/dockerfiles`, update the version:

1. `build.sh` - update the `GRAALVM_VERSION` variable to the desired version
2. `Dockerfile.jdk11-graalvm` update the curl command to point to the correct tar
3. `Dockerfile.jdk11-graalvm-maven` update the `FROM` command to use the latest image
4. Run `build.sh` to create the docker images and push them to docker hub

## Examples
Fix `Dockerfile.native` and `README.md` in all examples that have them.

Update `FROM helidon/jdk11-graalvm-maven:version as build` to the desired version in Dockerfile.

## Examples
Fix `Dockerfile.native.mustache` and `README.md` in all archetypes that have them.

Update `FROM helidon/jdk11-graalvm-maven:version as build` to the desired version in Dockerfile.

## Documentation
Update `docs/common/guides/graalnative.adoc` - fix link and file name

## Tests
Update `etc/scripts/test-integ-mysql.sh` and `etc/scripts/test-integ-pgsql.sh` to use the desired version
2 changes: 1 addition & 1 deletion etc/dockerfiles/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions etc/scripts/test-integ-mysql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex
#
# Copyright (c) 2018, 2020 Oracle and/or its affiliates.
# Copyright (c) 2018, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,7 @@ readonly WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)

source ${WS_DIR}/etc/scripts/pipeline-env.sh

JAVA_HOME='/tools/graalvm-ce-java11-20.2.0'
JAVA_HOME='/tools/graalvm-ce-java11-21.0.0'
PATH="${PATH}:${JAVA_HOME}/bin"

mvn ${MAVEN_ARGS} --version
Expand Down
4 changes: 2 additions & 2 deletions etc/scripts/test-integ-pgsql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex
#
# Copyright (c) 2018, 2020 Oracle and/or its affiliates.
# Copyright (c) 2018, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,7 @@ readonly WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)

source ${WS_DIR}/etc/scripts/pipeline-env.sh

JAVA_HOME='/tools/graalvm-ce-java11-20.2.0'
JAVA_HOME='/tools/graalvm-ce-java11-21.0.0'
PATH="${PATH}:${JAVA_HOME}/bin"

mvn ${MAVEN_ARGS} --version
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstarts/helidon-quickstart-mp/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates.
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
4 changes: 2 additions & 2 deletions examples/quickstarts/helidon-quickstart-se/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates.
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates.
# Copyright (c) 2019, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#

# 1st stage, build the app
FROM helidon/jdk11-graalvm-maven:20.2.0 as build
FROM helidon/jdk11-graalvm-maven:21.0.0 as build

WORKDIR /helidon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020 Oracle and/or its affiliates.
* Copyright (c) 2019, 2021 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;

import org.dom4j.DocumentFactory;
import org.hibernate.engine.jndi.spi.JndiService;
import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform;

Expand All @@ -36,6 +37,12 @@
*/
@ApplicationScoped
public class CDISEJtaPlatform extends AbstractJtaPlatform {
static {
// this is needed for native image, since 21.0.0
// as the document factory gets initialized lazily and that causes
// native image to fail. This way we force eager initialization
DocumentFactory.getInstance();
}

private final TransactionManager transactionManager;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Oracle and/or its affiliates.
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,8 @@
requires jakarta.inject.api;
requires jakarta.enterprise.cdi.api;
requires org.hibernate.orm.core;
// needed only for native image, transitive dependency of hibernate-core
requires dom4j;

exports io.helidon.integrations.cdi.hibernate;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates.
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,4 +35,5 @@ Args= --allow-incomplete-classpath \
--initialize-at-run-time=oracle.net.nt.TcpMultiplexer \
--initialize-at-run-time=oracle.net.nt.TcpMultiplexer$LazyHolder \
--initialize-at-run-time=oracle.jdbc.driver.SQLUtil$XMLFactory \
--initialize-at-run-time=oracle.jdbc.driver.NamedTypeAccessor$XMLFactory
--initialize-at-run-time=oracle.jdbc.driver.NamedTypeAccessor$XMLFactory \
--initialize-at-run-time=oracle.xml.util.UnicodeUtil

0 comments on commit c589951

Please sign in to comment.