SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
Better, Stronger, Faster Java in the Cloud
All Things Open 2022
Harry L. Hoots III, Jarek Gawor
Who we are
Harry L. Hoots III
hlhoots@us.ibm.com
Jarek Gawor
jgawor@us.ibm.com
Agenda
This presentation outlines
the challenges faced by
developers, and presents
innovative solutions to
meet the demands of
cloud native Java
– The Java ecosystem
– Developer experience
– Challenges in the cloud
• Liberty InstantOn
– Demos
3
The Java Ecosystem
Java remains the
language of choice for
many developers. And
this is attributed to the
vast number of libraries
and tools available to
developers. Along with
reliable and performant
runtime engines.
– Widely adopted and used from 1996 to the
present in the industry
• My first Java experience was the Beta v2.0 in
college
– Vibrant open source community
• OS Libraries
• OS Tools and Frameworks
– Fast paced innovation in open standards
• Java9 – 6 month releases
– Java is here to stay, thus optimization your apps
and workloads that run in the Cloud is essential.
4
Developer Experience
The key to success in a
fast-moving world of cloud
computing is enhancing
developer experience.
This increases
productivity while
enabling greater
innovation.
– Monolith to Microservices in the Cloud
• Requires evolving the Dev Org and
Delivery process as Cloud-Native is much
more that replicating your traditional
setup in the Cloud.
– Developer experience improves developer
efficiency and fosters innovation.
– What you'll need for Developer efficiency:
• Open cloud-native APIs
• Quality runtime and Development tools
5
6
Cloud-native with Open Liberty
7
A lightweight framework for building fast and
efficient cloud-native Java applications. Open
Liberty is a flexible runtime that provides an
end-to-end cloud-native experience
Developer friendly:
• Just enough runtime; composable
• Zero Migration; no app code or configuration
change to move to newest release
• API Rich : Jakarta EE, Java EE, MicroProfile,
Spring Boot
• Cloud ready; production-ready container
images
• Immediate feedback with Open Liberty Dev
mode
Plan
Code
Build
Test
Release
Deploy
Run
Monitor
Security
Continuous
Integration
Continuous
Delivery
Open Liberty Development tools
Build
Edit
Test
Debug
Dev Mode
Local |
Containers
Hot Code
Replace
Testcontainers
Leading IDEs
Fast, iterative
development
Unit, Integration &
In-container testing
Editing support
for APIs and
configuration
Server Config
Docker/Containerfile
Deployment YAMLs
start.openliberty.io
New
Commit
Push
Code
What is Dev mode ?
• Allows you to develop apps with any
text editor or IDE by providing:
• Hot reload and deployment of
source or config changes.
• On demand testing or auto test
• Debugger support
• Local and Local Container
support
Why Dev mode ?
• Automatic compile and deploy to
your running server; easy to iterate
on your changes, and save time!
Liberty Tools:
• IntelliJ, Eclipse, VS Code IDE support
• Maven and Gradle build automation
support.
start.openliberty.io
• Starter application generation
9
Dev Mode Demo
Challenges in the era of
Cloud-native
The shift to cloud-native has
changed the demands placed
on the underlying JVM
technologies that drive
application frameworks and
runtimes
– Serverless computing
– Cloud economics
– Cloud native JVM
10
Cloud Economics
11
Cloud providers offer a pay-as-you go pricing model
based on CPU and memory usage. Businesses built
on the cloud need the ability to scale up to meet
rising demands, and scale down when demand
reduces is crucial for success.
Requirements:
• Scale-to-zero
• Low memory usage
• Minimal latency – fast startup
Cloud
Native
JVM
Legacy
JVM
Doing more with less!
Cloud Native Runtimes
12
The JVM was designed with portability and
flexibility in mind
• This meant that bytecodes were loaded lazily and
optimized while the application was running
• The result was slower startup times but high peak
throughput
• The cloud demands a shift in the performance
characteristics of JVMs and finding the right balance
Solutions:
• Dynamic AOT compilation and class
metadata persistence
• Static compilation – native image
Native Image
JDK
Startup time
Peak performance
Total image footprint
Fast build time
Usability
Liberty InstantOn
Liberty InstantOn is a holistic
solution that provides fast
startup without compromise.
• Use Checkpoint / Restore
• CRIU Project - https://criu.org
• Linux technology used to freeze a running process state
• Checkpoint state used to restore an application
– Semeru Runtimes
– Checkpoint/Restore with Semeru InstantOn
– Where to checkpoint?
– Container support
13
Semeru Runtimes
14
IBM Semeru Runtimes is a production-ready JDK
based on the Eclipse OpenJ9 JVM. The OpenJ9
JVM is designed with memory efficiency and startup
performance in mind. OpenJ9 continues to innovate
by introducing new features like CRIU Support
which is the basis of Semeru InstantOn and Liberty
InstantOn.
Key features:
• Broad platform support
• Tuned for the cloud
• Zero usage restrictions
Containers
Semeru InstantOn
Liberty InstantOn
MicroProfile Application
Semeru InstantOn
15
OpenJ9 CRIU Support provides third alternative
between static compilation and traditional JVMs in
the form of checkpoint and restore. It offers fast
startup while keeping the benefits of traditional
JVMs
- Dynamic loading
- Advanced JIT and GC
- Not closed world
- Run existing applications and libraries unchanged
Workflow:
• Checkpoint run at build phase
• Restore run in deployment
Traditional Run
JVM
startup
Application
initialization
Application
ready state
Build phase
Deployment run
Initiate
restore
checkpoint image
time
startup time application running
much faster
startup!
16
Where to checkpoint?
17
Liberty InstantOn leverages Semeru to provide a
seamless checkpoint/restore solution for
developers. With checkpoint restore, there is a
tradeoff between startup time and the complexity of
the restore.
Checkpoint phases:
• features
• deployment
• applications
Kernel
start and
feature runtime
processing
Process
application
Start
application
Accept
requests
Applications
Deployment
Features
Later
checkpoint
==
Faster
restore
time
Later
checkpoint
==
More
complexity
300 – 2200ms
100 – 3000ms
0 – ???ms
Container support
18
Liberty InstantOn provides tools for users to easily
create container images with their checkpointed
applications for fast startup in the cloud.
Steps:
• Build application image
build
FROM icr.io/appcafe/open-liberty:beta-checkpoint
COPY --chown=1001:0 server.xml /config/server.xml
COPY --chown=1001:0 demo.war
/config/dropins/demo.war
RUN configure.sh
Dockerfile
podman build -t demo-application .
Container support
19
Liberty InstantOn provides tools for users to easily
create container images with their checkpointed
applications for fast startup in the cloud.
Steps:
• Build application image
• Run application to checkpoint in container
run checkpoint
podman run 
--name demo-checkpoint-container 
--privileged 
--env WLP_CHECKPOINT=applications 
demo-application
Container support
20
Liberty InstantOn provides tools for users to easily
create container images with their checkpointed
applications for fast startup in the cloud.
Steps:
• Build application image
• Run application to checkpoint in container
• Commit container to checkpoint image
commit
podman commit 
demo-checkpoint-container 
demo
Container support
21
Liberty InstantOn provides tools for users to easily
create container images with their checkpointed
applications for fast startup in the cloud.
Steps:
• Build application image
• Run application to checkpoint in container
• Commit container to checkpoint image
• Restore checkpointed image
restore
podman run 
--cap-add=CHECKPOINT_RESTORE 
--cap-add=NET_ADMIN 
--cap-add=SYS_PTRACE 
demo
22
Demos
Semeru: CRIU Support API
23
org.eclipse.openj9.criu.CRIUSupport.checkpo
intJVMImpl
– Java API that allows a user to specify the various
arguments that gets used by the native CRIU API
criu_dump() and the associated setup using the
routines such as criu_init_opts()
• Allows options to be set at the CRIU level
– Examples : logging, image directory, etc.
• Helpful error codes in case something goes wrong
• Allows Liberty to register a prepare and restore
hook to perform compensations so that the user
application does not need to
• Performs several key compensations within JVM
JVM
Liberty and the
JVM stack up on
top of CRIU at
the framework
and JDK layers
to shield your
application
from
complexities of
CRIU
CRIU
Liberty
User
application
Uses the JVM’s
checkpointJVM
Impl API to
control CRIU
Uses CRIU native
APIs from within
the JVM
Does not need
awareness of
anything CRIU
related!
Semeru: CRIU Support
Pre-checkpoint hooks
24
JVM’s CRIU Support offers hooks for Liberty to
participate in preparing for a checkpoint taking
CRIU behaviors into account so that it works as
expected after a restore
Pre-checkpoint hooks:
• Liberty and JVM run different hook methods to
prepare for taking a checkpoint
• Example: close some file handles
• All the hooks are run on a single thread before
the checkpoint is generated
Application Threads
Hook Thread
Initiate checkpoint
Checkpoint JVM
Semeru: CRIU Support
Post-restore hooks
25
JVM’s CRIU Support offers hooks for Liberty to
participate in recovering application state after a
CRIU restore
Post restore Hooks:
• Modify JVM state to compensate for new env
• Example: Re-open file handles that were
closed in pre-checkpoint hook
• Run post-restore hooks in single thread mode
and then resume all application threads
afterwards from where the checkpoint was done
Application Threads
Hook Thread
Restore JVM
Initiate JVM
restore
Semeru: CRIU Support
Compensations
26
CRIU Support compensates for adverse effects that
may occur when the JVM is restored. This feature
offers users guarantees (security and functional)
about expectations of JVM state upon restore
Compensations that are handled by the JVM:
• Environment variables
• Time sensitive APIs
• Security stack (SSL, SecureRandom)
JVM
JVM
JVM
Checkpoint
Environment
Restore
Environment
Semeru: Compensation for
environment variables
27
Problem: CRIU freezes the env var space as it was
when the process was checkpointed
Consequence: Env vars set in the restore environment
are not picked up by CRIU
Compensation: JVM reads relevant env vars from a
new file specified by the user
CRIUSupport.RegisterRestoreEnvFile() on
restore
Easy to set values for env vars not used before restore
For env vars used before restore
• Mutable: pick up new values since app can cope
• Immutable: exception it changed, app cannot cope
JVM
Create env var
file with
export
ENV2=value2
Checkpoint
Environment
Restore
Environment
JVM
export
ENV1=value1
JVM
Mutable case
export
ENV1=value1
JVM
Immutable
case
export
ENV1=value1
JVM
Mutable case
Create env var
file with
export
ENV1=value2
JVM
Immutable
case
Create env var
file with
export
ENV1=value2
Unexpected
Exception
changing
immutable
env var
Works
as expected
Works
as expected
Semeru: Compensation for
time APIs
28
Problem: Time between checkpoint and restore is
counted towards elapsed time
Consequence: Time appears to have passed even
though the process was paused between checkpoint
and restore
Compensation: JVM compensates by subtracting
elapsed time between checkpoint and restore
• System.nanoTime, Object.wait, Unsafe.park have
all been changed to compensate
• System.currentTimeMillis cannot be compensated
similarly, so avoid using to measure elapsed time
across checkpoint restore operation or use
System.nanoTime
JVM
elapsedTime =
System.nanoTi
me() -
startTime;
Checkpoint
Environment
Restore
Environment
JVM
startTime =
System.nanoTi
me();
JVM
Object.wait(10
00); // trigger if
1 second
passes
JVM
startTime2 =
System.current
TimeMillis();
JVM
Object.wait(10
00); // trigger
after 1 second
ignoring
paused state
J
JVM
elapsedTime2
=
System.current
TimeMillis() –
startTime2;
Unexpected
Elapsed time
includes
paused time
Works
as expected
Works
as expected
Semeru: Compensation for
Random APIs
29
JVM
r.setSeed(s1);
val =
r.nextInt();
Checkpoint
Environment
Restore
Environment
JVM
r = new
Random();
val = r.nextInt()
JVM
r.setSeed(s2);
val =
r.nextInt();
JVM
r.setSeed(s3);
val =
r.nextInt();
Works
as expected
Works
as expected
Works
as expected
Problem: Random and SecureRandom seeds are initialized at
creation time
Consequence: Entropy guarantees from Random and
SecureRandom may not be met if restored several times
Compensation: JVM compensates by changing the random seed
on every restore
• Random and SecureRandom objects will re-seeded
independently in each restore
• Entropy guarantees will be met after restore since each
object will be re-seeded independently on restore and hence
generate random number sequences distinct from each
other
• Future: offer API for application to opt out of compensation
for some objects
Summary
Adapting and thriving in the cloud
requires evolving your
development, deployment and and
runtime for a cloud-native world
Liberty is a versatile runtime
for these purposes
InstantOn is a key capability
that makes Liberty a great runtime
for serverless use cases
– http://ibm.biz/InstantOn_HowToBlog
– https://openliberty.io
– https://github.com/eclipse-openj9/openj9
– https://blog.openj9.org/2022/09/26/getting-started-with-
openj9-criu-support
– https://github.com/ibmruntimes/semeru17-ea-
binaries/releases
30
31
Thank you

Contenu connexe

Similaire à No Compromise - Better, Stronger, Faster Java in the Cloud

Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
oci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfoci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfNandiniSinghal16
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle ManagementAmazon Web Services
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service OverviewKyle Brown
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterAmazon Web Services
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinDiego Garber
 
Continuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerContinuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerAmazon Web Services
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015WaveMaker, Inc.
 
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)PROIDEA
 
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxDeploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxJamie Coleman
 
IBM JavaOne Community Keynote 2017
IBM JavaOne Community Keynote 2017IBM JavaOne Community Keynote 2017
IBM JavaOne Community Keynote 2017John Duimovich
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийVitebsk Miniq
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsRightScale
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with DockerLaura Frank Tacho
 
Codecamp 2020 microservices made easy workshop
Codecamp 2020 microservices made easy workshopCodecamp 2020 microservices made easy workshop
Codecamp 2020 microservices made easy workshopJamie Coleman
 
[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric Cloud[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric CloudPerforce
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAmazon Web Services
 
IBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep DiveIBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep DiveDavid Currie
 

Similaire à No Compromise - Better, Stronger, Faster Java in the Cloud (20)

Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
oci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdfoci-container-engine-oke-100.pdf
oci-container-engine-oke-100.pdf
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service Overview
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 Medellin
 
Continuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and DockerContinuous Integration with Amazon ECS and Docker
Continuous Integration with Amazon ECS and Docker
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
 
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
 
Journey toward3rdplatform
Journey toward3rdplatformJourney toward3rdplatform
Journey toward3rdplatform
 
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxDeploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
 
IBM JavaOne Community Keynote 2017
IBM JavaOne Community Keynote 2017IBM JavaOne Community Keynote 2017
IBM JavaOne Community Keynote 2017
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud Applications
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
Codecamp 2020 microservices made easy workshop
Codecamp 2020 microservices made easy workshopCodecamp 2020 microservices made easy workshop
Codecamp 2020 microservices made easy workshop
 
[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric Cloud[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric Cloud
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
IBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep DiveIBM WebSphere Liberty and Docker Deep Dive
IBM WebSphere Liberty and Docker Deep Dive
 
Selenium
SeleniumSelenium
Selenium
 

Plus de All Things Open

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityAll Things Open
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best PracticesAll Things Open
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public PolicyAll Things Open
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...All Things Open
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashAll Things Open
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptAll Things Open
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractAll Things Open
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlowAll Things Open
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and SuccessAll Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with BackgroundAll Things Open
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblyAll Things Open
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksAll Things Open
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptAll Things Open
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramAll Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceAll Things Open
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamAll Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in controlAll Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsAll Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...All Things Open
 

Plus de All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 

Dernier

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 

Dernier (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

No Compromise - Better, Stronger, Faster Java in the Cloud

  • 1. Better, Stronger, Faster Java in the Cloud All Things Open 2022 Harry L. Hoots III, Jarek Gawor
  • 2. Who we are Harry L. Hoots III hlhoots@us.ibm.com Jarek Gawor jgawor@us.ibm.com
  • 3. Agenda This presentation outlines the challenges faced by developers, and presents innovative solutions to meet the demands of cloud native Java – The Java ecosystem – Developer experience – Challenges in the cloud • Liberty InstantOn – Demos 3
  • 4. The Java Ecosystem Java remains the language of choice for many developers. And this is attributed to the vast number of libraries and tools available to developers. Along with reliable and performant runtime engines. – Widely adopted and used from 1996 to the present in the industry • My first Java experience was the Beta v2.0 in college – Vibrant open source community • OS Libraries • OS Tools and Frameworks – Fast paced innovation in open standards • Java9 – 6 month releases – Java is here to stay, thus optimization your apps and workloads that run in the Cloud is essential. 4
  • 5. Developer Experience The key to success in a fast-moving world of cloud computing is enhancing developer experience. This increases productivity while enabling greater innovation. – Monolith to Microservices in the Cloud • Requires evolving the Dev Org and Delivery process as Cloud-Native is much more that replicating your traditional setup in the Cloud. – Developer experience improves developer efficiency and fosters innovation. – What you'll need for Developer efficiency: • Open cloud-native APIs • Quality runtime and Development tools 5
  • 6. 6
  • 7. Cloud-native with Open Liberty 7 A lightweight framework for building fast and efficient cloud-native Java applications. Open Liberty is a flexible runtime that provides an end-to-end cloud-native experience Developer friendly: • Just enough runtime; composable • Zero Migration; no app code or configuration change to move to newest release • API Rich : Jakarta EE, Java EE, MicroProfile, Spring Boot • Cloud ready; production-ready container images • Immediate feedback with Open Liberty Dev mode Plan Code Build Test Release Deploy Run Monitor Security Continuous Integration Continuous Delivery
  • 8. Open Liberty Development tools Build Edit Test Debug Dev Mode Local | Containers Hot Code Replace Testcontainers Leading IDEs Fast, iterative development Unit, Integration & In-container testing Editing support for APIs and configuration Server Config Docker/Containerfile Deployment YAMLs start.openliberty.io New Commit Push Code What is Dev mode ? • Allows you to develop apps with any text editor or IDE by providing: • Hot reload and deployment of source or config changes. • On demand testing or auto test • Debugger support • Local and Local Container support Why Dev mode ? • Automatic compile and deploy to your running server; easy to iterate on your changes, and save time! Liberty Tools: • IntelliJ, Eclipse, VS Code IDE support • Maven and Gradle build automation support. start.openliberty.io • Starter application generation
  • 10. Challenges in the era of Cloud-native The shift to cloud-native has changed the demands placed on the underlying JVM technologies that drive application frameworks and runtimes – Serverless computing – Cloud economics – Cloud native JVM 10
  • 11. Cloud Economics 11 Cloud providers offer a pay-as-you go pricing model based on CPU and memory usage. Businesses built on the cloud need the ability to scale up to meet rising demands, and scale down when demand reduces is crucial for success. Requirements: • Scale-to-zero • Low memory usage • Minimal latency – fast startup Cloud Native JVM Legacy JVM Doing more with less!
  • 12. Cloud Native Runtimes 12 The JVM was designed with portability and flexibility in mind • This meant that bytecodes were loaded lazily and optimized while the application was running • The result was slower startup times but high peak throughput • The cloud demands a shift in the performance characteristics of JVMs and finding the right balance Solutions: • Dynamic AOT compilation and class metadata persistence • Static compilation – native image Native Image JDK Startup time Peak performance Total image footprint Fast build time Usability
  • 13. Liberty InstantOn Liberty InstantOn is a holistic solution that provides fast startup without compromise. • Use Checkpoint / Restore • CRIU Project - https://criu.org • Linux technology used to freeze a running process state • Checkpoint state used to restore an application – Semeru Runtimes – Checkpoint/Restore with Semeru InstantOn – Where to checkpoint? – Container support 13
  • 14. Semeru Runtimes 14 IBM Semeru Runtimes is a production-ready JDK based on the Eclipse OpenJ9 JVM. The OpenJ9 JVM is designed with memory efficiency and startup performance in mind. OpenJ9 continues to innovate by introducing new features like CRIU Support which is the basis of Semeru InstantOn and Liberty InstantOn. Key features: • Broad platform support • Tuned for the cloud • Zero usage restrictions Containers Semeru InstantOn Liberty InstantOn MicroProfile Application
  • 15. Semeru InstantOn 15 OpenJ9 CRIU Support provides third alternative between static compilation and traditional JVMs in the form of checkpoint and restore. It offers fast startup while keeping the benefits of traditional JVMs - Dynamic loading - Advanced JIT and GC - Not closed world - Run existing applications and libraries unchanged Workflow: • Checkpoint run at build phase • Restore run in deployment Traditional Run JVM startup Application initialization Application ready state Build phase Deployment run Initiate restore checkpoint image time startup time application running much faster startup!
  • 16. 16
  • 17. Where to checkpoint? 17 Liberty InstantOn leverages Semeru to provide a seamless checkpoint/restore solution for developers. With checkpoint restore, there is a tradeoff between startup time and the complexity of the restore. Checkpoint phases: • features • deployment • applications Kernel start and feature runtime processing Process application Start application Accept requests Applications Deployment Features Later checkpoint == Faster restore time Later checkpoint == More complexity 300 – 2200ms 100 – 3000ms 0 – ???ms
  • 18. Container support 18 Liberty InstantOn provides tools for users to easily create container images with their checkpointed applications for fast startup in the cloud. Steps: • Build application image build FROM icr.io/appcafe/open-liberty:beta-checkpoint COPY --chown=1001:0 server.xml /config/server.xml COPY --chown=1001:0 demo.war /config/dropins/demo.war RUN configure.sh Dockerfile podman build -t demo-application .
  • 19. Container support 19 Liberty InstantOn provides tools for users to easily create container images with their checkpointed applications for fast startup in the cloud. Steps: • Build application image • Run application to checkpoint in container run checkpoint podman run --name demo-checkpoint-container --privileged --env WLP_CHECKPOINT=applications demo-application
  • 20. Container support 20 Liberty InstantOn provides tools for users to easily create container images with their checkpointed applications for fast startup in the cloud. Steps: • Build application image • Run application to checkpoint in container • Commit container to checkpoint image commit podman commit demo-checkpoint-container demo
  • 21. Container support 21 Liberty InstantOn provides tools for users to easily create container images with their checkpointed applications for fast startup in the cloud. Steps: • Build application image • Run application to checkpoint in container • Commit container to checkpoint image • Restore checkpointed image restore podman run --cap-add=CHECKPOINT_RESTORE --cap-add=NET_ADMIN --cap-add=SYS_PTRACE demo
  • 23. Semeru: CRIU Support API 23 org.eclipse.openj9.criu.CRIUSupport.checkpo intJVMImpl – Java API that allows a user to specify the various arguments that gets used by the native CRIU API criu_dump() and the associated setup using the routines such as criu_init_opts() • Allows options to be set at the CRIU level – Examples : logging, image directory, etc. • Helpful error codes in case something goes wrong • Allows Liberty to register a prepare and restore hook to perform compensations so that the user application does not need to • Performs several key compensations within JVM JVM Liberty and the JVM stack up on top of CRIU at the framework and JDK layers to shield your application from complexities of CRIU CRIU Liberty User application Uses the JVM’s checkpointJVM Impl API to control CRIU Uses CRIU native APIs from within the JVM Does not need awareness of anything CRIU related!
  • 24. Semeru: CRIU Support Pre-checkpoint hooks 24 JVM’s CRIU Support offers hooks for Liberty to participate in preparing for a checkpoint taking CRIU behaviors into account so that it works as expected after a restore Pre-checkpoint hooks: • Liberty and JVM run different hook methods to prepare for taking a checkpoint • Example: close some file handles • All the hooks are run on a single thread before the checkpoint is generated Application Threads Hook Thread Initiate checkpoint Checkpoint JVM
  • 25. Semeru: CRIU Support Post-restore hooks 25 JVM’s CRIU Support offers hooks for Liberty to participate in recovering application state after a CRIU restore Post restore Hooks: • Modify JVM state to compensate for new env • Example: Re-open file handles that were closed in pre-checkpoint hook • Run post-restore hooks in single thread mode and then resume all application threads afterwards from where the checkpoint was done Application Threads Hook Thread Restore JVM Initiate JVM restore
  • 26. Semeru: CRIU Support Compensations 26 CRIU Support compensates for adverse effects that may occur when the JVM is restored. This feature offers users guarantees (security and functional) about expectations of JVM state upon restore Compensations that are handled by the JVM: • Environment variables • Time sensitive APIs • Security stack (SSL, SecureRandom) JVM JVM JVM Checkpoint Environment Restore Environment
  • 27. Semeru: Compensation for environment variables 27 Problem: CRIU freezes the env var space as it was when the process was checkpointed Consequence: Env vars set in the restore environment are not picked up by CRIU Compensation: JVM reads relevant env vars from a new file specified by the user CRIUSupport.RegisterRestoreEnvFile() on restore Easy to set values for env vars not used before restore For env vars used before restore • Mutable: pick up new values since app can cope • Immutable: exception it changed, app cannot cope JVM Create env var file with export ENV2=value2 Checkpoint Environment Restore Environment JVM export ENV1=value1 JVM Mutable case export ENV1=value1 JVM Immutable case export ENV1=value1 JVM Mutable case Create env var file with export ENV1=value2 JVM Immutable case Create env var file with export ENV1=value2 Unexpected Exception changing immutable env var Works as expected Works as expected
  • 28. Semeru: Compensation for time APIs 28 Problem: Time between checkpoint and restore is counted towards elapsed time Consequence: Time appears to have passed even though the process was paused between checkpoint and restore Compensation: JVM compensates by subtracting elapsed time between checkpoint and restore • System.nanoTime, Object.wait, Unsafe.park have all been changed to compensate • System.currentTimeMillis cannot be compensated similarly, so avoid using to measure elapsed time across checkpoint restore operation or use System.nanoTime JVM elapsedTime = System.nanoTi me() - startTime; Checkpoint Environment Restore Environment JVM startTime = System.nanoTi me(); JVM Object.wait(10 00); // trigger if 1 second passes JVM startTime2 = System.current TimeMillis(); JVM Object.wait(10 00); // trigger after 1 second ignoring paused state J JVM elapsedTime2 = System.current TimeMillis() – startTime2; Unexpected Elapsed time includes paused time Works as expected Works as expected
  • 29. Semeru: Compensation for Random APIs 29 JVM r.setSeed(s1); val = r.nextInt(); Checkpoint Environment Restore Environment JVM r = new Random(); val = r.nextInt() JVM r.setSeed(s2); val = r.nextInt(); JVM r.setSeed(s3); val = r.nextInt(); Works as expected Works as expected Works as expected Problem: Random and SecureRandom seeds are initialized at creation time Consequence: Entropy guarantees from Random and SecureRandom may not be met if restored several times Compensation: JVM compensates by changing the random seed on every restore • Random and SecureRandom objects will re-seeded independently in each restore • Entropy guarantees will be met after restore since each object will be re-seeded independently on restore and hence generate random number sequences distinct from each other • Future: offer API for application to opt out of compensation for some objects
  • 30. Summary Adapting and thriving in the cloud requires evolving your development, deployment and and runtime for a cloud-native world Liberty is a versatile runtime for these purposes InstantOn is a key capability that makes Liberty a great runtime for serverless use cases – http://ibm.biz/InstantOn_HowToBlog – https://openliberty.io – https://github.com/eclipse-openj9/openj9 – https://blog.openj9.org/2022/09/26/getting-started-with- openj9-criu-support – https://github.com/ibmruntimes/semeru17-ea- binaries/releases 30