Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

vmware-archive/fortune-teller-demo

Repository files navigation

Fortune Teller

Fortune Teller is an application composed of two services:

  1. Fortune Service - serves up random Chinese fortune cookie fortunes

  2. Fortune UI - presents a UI that consumes the fortune service

These applications leverage libraries and services from Spring Cloud and Netflix OSS to demonstrate powerful practices when writing Cloud Native applications.

Fortune Teller is deployable to any Cloud Foundry environment utilizing the service components that have been packaged with the project. However, it is most easily deployed to Pivotal Cloud Foundry environments that have installed the Spring Cloud Services package.

Getting Started

Building

  1. Using the Maven Wrapper, build and package the application:

    $ git clone [REPO]
    $ cd [REPO]
    $ ./mvnw package

    Maven will automatically download all of Fortune Teller's dependencies. This may take a few moments.

Deploying to Pivotal Cloud Foundry with Spring Cloud Services

For the Spring One Conference 2018: We will run scripts/create_services_S1P-2018.sh to create the services that we need on Pivotal Cloud Foundry, on PWS. This script is for the 2018 Spring One Platform Conference, and we will be using the github repo: https://github.com/S1PDemo/config-repo. For the conference, you will need to login to the S1PDemo github account, to change the file. Please note, that we will be using git subdirs , and search paths, to keep the configs separate. For example, the command to create the config server for S1Pdemo1 looks like:

cf cs p-config-server trial config-service -c '{ "git": { "uri": "https://github.com/S1PDemo/config-repo.git","searchPaths": "S1PDemo1" }}'

for S1Pdemo2

cf cs p-config-server trial config-service -c '{ "git": { "uri": "https://github.com/S1PDemo/config-repo.git","searchPaths": "S1PDemo2" }}'

and so on. These are using the SCS "trial" plan, and will therefore expire in 1 week, on Friday of the show.

Or

If you are running this demo as a Platform Architect, you will want to fork the config repo

using your own github account and then modify the create-services_PCF.sh or create-services_PWS.sh script to point at the correct repo, and correct mysql service.

  1. Run scripts/create-services_S1P.sh (or the appropriate create-services script) to create the services that you need on Pivotal Cloud Foundry:

    $ ./create_services_S1P.sh
    Creating service instance fortunes-db in org S1Pdemo1 / space fortune-teller-demo as s1pcfdemo1@gmail.com...
    OK
    Creating service instance config-service in org S1Pdemo1 / space fortune-teller-demo as s1pcfdemo1@gmail.com...
    OK
    
    Create in progress. Use 'cf services' or 'cf service config-service' to check operation status.
    Creating service instance service-registry in org S1Pdemo1 / space fortune-teller-demo as s1pcfdemo1@gmail.com...
    OK
    
    Create in progress. Use 'cf services' or 'cf service service-registry' to check operation status.
    Creating service instance circuit-breaker in org S1Pdemo1 / space fortune-teller-demo as s1pcfdemo1@gmail.com...
    OK
    
    Create in progress.
    
    Use 'cf services' or 'cf service circuit-breaker' to check operation status.
  2. Wait until the config-server, service-registry and circuit-breaker services have been created. Use cf services and wait until the last operation for these services is create succeeded. This might take a few minutes.

  3. Edit the manifest-pcf.yml file to specify the Cloud Foundry target the apps are being pushed to, replacing the URL in TRUST_CERTS: api.sys.cloud.rick-ross.com with the API endpoint for your Cloud Foundry deployment. This step is required to handle self-signed certificates.

  4. Push the microservices:

    $ cf push -f manifest-pcf.yml

    This will push the fortunes service and the ui application and bind all of the services.

The demos for this project are located here

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •