No infrastructure, just code. Learn the simplicity of serverless
copied
[guide on how to build and deploy an app using Nimbella Serverless platform]
The Nimbella platform unifies the programming experience for the cloud with a serverless foundation. In this way, developers can deliver a complete and integrated solution that is enterprise-ready and multi-cloud ready. Nimbella is designed from the ground up to address the needs of event-based applications, long-running applications, stateful workloads, and more complex use cases including artificial intelligence and machine learning.
What is serverless?
Serverless is a cloud-native development model that allows developers to build and run applications without having to manage cloud infrastructure like servers.
There are still servers in serverless, but they are abstracted away from app development. A cloud provider handles the routine work of provisioning, maintaining, and scaling the server infrastructure. Developers can simply package their code in containers for deployment.
Once deployed, serverless apps respond to demand and automatically scale up and down as needed. Serverless offerings from public cloud providers are usually metered on-demand through an event-driven execution model. As a result, when a serverless function is sitting idle, it doesn’t cost anything.
Nimbella is a serverless cloud that helps developers and organizations adopt a cloud strategy focused on rapidly delivering business value in a changing cloud landscape. Nimbella is backed by proven enterprise-grade open source software and offers organizations the peace of mind of being able to run across multiple clouds, including private infrastructure.
Prerequisites
To complete this tutorial, you will need a Nimbella account. If you don’t have an existing account, visit the Nimbella Signup page and create an account for free.
##Steps to build and deploy an app using Nimbella Serverless platform
Step 1: Downloading the Nimbella CLI
- Let us install the Nimbella CLI by following the instructions provided in the nimbella documentation.
- To verify whether the nimbella CLI is installed or not, let's open a command prompt (or Terminal), and enter the following:
Step 2: Connecting Nimbella CLI to your account
- Once the CLI is installed we need to link it to our Nimbella account for that reason we can use auth command in the nimbella CLI.
- Some of the features provided by auth command are listed below details
- Now to connect the CLI to our Nimbella account we will be running the following command in the terminal.
- The above command will open our default browser for authentication once that is done our account will be connected.
Step 3: Creating our project
- To create a project we will use the project command with the following syntax:
- Nimbella supports different languages, So we can choose anyone from the below list:
- Create a project folder with the name my-first-project and language as javascript by running the below command in the terminal.
- As we can see our project has a fixed directory structure, which determines how projects are deployed. The below diagram summarizes the directory structure of an individual project with no project configuration.
- The hello.js is a file pre-filled with hello function (action) written in JavaScript which we will deploy in the next step.
Step 4: Deploying our project
- Let's deploy our project by using the following command:
- As we can see, our project is deployed on the nimbella serverless cloud. We can retrieve the URL for any particular web action by using the action get command, as in the following example, which returns the URL for the hello action created before.
- Now if we navigate to the above URL in our web browser, we can see the following webpage:
- We can also use the project deploy command with a list of projects in a single invocation to deploy them all at once (e.g., nim project deploy example1 example2 … ).
- All the actions we have deployed will be stored in our Nimbella Account, we can retrieve that list by using the action list command:
- Whenever we deploy a project or invoke an action, a unique activation id will be generated which will be linked to that action.
- We can use the activation list command to list the data of all activations which also include Status, Activation ID, Duration of the activations.
- Datetime Status Kind Version Activation ID Start Wait Init Duration Entity
- The Activation ID in the above output will help us in retrieving the result, logs, and data of any particular action we deployed, to do that we can use the following commands:
Step 5: Creating an action
- Instead of creating a project we can also simply create an action and deploy it. This action can be directly invoked, updated, and deleted using the Nimbella CLI.
- Let's create an action by following the below steps:
- Copy the code following into a file and save it as hello_stranger.js
- Now to deploy this action onto our account type the following command in your terminal:
Using the above command the action will be deployed privately, to deploy it in public use the "--web=true" flag along with the command We have successfully deployed our action using the nimbella CLI.
- Let's modify our hello_stranger function with the below code to take place as an input parameter:
- Now to update the code on nimbella we will use the following "update" command:
- To fetch the output of the hello_stranger action, Let's use the invoke-command. We can also provide the input parameters to the action using the "-p" flag as shown in the following example:
Not only that we can also delete, get data of action using delete and get commands.
Step 6: Project watch
- Nimbella also supports incremental deployment of our project, which means whenever we modify and code or file in our project the watch feature will automatically deploy our modified project to the cloud platform
- Let start the watch feature on our project by using the below steps:
- Enter the following command in your terminal.
- Let's try to do some small modifications to our code and check the output
- As we can see, only the files which we modified are getting deployed instead of the whole project.
- This feature will be a lot helpful for developers who constantly need to update and deploy their code.
Summary
Congratulations! We successfully built and deployed serverless functions, projects that can be invoked from the browser or microservices – all just by using CLI.References
https://www.redhat.com/en/topics/cloud-native-apps/what-is-serverless
Author: G. Sai Dheeraj
Dheeraj is currently pursuing his Bachelor of Technology in Computer Science and is a bug bounty hunter. He is working on becoming a cybersecurity expert and spends most of his time reading articles about security and improving his skills in pentesting. In his free time, you will find him testing his skills through competitive programming and writing tech articles.
- Nimbella joins DigitalOcean
- No infrastructure, just code. Learn the simplicity of serverless
- How to Migrate from Containers to Nimbella Serverless Architecture
- Kubernetes in simple words: explained by Eric Swildens
- How to optimize Kubernetes costs with Nimbella
- Step by step guide on how to port from AWS to Nimbella
- How to build and improve your serverless APIs
- Simplifying Kubernetes For Developers
- FaaS Wars Season 2 - Step By Step Instructions
- What is Nimbella and what does it offer?
- Results and Feedback of FaaS Wars - May the FaaS Be with You!
- 28 Serverless Gurus and experts One Must Follow in 2021
- The Faas Wars Alert!
- CI/CD pipeline with GitHub Actions
- How to deploy Node.js functions on Nimbella
- Kick-Start Your Serverless Journey
- AWS re:Invent Serverless Highlights
- Opportunities in the Wake of the AWS Juggernaut
- FaaS Wars: Serverless & Virtual Robot Competition
- #DeveloperIPL Online Hackathon Results & Feedback on Nimbella's Integration for Postman
- How to connect to the 3rd party database such as MySQL at Nimbella (example in Java)
- What can you do with the Nimbella Workbench?
- Deploy your Shopify Storefront to Nimbella
- Not All Serverless Platforms Are Created Equal
- Nimbella + Netlify: Uplevel Your Development Speed
- How we learned to Jamstack, Our Caputron story | Nimbella.com®
- Commander for Microsoft Teams - Your Custom Bot that runs on your Command!
- How to Build a Stateful Cloud App on Nimbella vs. AWS
- Starter Kit and Resources to Build a Serverless Cloud Application
- How to Build Serverless Slack Apps and Commands
- How to Set up your Serverless Environment and Get Started in Less than 2 Minutes!
- How to Quickly Deploy Stateful Serverless Apps with Nimbella?
- What is Serverless Computing? 3 reasons to start now
- How to Build a Serverless Slack App in Minutes.
- How to Manage your Netlify Website from Slack?
- How to Build a Serverless Slack Command in minutes
- How to Build a Stateful Serverless Cloud Web Application?
- How to Create an Optical Character Recognition (OCR) Application?
- Development at the Speed of Innovation – Nimbella, the Serverless Cloud
- Software Security Features on Enterprise Serverless Slack Apps Enabled by Nimbella Commander
- Coronathon India’s first demo day has 18 projects to help fight COVID-19
- See the time in different cities on Slack with Nimbella Commander
- Greet your friends in their native language in Slack with Nimbella Commander
- How to Fetch your Digital Ocean Billing Info on Slack?
- How to Stay Updated with Coronavirus Statistics on Slack?
- How to Fetch your AWS Billing Info on Slack?
- Get your Datadog billing info in Slack with Nimbella Commander
- Serverless Slack Apps and Slash Commands
- How to use Slack Effectively with Nimbella Commander?
- How to Create a multi-user Chatroom Hosted on Serverless Cloud?
- Using Docker actions, running Golang, and other fun things with OpenWhisk
- The duality between serverless functions and APIs
- Serverless HTTP handlers with OpenWhisk
- Serverless functions in your favorite language with OpenWhisk
- Run Swiftly: precompiled Swift actions
- Performance debugging for serverless functions using the Cloud Shell
- Locally debugging OpenWhisk actions
- Composing functions into applications
- A Serverless Composition of Functions
- The Serverless Contract
- The dawn of the Cloud Computer
- Security and Serverless Functions