DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. OpenWhisk: A FaaS Platform to Create and Run Event-Driven Apps that Scale on Demand

OpenWhisk: A FaaS Platform to Create and Run Event-Driven Apps that Scale on Demand

OpenWhisk is a powerful tool for creating both web and mobil applications. Learn how to set it up and use OpenWhisk's CLI.

Vidyasagar Machupalli user avatar by
Vidyasagar Machupalli
CORE ·
Mar. 15, 17 · Tutorial
Like (3)
Save
Tweet
Share
3.56K Views

Join the DZone community and get the full member experience.

Join For Free

This blog post introduces you to Serverless computing, OpenWhisk (a serverless, open source cloud platform that executes functions in response to events at any scale) and guides you in getting started with OpenWhisk on IBM Bluemix.

After writing a post on how to transform your idea into an app in minutes, I started thinking, how about the computer part of the cloud? Will that be in minutes or less than a minute or can it be milliseconds?

Then I read this line in an article:

"With serverless computing, there is no virtual infrastructure for the user to manage and the user is only billed for when their code is running, down to the nearest 100 milliseconds."

So, let’s start with a question

What is Serverless Computing?

Is there no server or a process at all? Nah!

Then where is our program or function running? There is no defined definition of Serverless Computing. Here’s one good definition which I think sums up everything about Serverless Computing:

Serverless computing refers to a model where the existence of servers is simply hidden from developers. i.e. that even though servers still exist developers are relieved from the need to care about their operation. They are relieved from the need to worry about low-level infrastructural and operational details such as scalability, high-availability, infrastructure-security, and so forth. Hence, serverless computing is essentially about reducing maintenance efforts to allow developers to quickly focus on developing value-adding code.

Serverless computing encourages and simplifies developing microservice-oriented solutions in order to decompose complex applications into small and independent modules that can be easily exchanged.

Serverless computing does not refer to a specific technology; instead it refers to the concepts underlying the model described prior. Nevertheless some promising solutions have recently emerged easing development approaches that follow the serverless model – such as OpenWhisk, AWS Lambda, Azure Functions, and Google Functions.

A good introduction into the serverless programming model is available on Martin Fowler’s blog.

What is OpenWhisk?

OpenWhisk is an event-driven computer platform, also referred to as Serverless computing or as Function as a Service (FaaS), that runs code in response to events or direct invocations.

OpenWhisk

  • OpenWhisk hides infrastructural complexity allowing developers to focus on business logic.
  • OpenWhisk takes care of low-level details such as scaling, load balancing, logging, fault tolerance, and message queues.
  • OpenWhisk provides a rich ecosystem of building blocks from various domains (analytics, cognitive, data, IoT, etc.).
  • OpenWhisk is open and designed to support an open community.
  • OpenWhisk supports an open ecosystem that allows sharing microservices via OpenWhisk packages.
  • OpenWhisk allows developers to compose solutions using modern abstractions and chaining.
  • OpenWhisk supports multiple runtimes including NodeJS, Swift, and arbitrary binary programs encapsulated in Docker containers.
  • OpenWhisk charges only for code that runs.

Getting Started with OpenWhisk

The OpenWhisk model consists of three concepts:

  • Trigger: a class of events that can happen.
  • Action: an event handler — some code that runs in response to an event.
  • Rule: an association between a trigger and an action.

OpenWhisk model

Develop in Your Browser

Try out OpenWhisk in your Browser to create actions, automate actions using triggers, and explore public packages. Visit the learn more page for a quick tour of the OpenWhisk User Interface.

Develop Using the CLI

You can use the OpenWhisk command line interface (CLI) to set up your namespace and authorization key. Go to Configure CLI and follow the instructions to install it.

wsk: command not found

While using OpenWhisk CLI, if you are seeing this error on a Mac or Linux machine, follow the below stepsOn your terminal, and run the below command:


echo $PATH

Command output:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/usr/local/git/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/IBM/MobileFirst-CLI:/Users/VMac/Downloads/apache-maven-3.3.9/bin
  • Move the downloaded wsk unix executable to  /usr/local/bin  or  /usr/bin  (preferable).
  • Now run the command ‘wsk’ to see the below output:

Using the OpenWhisk CLI

After you have configured your environment, you can begin using the OpenWhisk CLI to do the following:

  • Run your code snippets, or actions, on OpenWhisk. See Creating and invoking actions.
  • Use triggers and rules to enable your actions to respond to events. See Creating triggers and rules.
  • Learn how packages bundle actions and configure external event sources. See Using and creating packages.
  • Explore the catalog of packages and enhance your applications with external services, such as a Cloudant event source. See Using OpenWhisk-enabled services.

OpenWhisk Internals

There are two awesome articles which will take you in-depth into OpenWhisk architecture (from Nginx to consul to kafka…..)

  • Uncovering the magic: How serverless platforms really work! on Medium
  • An Architectural View of Apache OpenWhisk on thenewstack.
Command-line interface app Serverless computing Computing Event

Published at DZone with permission of Vidyasagar Machupalli, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Software Developer Competencies: How To Recognize a Good Programmer
  • Front-End Troubleshooting Using OpenTelemetry
  • Key Elements of Site Reliability Engineering (SRE)
  • Create Spider Chart With ReactJS

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: