GithubHelp home page GithubHelp logo

serverless_demo's Introduction

Serverless Demo - Apache OpenWhisk on IBM Cloud

Prepare the Environment

  1. Register and login into https://cloud.ibm.com/

  2. Go to "IBM Cloud Functions", download and install the CLI

  3. Follow the instructions (some commands in the page are deprecated)

  • $ ibmcloud login
  • $ ibmcloud plugin install cloud-functions
  • $ ibmcloud target --cf
  • $ ibmcloud fn list
  1. Install the OpenWhisk tools

Deploying actions with Apache OpenWhisk

  1. Implement the action/function
  1. Upload the action code to the platform

$ wsk action create helloGo hello.go

  1. Invoke the action (-r shows the result and -p pass the parameters)

$ wsk action invoke helloGo -r -p name gopher

  1. Deploying the action and an API using the Whisk Deploy
  • Create the manifest file

  • Run the deployment

$ wskdeploy -m manifest.yaml

Command to list the available APIS

$ wsk api list

In the "IBM Cloud Functions - Actions" page it is possible to manage all the functions features (actions/apis/triggers/monitoring).

https://cloud.ibm.com/functions/actions

Deploying actions with IBM Cloud tools (Alternative)

  1. Implement the action
  1. Poll the activation log to see what is happening (optional)

$ ibmcloud fn activation poll

  1. Upload the action file as a Cloud Function (in a terminal different from the log poll)

$ ibmcloud fn action create handler handler.js

  1. Invoke the action manually

$ ibmcloud fn action invoke --blocking handler

  1. Deploying the action and a trigger via shell script (the IBM Cloud tooling does not have a deploy tool like Whisk Deploy)

$ ./deploy.sh --install

In the "IBM Cloud Functions - Actions" page it is possible to manage all the functions features (actions/apis/triggers/monitoring).

https://cloud.ibm.com/functions/actions

serverless_demo's People

Contributors

oscarcosta avatar

Watchers

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