More developers are using Polyglot programming models with their application architecture and why should they not use the language that makes sense for a specific task. This is where we introduce Paketo, the open-source tool that enables a developer to automatically detect what language they are using and build a runnable container image with that application and a runtime to run said application.
In this talk we will talk about what Paketo’s goals are, the benefits it can bring and a demo of how to easily get started taking a MicroProfile and Jakarta EE application and deploy it in a container using Paketo with the Open Liberty Runtime.
Architecture decision records - How not to get lost in the past
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
1. 1
Deploy and Update Jakarta EE &
MicroProfile applications @
Lightspeed
With Paketo
Name: Jamie L Coleman
Title: Software Developer/Advocate @ IBM
Twitter: @Jamie_Lee_C
3. 3
Contents of this talk
• What are Polyglot
applications?
• Why use different languages?
• What is a Buildpack?
o Compliance
o Security
o Control
o Maintainability
• Introduction to Paketo!
o What is Paketo?
o How does Paketo work?
o Paketo & Java
o Open Liberty Buildpack
o Getting started with Paketo
• Introduction to Open Liberty
• MicroProfile & Jakarta EE
• Paketo with Open Liberty Demo
• Recap
• Useful Links
5. 5
Polyglot applications
• Application written in multiple languages.
• Used to capture additional functionality &
efficiency of different languages.
• Allow development teams to choose the
technology stack they want to use.
• If abiding by the rules of the 15 factors
for cloud-native development such as
API first, then this can be achieved easily
depending on the skills of your
developers.
6. 6
Saving energy with efficient
applications
There is over 500,000 data centres worldwide
The area of land they consume is around the same as 6,000 football
pitches
UK energy consumption x 1.5 == global data centre energy
consumption (2019).
10. 10
Many metrics must be balanced for Java Performance
• Wide variety of use cases means many metrics must be balanced
• Different goals different design decisions
• No single “right” answer
• Must keep a balance make sensible trade-offs
• Key performance metrics tracked
• start-up time
• ramp-up time
• memory footprint
• response time
• CPU/Throughput
Optimizing for cloud requires a different balance across these performance metrics
start-up
time
footprin
ramp-up
response
time
CPU
11. 11
Overview of OpenJ9
Designed from the start to span all the
operating systems needed by IBM products
This JVM can go from small to large
Can handle constrained environments or
memory rich ones
Is used by the largest enterprises on the
planet
13. 13
Research on greenest languages
https://medium.com/codex/what-are-the-greenest-
programming-languages-e738774b1957
14. 14
Save time, money & energy!
Advantages
• Increase Engineer creativity
• Speed up time to market
• Draw from a big pool of talent
• More efficient applications
Disadvantages
• Scaling Issues
• Complexity!
16. 16
Buildpacks
• Transform application source code into OCI images
• Conceived by Heroku (Creators of the 12 factor applications) in 2011
• Created by Pivotal and Heroku in 2018
17. 17
Buildpacks
• Advanced Caching
o Robust caching is used to improve performance
• Auto-detection
o Images can be built directly from source without additional
instructions
• Bill of Materials
o Insights into the contents of the app through standard SBOMs
• Modular/Pluggable
o Multiple buildpacks can be used to create an image
• Multi Language
o Supports multiple programming language stacks
18. 18
Buildpacks
• Multi Process
o Images can have multiple entry
• Minimal App image
o Image contains only what is required
• Rebasing
o Instant updates on base images without re-building
• Reproducibility
o Reproduces the same app image digest with a rebuild
• Reusability
o Leverage pre-built buildpacks maintained by a large community
19. 19
Compliance
Ensuring your software licences are being used correctly
Top causes of software non-compliance
1. Complexity of software licences
2. Inadvertent misuse
3. Lack of software asset management procedures and tools
4. Lack of education
5. Intentional misuse
20. 20
Stacks & Buildpacks
Ensuring your stacks are updated and secure
Buildpacks/Paketo use the notion of a stack
A stack is composed of two images that are intended to work together:
1. The build image of a stack provides the base image from which the build
environment is constructed.
2. The run image of a stack provides the base image from which application
images are built.
21. 21
Security & Hardening features
• By using Ubuntu 18.04 and 22.04 as the base images for the stacks, you benefit from all of
the security provided by Canonical and Ubuntu.
• Automatic monitoring and patching of CVEs means that our stacks are often updated within
hours of Canonical’s patches.
• The stack images are run as a dedicated non-root user when building and running
applications.
• Each stack image has detailed metadata describing the image’s components, such as the
base operating system and packages.
• Each stack has separate images for building and running applications. The packages on
the runtime image are curated to exclude compilers and other tools that might pose
security risks.
• The build and run images have different user IDs. This means that sensitive files and
dependencies installed at build-time cannot be corrupted at run-time by malicious app
code.
22. 22
Control
With buildpacks, you have full control over the OSes, languages, and
package management your teams can use. This allows you to connect
to a private maven repository and use dependency management
software such as Sonatype’s Nexus product.
They also provide you with a bill of materials through standard build
times SBOMs in different formats that can be used to see
insights in your applications image.
23. 23
Maintainability
Having good maintainability helps your organisation save money and
energy in the long run.
Buildpacks offer certain features that can help with maintainability:
1. Auto-detection of source code changes
2. Using multiple buildpacks to create an application images
3. Image contains only what is required
4. Instant updates of base images without re-building
5. Reuse buildpacks maintained by a large community.
26. 26
What is Paketo?
• Paketo transforms your application source code into container
images
• Paketo is Open source and provides production ready buildpacks for
the most popular languages and frameworks such as:
o PHP, Java, Node.js, Go, .NET Core, Ruby, NGINX &
• Allows you to easily build applications and keep them updated
27. 27
How does Paketo work?
Just bring your app and Paketo Buildpacks will detect what language
your app is using, gather the required dependencies, and build it into
an image.
The build tool detects your file structure and decides what build tool to
use or you can manually select the tool you want such as:
• Gradle
• Maven
• Leiningen
• SBT
28. 28
How does Paketo work?
Installing a Specific JVM Version
The following environment variable configures the JVM version at build-time: BP_JVM_VERSION
• Defaults to the latest 11.x version at the time of release.
• Configures a specific JDK or JRE version.
Use an Alternative JVM
• By default, the Paketo Java buildpack will use the Liberica JVM but you are able to use the JVM of your choice:
• Adoptium Paketo Adoptium Buildpack
• Alibaba Dragonwell(opens in a new tab) 2 Paketo Alibaba Dragonwell Buildpack
• Amazon Corretto(opens in a new tab) 2 Paketo Amazon Corretto Buildpack
• Azul Zulu(opens in a new tab) Paketo Azul Zulu Buildpack
• BellSoft Liberica(opens in a new tab) Paketo BellSoft Liberica Buildpack - Default
• Eclipse OpenJ9(opens in a new tab) Paketo Eclipse OpenJ9 Buildpack
• GraalVM(opens in a new tab) 2 Paketo GraalVM Buildpack
• Oracle JDK(opens in a new tab) 2 3 Paketo Oracle Buildpack
• Microsoft OpenJDK(opens in a new tab) 2 Paketo Microsoft OpenJDK Buildpack
29. 29
How does Paketo work?
Paketo can use an alternatives Java Application Servesr from the default!
When deploying your Java application to an application runtime, the
default application server installed by the Paketo Java buildpack is Apache
Tomcat.
If you require a different application runtime, possibly one that supports
JavaEE or JakartaEE, you may select an alternative Java application
server by setting BP_JAVA_APP_SERVER when building your application
such as: samples/war -e BP_JAVA_APP_SERVER=liberty
38. 38
Open Liberty
The Paketo Buildpack for Liberty is a Cloud-Native Buildpack that
contributes Open Liberty or WebSphere Liberty for Java EE/Jakarta EE
& MicroProfile support.
GitHub - paketo-buildpacks/liberty: A Cloud Native Buildpack that
provides the Open Liberty runtime
39. 39
Open Liberty
The buildpack will support all available profiles of the most recent versions of the Liberty runtime.
Because the Liberty versioning scheme is not conformant to semantic versioning, a Liberty version like
22.0.0.2 is defined here as 22.0.2, and should be referenced as such!
Profiles
Valid profiles for Open Liberty are:
full
kernel
jakartaee9
javaee8
webProfile9
webProfile8
microProfile5
microProfile4
41. 41
Getting started
The first thing I would advise is to look at Paketo and your own
applications using things such as: SBOMs and decide on what
technology to use.
If you are working for a big corporation that decides what technology to
use then creating a SBOM is useful to determine if you need to
purchase extra licences and not incur extra fees due to licence
understandings.
52. 52
Interactive Demo
If you want to participate in this demo then we have provided an online
environment that will allow you to explore this technology!
To access any of the Open Liberty environments for exploration
reasons then head to our Guides and click the “Run In Cloud” button.
https://openliberty.io/guides/
54. 54
Recap
• Polyglot applications can provide many benefits but can be complex.
• Buildpacks can help make this less complex by:
o Advanced Caching
o Auto-detection
o Bill of Materials
o Modular/Pluggable
o Multi Language
o Multi Process
o Minimal App image
o Rebasing
o Reproducibility
o Reusability
• Open Liberty with MicroProfile & Jakarta EE are great Open Source choices for your Java
applications and are a fully supported buildpacks that are maintained by the Open Liberty
development team.
55. 55
Links to research for this talk
• Analyzing Polyglot Microservices. An Exploration for Enterprise | by
Tripta Gupta | Capital One Tech | Medium
• Software Compliance - Are You Compliant? - Hypertec Direct
• Cloud Native Buildpacks · Cloud Native Buildpacks
• Paketo Buildpacks - Paketo Buildpacks
Talk about current team using other languages to scrape data from Social media
.
Jamie
Jamie
Jamie
Provide the APIs and runtime capabilities that help with creating large numbers of collaborating services
Basically having something where you aren't required to do some steps before shutdown - that shooting a container won't leave you in a bad situation
Meaning if you just kill it, you don’t leave stuff hanging around.
The ‘weight’ of your cloud-native application should be proportional to what the application does/uses. You don’t want to be bringing along 0.5GB of runtime to serve up a simple servlet.
https://12factor.net/dev-prod-parity
Make the time gap small: a developer may write code and have it deployed hours or even just minutes later.
Make the personnel gap small: developers who wrote code are closely involved in deploying it and watching its behavior in production.
Make the tools gap small: keep development and production as similar as possible.
https://12factor.net/config
Resource handles to the database, Memcached, and other backing services
Credentials to external services such as Amazon S3 or Twitter
Per-deploy values such as the canonical hostname for the deploy
Dev env where testing is done is the same as production. Using the same OS, Runtime, etc. Docker. Immutable build… to make sure code doesn’t have to change.
Single build form the Dockerfile – don’t re-build.
Explicitly listing version in Dockerfiles
Availability of Docker images, single independent process, etc…