All Projects → IBM-Cloud → multiple-deployment-options

IBM-Cloud / multiple-deployment-options

Licence: other
Shows how one service can be deployed to multiple deployment options

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to multiple-deployment-options

logistics-wizard
The Logistics Wizard is an end-to-end, smart supply chain management solution that showcases how to execute hybrid cloud, microservices, and predictive data analytics in the real world.
Stars: ✭ 99 (+395%)
Mutual labels:  bluemix, cloudfoundry, openwhisk, ibm-cloud-solutions
ibm-cloud-functions-rest-api-trigger
IBM Cloud Functions building block - HTTP REST Trigger - This project provides a starting point for handling events from REST API calls with IBM Cloud Functions powered by Apache OpenWhisk.
Stars: ✭ 17 (-15%)
Mutual labels:  bluemix, openwhisk
text-bot-openwhisk
DEPRECATED: this repo is no longer actively maintained
Stars: ✭ 12 (-40%)
Mutual labels:  bluemix, openwhisk
slack-chatbot-database-watson
Code for the solution tutorial "Build a database-driven Slackbot" (chatbot) with a custom extension in IBM Watson Assistant
Stars: ✭ 23 (+15%)
Mutual labels:  openwhisk, ibm-cloud-solutions
ibm-cloud-functions-serverless-ocr-openchecks
Serverless bank check deposit processing with object storage and optical character recognition using Apache OpenWhisk powered by IBM Cloud Functions. See the Tech Talk replay for a demo.
Stars: ✭ 40 (+100%)
Mutual labels:  bluemix, openwhisk
Get Started Python
A Python application and tutorial that use Flask framework to provide a REST API to receive requests from the UI. The API then persists the data to a Cloudant database.
Stars: ✭ 104 (+420%)
Mutual labels:  bluemix
eirini-release
Helm release for Project Eirini
Stars: ✭ 37 (+85%)
Mutual labels:  cloudfoundry
Gameon Java Microservices On Kubernetes
This code demonstrates deployment of a Microservices based application Game On! on to Kubernetes cluster. Game On! is a throwback text-based adventure built to help you explore microservice architectures and related concepts.
Stars: ✭ 88 (+340%)
Mutual labels:  bluemix
Drupal Nginx Php Kubernetes
Demonstration of a set of NGINX and PHP-FPM containers running Drupal deployed to Kubernetes on the IBM Container Service. This is a work in progress.
Stars: ✭ 43 (+115%)
Mutual labels:  bluemix
nfs-volume-release
No description or website provided.
Stars: ✭ 17 (-15%)
Mutual labels:  cloudfoundry
ibm-cloud-functions-action-trigger-rule
Simple demo showing Apache OpenWhisk actions, triggers, and rules with IBM Cloud Functions.
Stars: ✭ 16 (-20%)
Mutual labels:  openwhisk
Kubernetes Container Service Gitlab Sample
This code shows how a common multi-component GitLab can be deployed on Kubernetes cluster. Each component (NGINX, Ruby on Rails, Redis, PostgreSQL, and more) runs in a separate container or group of containers.
Stars: ✭ 240 (+1100%)
Mutual labels:  bluemix
Chatbot
🤖 Build your own chatbot base on IBM Watson
Stars: ✭ 142 (+610%)
Mutual labels:  bluemix
watson-multimedia-analyzer
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode. A Node app that use Watson Visual Recognition, Speech to Text, Natural Language Understanding, and Tone Analyzer to enrich media files.
Stars: ✭ 23 (+15%)
Mutual labels:  bluemix
Cognitiveconcierge
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Stars: ✭ 100 (+400%)
Mutual labels:  bluemix
openwhisk-client-swift
[DEPRECATED] - openwhisk-client-swift is a Swift client SDK for OpenWhisk with support for iOS, WatchOS2, and Darwin CLI apps
Stars: ✭ 20 (+0%)
Mutual labels:  openwhisk
Cognitive Social Crm
An application that monitors a Twitter feed and determines customer sentiment using IBM Watson Assistant, Tone Analyzer, Natural Language Understanding, as well as CloudantDB
Stars: ✭ 71 (+255%)
Mutual labels:  bluemix
Terraform Provider Ibm
Terraform on IBM provider https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-getting-started
Stars: ✭ 210 (+950%)
Mutual labels:  bluemix
akka-react-cloudant
A Soccer Dashboard created by scraping EPL website using Akka backend and ReactJS frontend and IBM Cloudant for object storage. IBM Cloud Foundry is used to host both frontend and backend app.
Stars: ✭ 21 (+5%)
Mutual labels:  cloudfoundry
Todo Apps
Sample ToDo application (various languages) running on IBM Cloud
Stars: ✭ 195 (+875%)
Mutual labels:  bluemix

One micro-service, multiple deployment options

This project contains one simple micro-service that gets deployed:

Watch this Youtube video that walks you through the deployment of the service and test the behavior of the deployment options when the service crashes:

Requirements

  • An IBM Cloud account. Either sign up, or use an existing account.

About the micro-service

The micro-service used in this project computes Fibonacci numbers.

From Wikipedia: In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...

The implementation of the Fibonacci sequence is done in service/lib/fibonacci.js. The same implementation is used across all deployment options.

Deploy the services in IBM Cloud with the toolchain

  1. Identify an IBM Cloud region, Cloud Foundry organization and space where to deploy the services.

  2. Create a standard Kubernetes cluster

  3. Create a registry namespace

And then

Deploy To IBM Cloud

  1. Select the GitHub box.

    1. Decide whether you want to clone or fork the repository.
    2. If you decide to Clone, set a name for your GitHub repository.
  2. Select the Delivery Pipeline box.

    1. Specify the IBM Cloud API key to use or create one
    2. Select the region, organization and space where you want to deploy the web application. A random route will be used for the application. ⚠️ Make sure the organization and the space have no space in their names.
    3. Select the Kubernetes cluster where to deploy the service, together with the Docker registry name where to store the Docker image
  3. Click Create.

  4. Select the Delivery Pipeline.

  5. Wait until all stages complete.

  6. Open the Deploy log for the CLOUD FOUNDRY, CLOUD FUNCTIONS and KUBERNETES stages. Each log has a link at the end pointing to the location where the services have been deployed. Click on the links to add the service to the visual tester.

  7. The services are ready. Review the Service API to call the services.

Service API

Once deployed, the service implements 3 API calls:

  • compute the Fibonacci number after n iterations,
  • let the computation run for t milliseconds,
  • and simulate a crash of the service.

Depending on which compute option you are using, use the following cURL calls:

Endpoint Type Endpoint URL
Cloud Foundry iteration curl -v http://fibonacci-service-<random-string>.mybluemix.net/fibonacci?iteration=1000
duration curl -v http://fibonacci-service-<random-string>.mybluemix.net/fibonacci?duration=5000
crash curl -v -X POST http://fibonacci-service-<random-string>.mybluemix.net/fibonacci?crash=true
Kubernetes iteration curl -v http://<cluster-ip>:30080/fibonacci?iteration=1000
duration curl -v http://<cluster-ip>:30080/fibonacci?duration=5000
crash curl -v -X POST http://<cluster-ip>:30080/fibonacci?crash=true
Cloud Functions iteration curl -v https://openwhisk.ng.bluemix.net/api/v1/web/<namespace>/default/fibonacci?iteration=1000
duration curl -v https://openwhisk.ng.bluemix.net/api/v1/web/<namespace>/default/fibonacci?duration=5000
crash curl -v -X POST https://openwhisk.ng.bluemix.net/api/v1/web/<namespace>/default/fibonacci?crash=true

Code Structure

Cloud Foundry application

File Description
app.js Main application, start the express web server and expose the service API
lib/fibonacci.js The implementation of the Fibonacci sequence, shared by all deployment options
package.json List the packages required by the application
manifest.yml Description of the application to be deployed
.cfignore List files to ignore when deploying the application to Cloud Foundry

Kubernetes deployment

File Description
app.js Main application, start the express web server and expose the service API
lib/fibonacci.js The implementation of the Fibonacci sequence, shared by all deployment options
package.json List the packages required by the application
Dockerfile Description of the Docker image
fibonacci-deployment.yml Specification file for the deployment of the service in Kubernetes

Cloud Functions action

The Cloud Functions action is deployed as a zip action where several files are packaged into a zip file and the zip file is passed to Cloud Functions as the implementation for the action. deploy.js takes care of packaging the zip file.

File Description
handler.js Implementation of the Cloud Functions action
lib/fibonacci.js The implementation of the Fibonacci sequence, shared by all deployment options
package.json Specify the action entry point (handler.js)
deploy.js Helper to deploy and undeploy the Cloud Functions action

Tester web app

Under the tester directory is a simple web application to register and test the deployed micro-services. It can be pushed to IBM Cloud with cf push or simply executed locally with python -m SimpleHTTPServer 28080 as example.

Contribute

Please create a pull request with your desired changes.

Troubleshooting

Cloud Foundry

Use

ibmcloud cf logs fibonacci-service

to look at the live logs for the web application.

Kubernetes

Use

kubectl proxy

and look at the status of the resources in the console.

Cloud Functions

Use

ibmcloud cloud-functions activation poll

and perform an invocation of the action.

License

See License.txt for license information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].