What is Function-as-a-Service (FaaS)?
FaaS is the concept of serverless computing via serverless architectures. So, what is serverless computing? Serverless computing is a cloud computing model which aims at abstracting server management and with zero administration from the developers i.e. no provision or managing server. In this model, the resources are allocated by the cloud provider. Basically, in this model, you just need to provide your code and the rest is taken care of.
FaaS is is an extremely recent development in cloud computing, first made available to the world by hook.io in October 2014, followed by AWS Lambda, Google Cloud Functions, Microsoft Azure Functions, IBM/Apache’s OpenWhisk (open source) in 2016 and Oracle Cloud Fn (open source) in 2017 which are available for public use.
This concept opens up a huge window of opportunities and a great relief for developers. The concept of executing huge codebase without having to build or manage the infrastructure is truly fascinating. How awesome it is to know that we could only upload of a small chunk of functionality in the cloud with zero administration. We could just execute bits of the entire gigantic code by splitting it into bits of functions. And these functions can be scaled automatically and independently.
Qinling — Function-as-a-service for OpenStack
Qinling provides. It used keystone for authentication and authorization. It provides a dashboard for end users. It uses container orchestration platforms to run functions, by default it uses Kubernates as its orchestrator backend to manage and maintain the underlying pods to run the functions. The user has the option of using Swarm, Mesos and Zun. Zun (ex. Higgins) is the OpenStack Containers service. It aims to provide an API service for running application containers in OpenStack without the need to manage servers or clusters.
Qinling architecture consists of two main components qinling-api and qinling engine. We can interact with Qinling using OpenStack CLI provided by python-qinling client or by sending HTTP request directly or using dashboard(under development). Qinling-api is a WSGI app that authenticates and routes requests to qinling-engine after preliminary handling for the request. Qinling-engine is a standalone service whose purpose is to process operations such as runtime maintenance, function execution operations, function autoscaling, etc. Qinling-engine is responsible for maintaining the mapping between the function and the containers. Qinling interacts with the database(MySQL) to store and retrieve resource information.
Qinling can be integrated with Aodh, an alarming service project which provides a service that enables the ability to trigger actions based on defined rules against metric or event data collected by Ceilometer or Gnocchi. And also with Zaqar, a multi-tenant cloud messaging service for web and mobile developers. It combines the ideas pioneered by Amazon’s SQS product with additional semantics to support event broadcasting.
Qinling provides the following key features:
- Restful API (runtimes/functions/executions/jobs)
They are 4 resource models as specified. In order to create a function, we need to have an available runtime. We a function is invoked then its an execution and if the function needs to be run periodically then you need to create a job.
2. Integrate with OpenStack services and components like Aodh, Zaqar and Swift.
3. It supports code files, own docker images and swift object as a function. User can use their own preferred programming language. Currently, Qinling supports only Python.
4. It supports Sync/ Async/ Periodic execution styles.
For synchronous functions, the caller will be blocked to wait for the responses. Asynchronous functions will be executed at the same time point and the responses will be returned to the caller immediately, the caller could check the result later on.
5. Scale up/down to meet the needs of function i.e. the number of requests received by your function.
6. OpenStack CLI to interact with the Qinling service.