Bluemix OpenWhisk: IBM’s Function as a Service

OpenWhisk is the first OSS Serverless platform

IBM announced OpenWhisk as an experimental event-driven compute platform earlier this year. As one of the latest FaaS solutions on the market, it offers some unique functionalities worth exploring.
The project is completely open-source, and you can deploy it on any infrastructure, and always on the IBM Bluemix platform.

Bluemix OpenWhisk: IBM's Function as a Service

What is IBM Bluemix?

IBM Bluemix went live at the beginning of 2014. It is based on the Cloud Foundry open-source technology, on top of the SoftLayer infrastructure.
Interestingly, Cloud Foundry was initially developed by VMWare, and it’s built in Ruby and Go, while OpenWhisk’s code base is mostly Scala and Python.
Bluemix offers a wide suite of private and hybrid Cloud solutions, including bare metal servers, virtual serverscontainer management, object storage, data analytics, machine learning powered by Watson, a browser-based Swift sandbox, and OpenWhisk. It only supports three regions for now: the southern U.S., Sydney, and the UK.
In this article, I will showcase OpenWhisk and compare it to the main Serverless/FaaS alternatives. I already compared Google Cloud Functions and AWS Lambda, and I’ll be working on more comparison articles soon.

OpenWhisk main concepts

The OpenWhisk model defines five basic concepts:

  • Actions: Actions correspond to Functions, which means your code plus an additional abstraction layer to make every function language-agnostic, thanks to a shared JSON interface.
  • Sequences: You can connect and chain multiple actions and leverage reusability and composability.
  • Triggers: An easy way to organize your event sources.
  • Rules: Connect Triggers and Actions with firing rules.
  • Packages: Packages allow you to bundle together a set of actions and share them with others.

As we will see, you can manipulate, share and interact with these objects in many ways to build your services catalog and automate their cooperation. And naturally, you can do so without managing, patching, or maintaining any server.

How can you interact with OpenWhisk?

You can use OpenWhisk on the official Bluemix web console, which provides a modern and user-friendly visual experience that is well integrated with the rest of the Bluemix suite.
In spite of looking beautiful and user-friendly, you cannot perform every operation directly from the console. I would highly recommend the OpenWhisk CLI (wsk) for automating operations. You can download the wsk executable here.
By default, every OpenWhisk action corresponds to a unique RESTful endpoint. You can access this endpoint via secure HTTPS requests (only POST, apparently). This pattern is compliant with the JSON input/output interface.
Additionally, you can also install the official iOS SDK. By using the mobile SDK, you can invoke your actions from any iOS device. In addition to OpenWhisk, the SDK also contains the code to access other Bluemix services, such as Mobile Data, Push, and Mobile Application Security.
OpenWhisk Welcome

What makes OpenWhisk unique?

OpenWhisk is still in Beta, and it currently covers the basic requirements to be a viable FaaS solution.
Some of its core concepts and functionalities make it different and unique compared to its FaaS competitors. Here is a non-exhaustive list:

1) Language support

The native support for specific programming languages can affect a FaaS platform’s adoption. I think IBM chose to be quite specific but also flexible at the same time.
You can currently choose one of the following options:

  • Node.js 0.12
  • Node.js 6
  • Python 2.7
  • Swift 2
  • Swift 3
  • Docker Images

The interesting options here are Swift and Docker.
Swift is an interesting choice because it allows iOS developers to build their mobile backend with the same client-side language that they are already familiar with.
On the other hand, Docker allows you to implement actions in any language, as long as you are compliant with the interface. I would say this is very flexible and powerful, although I would love to see native support for a wider set of languages, such as Java, Scala, PHP, Ruby, and Python 3, etc.

2) Built-in composability & reusability

The ability to connect, chain, and reuse your functions is a weak aspect of many FaaS solutions. The IBM team decided to make it a built-in feature. Indeed, you can create Sequences of Actions so that the output of the previous one will be the input of the next one.
In addition to Sequences, you also have a shared library of utility functions to make chainability easier. These functions will allow you to build smaller and more reusable building blocks. Plus, you can bundle and share these sets of functions as Packages.

3) Shared catalog of Packages

OpenWhisk comes with a ready-to-use set of Actions to automate 3rd party integrations and to simplify the interaction with other Bluemix services.
For example, you can bind GitHub, Slack, Weather, Watson, Cloudant, Mobile Push, WebSockets, and more to your sequences.
OpenWhisk Catalog

4) Language-agnostic default parameters

It might seem like a trivial feature, but it makes a developer’s life easier. Indeed, you can define default parameters for any function and language without changing the action’s code.
For example, you may define default parameters via CLI as follows:

wsk action update hello --param name John

This way, your function will be given a JSON object containing the default value “John” for your “name” parameter. Of course, you can pass a different value at invocation time and it will overwrite the default value. As you can see, this won’t change your JavaScript, Python, or Swift code at all.

5) Native HTTP integration

Another interesting detail is that you don’t need to configure anything at all to expose your actions via HTTP. OpenWhisk will automatically create an HTTP endpoint for each action. At the moment, you can only invoke actions via POST requests and Basic Authentication headers. As a complementary downside, it seems like this configuration cannot be customized.
For example, you would invoke your actions via cURL as follows:

URL="https://openwhisk.ng.bluemix.net/api/v1/namespaces/ABC/actions/XYZ?blocking=true"
BODY='{"name": "John"}'
KEY="XXX"
curl -d '$BODY' '$URL' -XPOST -H 'Content-Type: application/json' -H 'Authorization: $KEY'

What’s still missing?

As with any beta release, OpenWhisk is still missing some critical features.
I will mention just a few:

1) Versioning and staging

I think the platform needs a clear and flexible way to deal with multiple Versions of the same Action. It also needs a mechanism to bind a version to specific endpoints and environments (e.g. dev, prod, etc.).
For now, you can only define Organizations and Spaces at the Bluemix account level, which might help work around the problem but it won’t make your life any easier.

2) HTTP customizations

It’s currently not possible to design a RESTful API. You can’t define custom paths or bind different Actions to each HTTP method (i.e. GET, POST, PUT, etc.). As mentioned above, the current HTTP integration is completely automatic and very easy to use, but it’s not aligned with the REST principles yet.

3) Lack of documentation

The official documentation doesn’t cover some major details about the CLI yet. For example, I couldn’t find how to deal with code packaging for Python and Swift dependencies.
I am personally quite hopeful about this, since the documentation is open source too, and everyone can contribute. I have already fixed a typo myself with a PR on Github.

4) Server-side Swift issues

As for the official documentation, Swift actions run in a Linux environment and use the latest available release, which is not necessarily stable. It means that the Swift version might be different from the stable releases of XCode.
I would assume that this will need to change sometime soon to make OpenWhisk a real mobile backend alternative.

OpenWhisk Technical Limitations

Every FaaS solution comes with different technical limitations and constraints that might affect how you develop your functions.
Here is a summary of the main limitations, which may change in the future once OpenWhisk goes out of Beta:

  • Execution time: max 5min
  • Memory allocation: max 512MB
  • Logs size: max 10MB
  • Code size: max 48MB
  • Payload size: max 1MB
  • Parameters size: max 1MB
  • Concurrent invocations per Namespace: max 1000
  • Invocations per minute: max 5000
  • Triggers firing per minute: max 5000

I think that the biggest constraint, compared to other FaaS competitors, is the maximum code size. In some cases, your code might weight more than 48MB if you need many auxiliary files or large libraries.
I guess these limits will change after the Beta and I’m also looking forward to the official pricing.

Conclusion

I think that OpenWhisk has great potential. Its GitHub project reached 45 contributors in less than nine months and the community seems to be growing fast. Transparency and customizability may be its winning points, although the ability to provide high-quality performance and unique features will play an important role too.
In my next article, I will compare OpenWhisk to the main serverless alternatives, including, AWS Lambda, Azure Functions, Google Cloud Functions, and others.
If you are interested in Serverless technologies, you may want to re-watch the webinar Introduction to the Serverless Paradigm by Austen Collins and me, or read my previous Google Cloud Functions VS AWS Lambda comparison.

 

 

Avatar

Written by

Alex Casalboni

Alex is a Software Engineer with a great passion for music and web technologies. He's experienced in web development and software design, with a particular focus on frontend and UX.


Related Posts

Alisha Reyes
Alisha Reyes
— August 5, 2020

New Content: Alibaba, Azure AZ-303 and AZ-304, Site Reliability Engineering (SRE) Foundation, Python 3 Programming, 16 Hands-on Labs, and Much More

This month our Content Team did an amazing job at publishing and updating a ton of new content. Not only did our experts release the brand new AZ-303 and AZ-304 Certification Learning Paths, but they also created 16 new hands-on labs — and so much more! New content on Cloud Academy At...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Alisha Reyes
Alisha Reyes
— July 16, 2020

Blog Digest: Which Certifications Should I Get?, The 12 Microsoft Azure Certifications, 6 Ways to Prevent a Data Breach, and More

This month, we were excited to announce that Cloud Academy was recognized in the G2 Summer 2020 reports! These reports highlight the top-rated solutions in the industry, as chosen by the source that matters most: customers. We're grateful to have been nominated as a High Performer in se...

Read more
  • AWS
  • Azure
  • blog digest
  • Certifications
  • Cloud Academy
  • OWASP
  • OWASP Top 10
  • Security
  • VPCs
Avatar
Cloud Academy Team
— July 9, 2020

Which Certifications Should I Get?

The old AWS slogan, “Cloud is the new normal” is indeed a reality today. Really, cloud has been the new normal for a while now and getting credentials has become an increasingly effective way to quickly showcase your abilities to recruiters and companies. With all that in mind, the s...

Read more
  • AWS
  • Azure
  • Certifications
  • Cloud Computing
  • Google Cloud Platform
Alisha Reyes
Alisha Reyes
— July 2, 2020

New Content: AWS, Azure, Typescript, Java, Docker, 13 New Labs, and Much More

This month, our Content Team released a whopping 13 new labs in real cloud environments! If you haven't tried out our labs, you might not understand why we think that number is so impressive. Our labs are not “simulated” experiences — they are real cloud environments using accounts on A...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Joe Nemer
Joe Nemer
— June 19, 2020

Kickstart Your Tech Training With a Free Week on Cloud Academy

Are you looking to make a jump in your technical career? Want to get trained or certified on AWS, Azure, Google Cloud Platform, DevOps, Kubernetes, Python, or another in-demand skill? Then you'll want to mark your calendar. Starting Monday, June 22 at 12:00 a.m. PDT (3:00 a.m. EDT), ...

Read more
  • AWS
  • Azure
  • cloud academy content
  • complimentary access
  • GCP
  • on the house
Alisha Reyes
Alisha Reyes
— June 11, 2020

New Content: AZ-500 and AZ-400 Updates, 3 Google Professional Exam Preps, Practical ML Learning Path, C# Programming, and More

This month, our Content Team released tons of new content and labs in real cloud environments. Not only that, but we introduced our very first highly interactive "Office Hours" webinar. This webinar, Acing the AWS Solutions Architect Associate Certification, started with a quick overvie...

Read more
  • AWS
  • Azure
  • DevOps
  • Google Cloud Platform
  • Machine Learning
  • programming
Rebecca Willis
Rebecca Willis
— June 3, 2020

Azure vs. AWS: Which Certification Provides the Brighter Future?

More and more companies are using cloud services, prompting more and more people to switch their current IT position to something cloud-related. The problem is most people only have that much time after work to learn new technologies, and there are plenty of cloud services that you can ...

Read more
  • AWS
  • Azure
  • certification
Alisha Reyes
Alisha Reyes
— June 2, 2020

Blog Digest: 5 Reasons to Get AWS Certified, OWASP Top 10, Getting Started with VPCs, Top 10 Soft Skills, and More

Thank you for being a valued member of our community! We recently sent out a short survey to understand what type of content you would like us to add to Cloud Academy, and we want to thank everyone who gave us their input. If you would like to complete the survey, it's not too late. It ...

Read more
  • AWS
  • Azure
  • blog digest
  • Certifications
  • Cloud Academy
  • OWASP
  • OWASP Top 10
  • Security
  • VPCs
Alisha Reyes
Alisha Reyes
— May 11, 2020

New Content: Alibaba, Azure Cert Prep: AI-100, AZ-104, AZ-204 & AZ-400, Amazon Athena Playground, Google Cloud Developer Challenge, and much more

This month, our Content Team released 8 new learning paths, 4 courses, 7 labs in real cloud environments, and 4 new knowledge check assessments. Not only that, but we introduced our very first course on Alibaba Cloud, and our expert instructors are working 'round the clock to create 6 n...

Read more
  • alibaba
  • AWS
  • Azure
  • gitops
  • Google Cloud Platform
  • lab playground
  • programming
Avatar
Rhonda Martinez
— May 4, 2020

Top 5 Reasons to Get AWS Certified Right Now

Cloud computing trends are on the rise and have been for some time already. Fortunately, it’s never too late to start learning cloud computing. Skills like AWS and others associated with cloud computing are in high demand because cloud technologies have become crucial for many businesse...

Read more
  • Amazon Elastic Book Store
  • Amazon Elastic Compute Cloud (EC2)
  • AWS
  • AWS Certifications
  • Glacier
Alisha Reyes
Alisha Reyes
— May 1, 2020

Introducing Our Newest Lab Environments: Lab Playgrounds

Want to train in a real cloud environment, but feel slowed down by spinning up your own deployments? When you consider security or pricing costs, it can be costly and challenging to get up to speed quickly for self-training. To solve this problem, Cloud Academy created a new suite of la...

Read more
  • AWS
  • Azure
  • Docker
  • Google Cloud Platform
  • Java
  • lab playgrounds
  • Python
Alisha Reyes
Alisha Reyes
— April 30, 2020

Blog Digest: AWS Breaking News, Azure DevOps, AWS Study Guide, 8 Ways to Prevent a Ransomware Attack, and More

  New articles by topic AWS Azure Data Science Google Cloud  Cloud Adoption Platform Updates & New Content Security Women in Tech AWS Breaking News: All AWS Certification Exams Now Available Online As an Advanced AWS Technology Partner, C...

Read more
  • AWS
  • Azure
  • blog digest
  • Certifications
  • Cloud Academy
  • programming
  • Security