<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Open Liberty on Medium]]></title>
        <description><![CDATA[Stories by Open Liberty on Medium]]></description>
        <link>https://medium.com/@openliberty?source=rss-2ad7063dcabc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*weP3ICz-9Srs0W_O8G1lGg.png</url>
            <title>Stories by Open Liberty on Medium</title>
            <link>https://medium.com/@openliberty?source=rss-2ad7063dcabc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:03:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@openliberty/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Containerizing Java applications with Cloud Native Buildpacks]]></title>
            <link>https://openliberty.medium.com/containerizing-java-applications-with-cloud-native-buildpacks-ec337ab763e8?source=rss-2ad7063dcabc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec337ab763e8</guid>
            <category><![CDATA[java-application-server]]></category>
            <category><![CDATA[open-liberty]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cloud-native-buildpacks]]></category>
            <category><![CDATA[cloud-native-application]]></category>
            <dc:creator><![CDATA[Open Liberty]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 11:12:59 GMT</pubDate>
            <atom:updated>2024-01-18T11:12:59.954Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use the Open Liberty Paketo buildpack to containerize a Java application</h4><p>The concept of containers has helped to bring Java developers closer than ever to the cloud-native idiom of ‘write once, run anywhere.’</p><p>Effectively and efficiently containerizing your Java application can be much more of a challenge than you might originally expect, especially when you might not be a container expert. Having to write and maintain a dockerfile, run a Docker daemon as root, wait for all the builds to complete, and then finally push the image to a remote registry can be complex, time-consuming, and frustrating!</p><p>In response to this challenge, several open source projects have provided effective solutions. These include projects such as <a href="https://github.com/GoogleContainerTools/jib">Jib</a>, <a href="https://github.com/openshift/source-to-image">Source-to-Image (S2I)</a>, <a href="https://buildpacks.io/">Cloud Native Buildpacks</a> and <a href="https://paketo.io/">Paketo Buildpacks</a>.</p><p>These projects are open source technologies and offer benefits and advantages over traditional dockerfiles. This article focuses on Cloud Native Buildpacks, an open source project that is gaining significant momentum within the developer community, offering a polyglot solution with impressive features and advantages.</p><p>Let’s take a closer look at what buildpacks are, why they’re advantageous, and how you can use them for your cloud-native Java applications.</p><h3>What are cloud native buildpacks?</h3><p>The Cloud Native Buildpacks project was initiated by several organizations that were already using the concept of buildpacks. This project was donated to the Cloud Native Computing Foundation in 2018. The aim of this open source project was to unify the buildpack ecosystem with a well-defined platform-to-buildpack contract.</p><h3>But what is a cloud native buildpack?</h3><p>A <a href="https://buildpacks.io/docs/concepts/">buildpack</a> is a set of executables that can analyze your app source code, create a build plan, and generate a container image that is ready for deployment to run your application. In essence, buildpacks help you to convert your source code into a secure, efficient, production-ready container image.</p><p>Buildpacks are designed to be flexible and modular. They can be customized to include additional dependencies or to modify the build process. Developers can create their own buildpacks or use pre-existing buildpacks provided by the community.</p><p>Cloud Native Buildpacks embrace modern container standards, such as the <a href="https://github.com/opencontainers/image-spec">OCI image format</a>, and take advantage of the latest capabilities of these standards. Cloud Native Buildpacks aim to bring advanced caching, multi-language support, minimal app images, and reproducibility to your images without forcing you, as the developer, to take care of all this yourself.</p><p>The following image is from the <a href="https://buildpacks.io/docs/concepts/">Cloud Native Buildpacks docs</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hzP8rW4r5tWlaUBf.png" /></figure><h3>How do Cloud Native Buildpacks work?</h3><p>Each buildpack comprises two phases: detect and build.</p><p>First, the detect phase runs against your application source code to determine if the buildpack is applicable or not. For example, for a Java application, it would look for the presence of a pom.xml or build.gradle file, depending on your build tool of choice. If a buildpack is detected, it returns a contract of what is required for creating an image, and then it proceeds to the build phase.</p><p>During the build phase, the buildpack transforms the codebase, fulfilling the contract requirements that were determined in the detect phase. It sets up the build-time and runtime environments, downloads required dependencies, compiles the code (if needed), and sets appropriate entry points and startup scripts.</p><p>To run these two phases (detect and build), builders are used. Under the hood, a builder runs the detect phase for all the buildpacks in order, and then it proceeds to run the build phase.</p><h3>What is a builder?</h3><p>The flexibility and modularity of buildpacks comes from the use of builders. A builder is an ordered combination of components that are required for building a container image.</p><p>The following image is from the <a href="https://buildpacks.io/docs/concepts/">Cloud Native Buildpacks docs</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X5dX3zloaexDsQhd.png" /></figure><p>Builders consist of the following components:</p><ul><li><a href="https://buildpacks.io/docs/concepts/components/buildpack/">Buildpacks</a></li><li><a href="https://buildpacks.io/docs/concepts/components/stack/">Stack</a> (combination of build and run images):<br>Build image, which provides the base environment for the builder<br>Run image, which provides the base environment for the app image during runtime</li><li><a href="https://buildpacks.io/docs/concepts/components/lifecycle/">Lifecycle</a>, which is a set of binaries that are used to run the detect phase for all the buildpacks and then to run the build phase for all buildpacks that passed detection.</li></ul><p>This combination of components allows developers to use a single builder to automatically detect and build a wide variety of applications in different languages.</p><h3>Advantages of using buildpacks over alternative solutions</h3><p>Buildpacks offer several critical advantages to developers:</p><ul><li>Consistency: Buildpacks provide a standardized way in which to build and package applications. This encourages consistency and reduces the risk of human errors.</li><li>Portability: Buildpacks enable developers to easily move applications between cloud environments or providers by providing container images that are easily deployed on any cloud infrastructure or platform.</li><li>Flexibility: Buildpacks’ modular nature enables great customization options for developers.</li><li>Automation: Buildpacks’ automation helps to reduce the amount of manual work that is required by developers for creating, maintaining, and updating tools for building and packaging their applications.</li><li>Compliance and security: Buildpacks use layered images based on known, secure base images, thus significantly lowering the risk of potentially introducing security vulnerabilities.</li></ul><p>In summary, buildpacks enable developers to be more productive. They simplify the process of building and packaging applications, reduce errors, and improve efficiency and security, which all results in saved time and effort that allows developers to focus on writing code and delivering value.</p><p>In comparison to other similar, alternative solutions, such as source-to-image and jib, Cloud Native Buildpacks has several features that developers can take advantage of, including:</p><ul><li>Rebasing, which allows developers to instantly update base images without rebuilding your source code by patching the OS layer of your image.</li><li>Advanced caching, which you can use built-in caching to improve performance so you can quickly rebuild your application by updating only the layers that have changed.</li><li>Software bill of materials (SBOM), which provides insights into the contents of the application image.</li></ul><p>Read <a href="https://buildpacks.io/features/">this document</a> to dive deeper into the feature comparisons between all of these technologies.</p><h3>What are Paketo Buildpacks?</h3><p><a href="https://github.com/paketo-buildpacks">Paketo Buildpacks</a> is an open source project that makes use of the Cloud Native Buildpacks specification to provide production-ready buildpacks for the most popular frameworks and languages, including Java.</p><p>Many runtimes and frameworks have produced their own Paketo buildpacks for developers to use in their own applications. For example, the Paketo Buildpack for Liberty provides the Open Liberty runtime to a workflow and is included in the Java buildpack. For this buildpack, the Open Liberty runtime is provided by default, although it can provide the WebSphere Liberty runtime if preferred. We’ll use this buildpack in the following instructions to show you how you can make use of buildpacks and try them out for yourself.</p><h3>Getting started with buildpacks in 6 easy steps</h3><p>To get started, you’ll need your application source code, Docker, and the Pack CLI.</p><p><em>It is important to note that currently Paketo buildpacks cannot be used locally on machines that run with an M1 or M2 processor. See </em><a href="https://www.cloudfoundry.org/blog/arm64-paketo-buildpacks/"><em>this blog</em></a><em> for more details.</em></p><p>Step 1: The first step is to make sure that Docker is up and running. If you do not have Docker, follow <a href="https://docs.docker.com/get-docker/">these instructions</a> to install Docker.</p><p>Step 2: After this, the next step is to install the <a href="https://buildpacks.io/docs/tools/pack/">Pack CLI</a>, if you do not already have it. This is a Command Line Interface (CLI) maintained by Cloud Native Buildpacks that you can use to work with buildpacks.</p><p>Step 3: Our example uses the Open Liberty getting started application as the application source, which, you’ll need to download.</p><pre>git clone https://github.com/openliberty/guide-getting-started.git</pre><p>Then, change directories to the finish directory.</p><pre>cd guide-getting-started/finish</pre><p>Step 4: Now, you’ll need to set a builder. In this case, we’re using the Ubuntu jammy-based builder.</p><pre>pack config default-builder paketobuildpacks/builder-jammy-base</pre><p>Step 5: Next, you need to create a project.toml file in the finish directory with the following content.</p><pre>[[build.env]]<br>    name = &quot;BP_JAVA_APP_SERVER&quot;<br>    value = &quot;liberty&quot;<br>[[build.env]]<br>    name = &quot;BP_MAVEN_BUILT_ARTIFACT&quot;<br>    value =&quot;target/*.[ejw]ar src/main/liberty/config/*&quot;<br>[[build.buildpacks]]<br>  uri = &quot;docker://gcr.io/paketo-buildpacks/eclipse-openj9&quot;<br>[[build.buildpacks]]<br>  uri = &quot;docker://gcr.io/paketo-buildpacks/java&quot;</pre><p>Step 6: Finally, we’re going to build the application on Liberty with IBM Semeru OpenJ9 and required Liberty features.</p><pre>pack build myapp</pre><p>Your application is now transformed into an OCI image! With your OCI image, you can run your application locally with the following docker run command.</p><pre>docker run --rm -p 9080:9080 myapp</pre><p>Or, you can deploy your application to any Kubernetes-based platform, such as <a href="https://www.redhat.com/en/technologies/cloud-computing/openshift">Red Hat OpenShift</a>, by using an <a href="https://github.com/OpenLiberty/open-liberty-operator">Open Liberty operator</a>.</p><p>If you’d like to be able to view the SBOM information, which is one of the advantages of using buildpacks, use the following commands and open the file in an IDE of your choosing.</p><pre>pack sbom download myapp --output-dir /tmp/demo-app-sbom<br>find /tmp/demo-app-sbom/layers/sbom -name &quot;*.json&quot;</pre><h3>Summary and next steps</h3><p>As this article has shown, developers can easily set up and use buildpacks and their many features when they develop cloud-native applications. If you’d like to view the Open Liberty buildpack referenced and used within the instructions in this article in more detail, check out its <a href="https://github.com/paketo-buildpacks/liberty/blob/main/README.md">open source GitHub repository</a>.</p><p>Alternatively, if you’d like to explore more of what Open Liberty can offer as an open source, cloud-native runtime, or even try it out in a cloud- hosted environment, check out our <a href="https://developer.ibm.com/articles/6-reasons-why-open-liberty-is-an-ideal-choice-for-developing-and-deploying-microservices/">“6 reasons why Open Liberty” article</a> or try the interactive exercises on the <a href="https://openliberty.io/guides/">Open Liberty guides page</a>.</p><p>For an overview of containers and microservices, explore the following articles:</p><ul><li><a href="https://developer.ibm.com/blogs/what-are-containers-and-why-do-you-need-them/">What are containers and why do you need them?</a></li><li><a href="https://developer.ibm.com/articles/true-benefits-of-moving-to-containers-1/">The true benefits of moving to containers</a></li><li><a href="https://developer.ibm.com/articles/why-should-we-use-microservices-and-containers/">Why should you use microservices and containers?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec337ab763e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTelemetry and MicroProfile: Enabling effective observability for your cloud-native Java…]]></title>
            <link>https://openliberty.medium.com/opentelemetry-and-microprofile-enabling-effective-observability-for-your-cloud-native-java-10c126aea7ad?source=rss-2ad7063dcabc------2</link>
            <guid isPermaLink="false">https://medium.com/p/10c126aea7ad</guid>
            <category><![CDATA[observability-tools]]></category>
            <category><![CDATA[microprofile]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cloudnativejava]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Open Liberty]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 16:18:07 GMT</pubDate>
            <atom:updated>2023-12-13T16:18:07.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>OpenTelemetry and MicroProfile: Enabling effective observability for your cloud-native Java applications</h3><p>In this article, we’ll explore why observability is important for effective cloud-native applications and how we can enable this. We’ll investigate open source tools and technologies we can make use of, what observability features and behaviors they enable, and how we can try them out with the help of technologies like <a href="https://microprofile.io/">MicroProfile</a>, <a href="https://openliberty.io/?utm_source=medium&amp;utm_medium=article&amp;utm_content=opentel">Open Liberty</a>, <a href="https://www.jaegertracing.io/">Jaeger</a>), and <a href="https://www.instana.com/">Instana</a>.</p><h3>Why observability is important for cloud-native applications</h3><p>Innovations within cloud infrastructure, the evolution of cloud-native architecture toward microservices-based applications, and the distributed nature of cloud-native deployments have provided significant innovations and advantages but have brought with them new challenges. One such challenge is the ability to effectively observe and monitor an application’s behavior and performance in real time. Our applications are more complex than ever, often composed of tens to hundreds of distributed microservices, making them challenging to manage and monitor.</p><p>This increased complexity is precisely the reason that effective observability of our applications is so critical. We need to be able to identify and act upon failures, bottlenecks, resource constraints, and issues that may arise within our deployed applications. With many of these applications mission-critical, it is vital that they remain responsive and resilient. This can only occur if we are aware of how our applications are performing in real time and how our own services depend on or affect other services.</p><p>So, two questions then arise: How can we enable effective observability for our cloud-native Java applications, and what tools can we use for this?</p><h3>Enabling effective observability</h3><p>To make a system observable, it must first be instrumented. What do we mean by this? Instrumented means the code should emit traces, metrics, and logs.</p><p>A <em>Distributed Trace,</em> more commonly referred to as a Trace, records the paths taken by requests (made by an application or end user) as they disseminate through multi-service architectures, like microservice, macroservice, and serverless applications. Without tracing, it can be challenging to pinpoint the cause of performance problems in a distributed system. Tracing helps to improve the visibility of an application’s health and enables debuging behavior that can be difficult to reproduce locally. So, to summarize, tracing makes debugging and understanding distributed systems less daunting by breaking down what happens within a request as it flows through a distributed system.</p><p><em>Metrics</em> are aggregations of numeric data about infrastructure or an application over a period of time. Examples include system error rates, CPU utilization, and request rates for a given service.</p><p>A <em>Log</em> is a timestamped message emitted by services or other application components, providing coarser-grained or higher-level information about system behaviors (like errors, warnings, etc) and typically will be stored in a set of log files. Unlike Traces, they are not necessarily associated with any particular user request or transaction. They are found almost everywhere in software and have been heavily relied upon by developers and operators to help understand system behavior. Unfortunately, logs aren’t extremely useful for tracking code execution, as they typically lack contextual information, such as where they were called from. Thus, they become far more useful when they are included within a Trace.</p><p>Once the code is able to emit instrumented data (traces, metrics, and logs), this data should be sent to an observability back end. There are a number of options for these back ends, ranging from self-hosted open source tools such as Jaeger and <a href="https://zipkin.io/">Zipkin</a> to commercial SaaS offerings like Instana.</p><p>In the past, the way code was instrumented would vary, as each observability back end would have its own instrumentation libraries and technologies for emitting data. What this meant was that there was no standardized data format for sending data to an observability back end. So if a company chose to switch observability back ends, it meant that they would potentially have to reinstrument their code and configure new technologies just to be able to emit telemetry data to the new tool. With a lack of standardization, the net result was a lack of data portability, and the onus was on the user to maintain instrumentation libraries. However, this problem was recognized by the community, and open source projects were initiated to tackle this lack of standardization, including OpenTracing, OpenCensus, and OpenTelemetry — tools we can make use of to enable effective observability.</p><h3>OpenTelemetry</h3><p>OpenTelemetry can be a great open source tool to use to tackle the observability challenges highlighted and enable effective insights into cloud-native applications. OpenTelemetry is an incubating project from the <a href="https://www.cncf.io/">Cloud Native Computing Foundation</a> (CNCF) and originated through a merger of the OpenTracing and OpenCensus projects:</p><ul><li>The OpenTracing project (now archived) provided vendor-neutral APIs for instrumenting distributed tracing within microservices and sending telemetry data over to an observability back end. However, OpenTracing relied on developers to implement their own libraries to meet the specification.</li><li>The OpenCensus project (now deprecated) provided a set of language-specific libraries, called Census, that could be used to automatically capture traces and metrics from services. It included three APIs: stats, tracing, and tags. The core functionality of OpenCensus was the ability to collect traces and metrics from your app, display them locally, and send them to any analysis tool (i.e., a back end).</li></ul><p>In the interest of having a single standard, OpenCensus and OpenTracing were merged to form OpenTelemetry in May 2019. OpenTelemetry offers a collection of tools, APIs, and SDKs that can be used to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to observability back ends (i.e., open source and proprietary). OpenTelemetry has three main parts and one additional part: Tracing, Metrics, Logging, and Baggage for additional information.</p><h3>OpenTelemetry and MicroProfile</h3><p><a href="https://projects.eclipse.org/projects/technology.microprofile/releases/microprofile-telemetry-1.0/plan%E2%80%A8%E2%80%A822.0.0.10-bet">MicroProfile Telemetry 1.0</a>, new to <a href="https://microprofile.io/2023/01/10/microprofile-6-0-release/#">MicroProfile 6.0</a>, adopts OpenTelemetry from the CNCF to allow cloud native Java applications to benefit from OpenTelemetry through a set of open and easy-to-use APIs. It also enables automatic tracing of Jakarta RESTful web services if configured. Currently, the MicroProfile OpenTelemetry 1.0 specification only supports the Tracing and Baggage elements of the OpenTelemetry specification. However, the aim in future is to adopt all three main parts (to include Metrics and Logs) when they are stable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L_aRb4ESuZSGAtDF.png" /></figure><h3>Try OpenTelemetry</h3><p>You can now make use of OpenTelemetry through the MicroProfile OpenTelemetry 1.0 specification and the latest Open Liberty betas (from 22.0.0.10-beta). To try OpenTelemetry for yourself with Open Liberty, check out our interactive hands-on guide, <a href="https://openliberty.io/guides/microprofile-telemetry-jaeger.html">Enabling distributed tracing in microservices with OpenTelemetry and Jaeger</a>. This content focuses on open source technologies, including the use of open source observability back ends like Jaeger.</p><p>Alternatively, if you’d like to make use of an alternative back end like Instana, you can find out more about this technology and how it enables end-to-end observability in our <a href="https://developer.ibm.com/articles/observability-driven-development?utm_source=medium&amp;utm_medium=article&amp;utm_content=opentel">Observability-driven development</a> article. If you’d like to try it for yourself, then check out <a href="https://developer.ibm.com/articles/observe-app-opentelemetry-instana/">Observe your application’s behavior and performance using telemetry data</a>, which showcases how to make use of OpenTelemetry with the new Instana Collector Exporter and Instana as your observability platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10c126aea7ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>