Coder Social home page Coder Social logo

lishiguang1983 / coolstore-microservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbossdemocentral/coolstore-microservice

0.0 1.0 0.0 13.63 MB

CoolStore is a containerised polyglot microservices application consisting of services based on JBoss, NodeJS, Spring Boot, WildFly Swarm, Vert.x, Netflix OSS and more running on OpenShift

Java 5.90% HTML 0.61% JavaScript 92.28% CSS 0.02% Shell 1.19%

coolstore-microservice's Introduction

Red Hat Cool Store Microservice Demo Build Status

This is an example demo showing a retail store consisting of several microservices based on Red Hat OpenShift Application Runtimes (Spring Boot, WildFly Swarm, Vert.x, JBoss EAP and Node.js) deployed to OpenShift.

It demonstrates how to wire up small microservices into a larger application using microservice architectural principals.

Development Branch

โš ๏ธ Please note that master is our development branch and may contain untested features. For stable branch use a version branch like 1.2.x which is tested against OpenShift Container Platform 3.7

Services

There are several individual microservices and infrastructure components that make up this app:

  1. Catalog Service - Java application running on JBoss Web Server (Tomcat) and MongoDB, serves products and prices for retail products
  2. Cart Service - Spring Boot application running on JDK which manages shopping cart for each customer
  3. Inventory Service - Java EE application running on JBoss EAP 7 and PostgreSQL, serves inventory and availability data for retail products
  4. Pricing Service - Business rules application for product pricing on JBoss BRMS
  5. Review Service - WildFly Swarm service running on JDK for writing and displaying reviews for products
  6. Rating Service - Vert.x service running on JDK for rating products
  7. Coolstore Gateway - Spring Boot + Camel application running on JDK serving as an API gateway to the backend services
  8. Web UI - A frontend based on AngularJS and PatternFly running in a Node.js container.

Architecture Screenshot

Architecture Screenshot

Prerequisites

In order to deploy the CoolStore microservices application, you need an OpenShift environment with

Deploy CoolStore Microservices Application

Deploy the CoolStore microservices application using this template openshift/coolstore-template.yaml:

oc login -u developer
oc new-project coolstore
oc process -f openshift/coolstore-template.yaml | oc create -f -

When all pods are deployed, verify all services are functioning:

oc rsh $(oc get pods -o name -l app=coolstore-gw)
curl http://catalog:8080/api/products
curl http://inventory:8080/api/availability/329299
curl http://cart:8080/api/cart/FOO
curl http://rating:8080/api/rating/329299
curl http://review:8080/api/review/329299

Deploy CoolStore Microservices with CI/CD

In order to deploy the complete demo infrastructure for demonstrating Microservices, CI/CD, agile integrations and more, either order the demo via RHPDS or use the following script to provision the demo on any OpenShift environment.

NOTE: OpenShift 3.7 by default uses an older version of Jenkins. Import all Jenkins image tags in order to use the newer Jenkins image for this demo:

$ oc login -u system:admin
$ oc import-image jenkins --from="registry.access.redhat.com/openshift3/jenkins-2-rhel7" --confirm --all -n openshift
$ oc login -u USER

And then provision the demo:

$ openshift/scripts/provision-demo.sh deploy msa-cicd-eap

You can delete the demo projects and containers with:

$ openshift/scripts/provision-demo.sh delete msa-cicd-eap

CI/CD Demo CI/CD Demo

Read the script docs for further details and how to run the demo on a local cluster with oc cluster.

Troubleshooting

  • If you see an error like An error occurred while starting the build.imageStream ... it might be due to RHEL or JBoss imagestreams not being installed on your OpenShift environment. Contact the OpenShift admin to install these imagestreams with the following commands:

    oc login -u system:admin
    oc delete -n openshift -f 'https://raw.githubusercontent.com/jboss-openshift/application-templates/master/jboss-image-streams.json'
    oc delete -n openshift -f 'https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.3/image-streams/image-streams-rhel7.json'
    oc delete -n openshift -f 'https://raw.githubusercontent.com/jboss-fuse/application-templates/GA/fis-image-streams.json'
    oc create -n openshift -f 'https://raw.githubusercontent.com/jboss-openshift/application-templates/master/jboss-image-streams.json'
    oc create -n openshift -f 'https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.3/image-streams/image-streams-rhel7.json'
    oc create -n openshift -f 'https://raw.githubusercontent.com/jboss-fuse/application-templates/GA/fis-image-streams.json'
    
  • If you attempt to deploy any of the services, and nothing happens, it may just be taking a while to download the Docker builder images. Visit the OpenShift web console and navigate to Browse->Events and look for errors, and re-run the 'oc delete ; oc create' commands to re-install the images (as outlined at the beginning.)

coolstore-microservice's People

Contributors

siamaksade avatar jamesfalkner avatar tqvarnst avatar weimeilin79 avatar lordofthejars avatar btison avatar duncandoyle avatar ddoyle-redhat avatar karstengresch avatar

Watchers

harvey 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.