The Community Bonding Period 2021

The Start of my GSoC’21 Journey

Mohit Bhat
SCoRe Lab

--

The Details of my Project and the experience of the Community Bonding Period

After being selected into GSoC, The community bonding starts. This period is basically when students get to know their mentors and they plan on the execution, tech stack, and other strategies for a smooth GSoC period. This time it was scheduled from the 17th of May to the 7th of June.

About my project

I am working on Project called NodeCloud which is a NodeJs module for the open cloud. Basically, there are a lot of cloud providers in the market and they all have their own SDKs to use. Having many providers in the market is a great advantage but if a project wants to use one or more cloud providers in their project then they have to install their SDKs which have different syntax and format, which becomes a hurdle in using them and hence developers either need to understand a lot of documentation or they are forced to use only one SDK. Not only that having a lot of different syntax for the same functionality degrades the code quality and makes the codebase confusing.

NodeCloud came with the concept where you can install plugins for cloud providers which you want to use in your project and with minimal configurations, you can integrate it with your project. Not only that the syntax for a particular functionality is made the same for all cloud providers. Let's take an example:

If you want to launch an AWS instance using nodecloud

Add node cloud to your Project:

const nc = require("@nodecloud/common")

Create the .nc.config.js file in the project root in the following format.

You need to add plugins of the cloud provider which you want to add to your project in this config file.

const nodeCloudAwsPlugin = require("@nodecloud/aws-plugin");
const nodeCloudGcpPlugin = require("@nodecloud/gcp-plugin");
const nodeCloudAzurePlugin = require("@nodecloud/azure-plugin");

const providers = [
{
name: "aws",
tag: "aws",
plugin: nodeCloudAwsPlugin,
configPath: "C:\\Users\\mbcse\\myproject\\aws_cred.json",
},
{
name: "google",
tag: "google",
plugin: nodeCloudGcpPlugin,
configPath: {
projectId: "astral-hold-276807",
keyFilename: "C:\\Users\\mbcse\\myproject\\gcp_cred.json",
},
},
{
name: "azure",
tag: "azure",
plugin: nodeCloudAzurePlugin,
},
];
module.exports = providers;

And here the magic begins…

You pass the config file to the nodecloud to create a nodecloud instance, which then can be used for interaction with the cloud services

const nc = require("@nodecloud/common");const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nc.getProviders(optionsProvider);
const options = {
apiVersion: "2017-11-01",
};

const computeModule = ncProviders.aws.compute(options);
const instanceParams = {
ImageId: "ami-07ebfd5b3428b6f4d", // Image of Ubuntu Server 18.04
InstanceType: "t2.micro",
KeyName: "nodeCloud", // key name of Key pair
MinCount: 1,
MaxCount: 1,
};

// create AWS EC2 instance
computeModule
.create(instanceParams)
.then((res) => {
console.log(`All done ! ${res}`);
})
.catch((err) => {
console.log(`Oops something happened ${err}`);
});

If you want to run an azure instance instead, just change this line

const computeModule = ncProviders.aws.compute(options);

to

const computeModule = ncProviders.azure.compute(options);

Or you can use both cloud provider services.

The best part of this is like you can have data stored in AWS s3 and instance created in azure and you can interact with them using common syntax.

My work

I hope you got what the project is. Now let me tell you what I will be doing in this project. Currently, Nodecloud supports AWS, GCP, and AZURE. My task is to add support for Digital Ocean. It’s all about making a Digital Ocean plugin and packaging it inside the Nodecloud module.

The main part of building this project is the code generation tool, which is where the magic happens. If we had to manually analyze SDK and then make classes for the Nodecloud module, it would be very tough and time-consuming. Therefore, what we actually do is we take the help of typescript Definition files in Cloud SDKs and the typescript compiler API to make a custom AST(Abstract Syntax Tree) Transformer to auto-generate the classes, and once it is done we pack it as a package inside nodecloud.

I will be making this custom AST transformer for the Digital Ocean plugin. Digital Ocean doesn’t have an official SDK. Instead, there are many third-party SDKs that are officially backed by Digital Ocean. So my task is to find a suitable SDK and make parsers, transformers, and generators to auto-generate classes.

Yaa, it looks tough, my reaction was the same when I first read about it but it’s easy once we work upon this. That’s the beauty of GSoC and open-source that teaches us these kinds of stuff.

The community bonding period

The initial days after selection started with some emails from Google regarding information, payments 😍 , and other stuff.

The ScoreLab mentors made a group for GSoC21 Participants and with some congratulating and welcome messages, we were given information regarding how work is to be done in the coming weeks. We also greeted our fellow gsoc’ers on the mailing list. Later my mentor contacted me to schedule an initial meeting to discuss things.

The meeting

I met my Mentor Rajitha Warusavitarana. We introduced each other and then started discussing how things would be done. He asked me to maintain documentation and other stuff. We also discussed issue creation and the breakdown of tasks. It was a short insightful meeting and after that, I started working on finalizing the timeline, deciding the micro and macro tasks that are to be done, and also made a Notion tracker to report my progress. Later we met again next week and discussed the progress and issues. I also wrote some blogs about selection and community bonding.

This was all about the community Bonding and it was great fun, as I got to know some cool people and brainstormed how to proceed things further.

What's Next?

Lets code it

Now it's time for the coding period and I have started working on my project, will update you regarding the same in the coming weeks. Till then GoodBye✌️ and Have Fun!😋

Follow me here…. Linkedin, Github, Twitter

--

--

Mohit Bhat
SCoRe Lab

Blockchain & Full Stack Developer | GSoC’21 @ SCoReLab | Certified Ethereum Developer | Ethereum India Fellow | SIH2020 Finalist | Postman Student Expert