Migrate early, migrate often! JDK release cadence strategies Dan - - PowerPoint PPT Presentation

migrate early migrate often jdk release cadence strategies
SMART_READER_LITE
LIVE PREVIEW

Migrate early, migrate often! JDK release cadence strategies Dan - - PowerPoint PPT Presentation

Migrate early, migrate often! JDK release cadence strategies Dan Heidinga Theresa Mammarella Eclipse OpenJ9 Project Lead Eclipse OpenJ9 Software Developer Interpreter Lead, IBM Runtimes @t_mammarella @danheidinga theresa-m DanHeidinga Who


slide-1
SLIDE 1

Dan Heidinga Eclipse OpenJ9 Project Lead Interpreter Lead, IBM Runtimes @danheidinga DanHeidinga

Migrate early, migrate often! JDK release cadence strategies

Theresa Mammarella Eclipse OpenJ9 Software Developer @t_mammarella theresa-m

slide-2
SLIDE 2

§ Theresa Mammarella § Software developer on Runtimes at IBM, OpenJ9 § Computer Engineering at University of British Columbia

2

Who am I?

slide-3
SLIDE 3

3

Important disclaimers

§ THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. § WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION

CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.

§ ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED

  • ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR

INFRASTRUCTURE DIFFERENCES.

§ ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. § IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT

PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.

§ IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT

OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.

§ NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: – CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS

OR THEIR SUPPLIERS AND/OR LICENSORS

slide-4
SLIDE 4

§ The brave new world of Java § Always be migrating § Continuous migration strategies

4

Outline

slide-5
SLIDE 5

5

Historical Java release model

2005 2010 2015 2020 2025

Java 6 Java 7 Java 8 6 years, 4 months 3 years, 9 months 8 years, 6 months

slide-6
SLIDE 6

Java 9 (09/2017) Java 10 (03/2018) Java 11 (09/2018) Java 12 (03/2019) Java 17 (09/2021)

6

Brave new world

slide-7
SLIDE 7

7

  • Author(s): Videoplasty.com
  • Man on a Treadmill Cartoon.svg from Wikimedia Commons
  • License: Creative Commons Attribution-ShareAlike 4.0
slide-8
SLIDE 8

Java 9 (09/2017) Java 10 (03/2018) Java 11 (09/2018) Java 12 (03/2019) Java 17 (09/2021)

8

6 month release cadence

slide-9
SLIDE 9

LTS = Long Term Support?

9

slide-10
SLIDE 10

Java 9 (09/2017) Java 10 (03/2018) Java 11 LTS (09/2018) Java 12 (03/2019) Java 17 LTS (09/2021)

10

LTS: up to the community

slide-11
SLIDE 11

Prebuilt OpenJDK binaries adoptopenjdk.net Docker Hub hub.docker.com/u/adoptopenjdk

11

slide-12
SLIDE 12

12

… bugs will be fixed on a “best effort” basis … … for higher levels of assurance you should contact commercial companies offering support … Support Levels

slide-13
SLIDE 13

13

IBM Support for OpenJDK with Eclipse OpenJ9

LoopBack

IBM Foundation Support for Runtimes

  • Language Runtime
  • Developer and Monitoring tools
  • Docker and Kubernetes support

IBM Advanced Support for Runtime Frameworks

  • Web Frameworks
  • Key module dependencies*

WITH

generator-nodeserver generator-swiftserver

* Supported module list is expected to grow over time.

slide-14
SLIDE 14

“eat the elephant a bite at a time” § The gap between LTS releases is HUGE § How can an application keep up? –Move to a stable base –Track changes in 6 month pieces

14

Always be migrating

slide-15
SLIDE 15

“the best time to plant a tree is either 20 years ago or today” § Migration 6-7-8 is mostly smooth § Java 8 is the oldest stable base you should use, support through 2025 § By not upgrading you are leaving performance improvements on the table!

15

Migrate to a stable base: Java 8

slide-16
SLIDE 16

Major ecosystem changes! § Java Platform Module System makes internal APIs inaccessible § API elements are deprecated for removal (Java EE, Corba and more) § Version system has changed, URLClassLoader is replaced, Etc.

16

Track future changes: Java 9

slide-17
SLIDE 17

@Deprecated § Element is dangerous or a better alternative exists, use is discouraged @Deprecated(since="9") § Since(): Release in which API element was deprecated @Deprecated(since="1.4", forRemoval=true) § forRemoval(): Marked true if API element will be removed in a future release

17

JEP 277: Enhanced Deprecation

slide-18
SLIDE 18

18

Continuous integration pipeline

Setup (Java 8) Build (Java 8) Test (Java 8)

slide-19
SLIDE 19

§ Pay attention to warnings! § Fixing them gets you clean on the current release § Treat warnings as errors so build will fail if warnings are present

19

javac warnings

javac -Werror

slide-20
SLIDE 20

20

Continuous migration strategies

Setup (Java 8) Build (Java 8) Test (Java 8) Build (Java 11) Setup (Java 11) Test (Java 11)

slide-21
SLIDE 21

21

Continuous migration strategies

Setup Build Test Migration checks

slide-22
SLIDE 22

JDEPS = Java Class Dependency Analyzer § Java 8+ JDKs § Analyzes the dependencies by class or package (default) level § Not just for migrating to modularity!

22

jdeps Overview

slide-23
SLIDE 23

23

Demo

github.com/theresa-m/migrateearly-demo hub.docker.com/u/adoptopenjdk

slide-24
SLIDE 24

24

jdeps docker stage

Setup Build Test Migration checks

slide-25
SLIDE 25

§ Java 9+ JDKs § Scans jar/class files to identify deprecated API elements § Deprecated elements may cause behavioral issues or be removed

25

jdeprscan Overview

slide-26
SLIDE 26

26

Demo

github.com/theresa-m/migrateearly-demo hub.docker.com/u/adoptopenjdk

slide-27
SLIDE 27

27

Continuous migration strategies

Setup Build Test jdeps jdeprscan

slide-28
SLIDE 28

28

Multi-release JAR files

§ Java 9+ SDKs § Enables JAR files to support multiple Java versions § Combination of shared and version specific classes sun.misc.Unsafe to java.lang.invoke.VarHandle

slide-29
SLIDE 29

29

Multi-release JAR files

DemoApp.jar

  • migrate
  • early
  • Demo.class
  • DemoRunnable.class
  • META-INF
  • MANIFEST.MF
slide-30
SLIDE 30

30

Multi-release JAR files

MultiReleaseDemoApp.jar

  • migrate
  • early
  • Demo.class
  • VersionedCode.class
  • DemoRunnable.class
  • META-INF
  • MANIFEST.MF
  • versions
  • 9
  • VersionedCode.class

DemoApp.jar

  • migrate
  • early
  • Demo.class
  • DemoRunnable.class
  • META-INF
  • MANIFEST.MF
slide-31
SLIDE 31

§ Expect to run parallel CI pipeline at least once every 6 months § Run jdeps & jdeprscan as part of every build to prevent new regressions § Use multi-release jars if no workaround for current and latest versions

31

Summarize the strategies

slide-32
SLIDE 32

§ The Java ecosystem is delivering innovation faster than ever before! § The free lunch is over. Migrate early, migrate often § Even on an LTS, use the JDK tools to prepare for the next migration

32

Key points to take away

slide-33
SLIDE 33

Evaluate the Sessions

  • 1 0 +1

Sign in and vote at eclipsecon.org