Giter Site home page Giter Site logo

oaviles / hello_openliberty Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 513 KB

Reference Implementation about Open Liberty. Build and Deploy API to Azure Kubernetes Services based on DevSecOps Practices

License: Other

Dockerfile 1.66% Shell 19.02% Java 28.28% CSS 18.38% HTML 16.30% JavaScript 16.36%
aks azure devsecops devsquad kubernetes openliberty

hello_openliberty's Introduction

DevSquad Open Liberty Accelerator

Overview

The sample application provides a simple example of how to get started with Open Liberty. It provides a REST API that retrieves the system properties in the JVM and a web based UI for viewing them. It also uses MicroProfile Config, MicroProfile Health and MicroProfile Metrics to demonstrate how to use these specifications in an application that maybe deployed to kubernetes.

Reference Documentation: Open Liberty / WebSphere Liberty on AKS Open Liberty logo

Project structure

  • src/main/java - the Java code for the Project
    • io/openliberty/sample
      • config
        • ConfigResource.java - A REST Resource that exposes MicroProfile Config via a /rest/config GET request
        • CustomConfigSource.java - A MicroProfile Config ConfigSource that reads a json file.
      • system
        • SystemConfig.java - A CDI bean that will report if the application is in maintenance. This supports the config variable changing dynamically via an update to a json file.
        • SystemHealth.java - A MicroProfile Health check that reports DOWN if the application is in maintenance and UP otherwise.
        • SystemResource.java - A REST Resource that exposes the System properties via a /rest/properties GET request. Calls to this GET method have MicroProfile Timer and Count metrics applied.
        • SystemRuntime.java - A REST Resource that exposes the version of the Open Liberty runtime via a /rest/runtime GET request.
      • SystemApplication.java - The Jakarta RESTful Web Services Application class
    • liberty/config/server.xml - The server configuration for the liberty runtime
    • META-INF - Contains the metadata files for MicroProfile Config including how to load CustomConfigSource.java
    • webapp - Contains the Web UI for the application.
    • test/java/it/io/openliberty/sample/health
      • HealthIT.java - Test cases for a sample application running on localhost
      • HealthUtilIT.java - Utility methods for functional tests
  • resources/CustomConfigSource.json - Contains the data that is read by the MicroProfile Config ConfigSource.
  • Dockerfile - The Dockerfile for building the sample
  • pom.xml - The Maven POM file

Run the Sample in Azure Kubernetes Service

Clone the repor and create all the necesario Github Secrets to run all the Github Workflows. To run the sample using Azure Kubertenes Service run all the Github Worflows based on numeric order or create your own Github Workflow based on code provided in this repo.

Access the application

Open a browser to http://[your on IP address] deployed by GitHub Workflows called "Deploy API"

image

Run the functional tests

The test cases uses JUnit 5 and Maven Failsafe Plugin defined in pom.xml.

Note: Sample appplication must be running on http://[your on IP address] before running the test cases.
See HealthUtilIT.java to change the change the sample application target URL.

To run the test cases against a running sample application, use the following command

mvnw failsafe:integration-test

To view the test results, look at the console output or look under directory target/failsafe-reports

hello_openliberty's People

Contributors

arturdzm avatar cbridgha avatar dmorgant avatar erica-banda-03 avatar evie-lau avatar gcharters avatar kinueng avatar lavenal avatar mbroz2 avatar nottycode avatar oaviles avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.