0.2.14 • Published 2 years ago

node2faas v0.2.14

Weekly downloads
2
License
ISC
Repository
-
Last release
2 years ago

images/node2faas-logo-big.png

Node Applications conversor to Function as a Service (FaaS) Deployments.

Hot Page

Versions

  • 0.2.0 - 2021,Oct
    1. AWS:
    • Add CloudWatch automatic integration;
    • Update runtime from nodejs10.x (deprecated) to nodejs14.x.
    1. FaaS zip file generated with dependencies (node_modules);
    2. Replacing package Request (deprecated) by Axios
    3. Automatically add Axios in generated app package.json
    4. Parameters passed via POST
    5. New annotation feature: force / skip publication on FaaS
  • 0.1.1 - 2020,Nov
    1. Minor bug corrections;
    2. Graphics on evaluations;
    3. Readme Update
  • 0.1.0 - 2019,Dec
    1. Add multicloud orchestrator (Terraform) with support to AWS, GCP and Azure FaaS services;
    2. Function pre-analysis;
  • 0.0.1 - 2018,Dec
    1. Initial Release

Purpose

This framework intend to help NodeJS developers to migrate from monolith model to function as a service (serverless) model. It parses the original code looking for exported functions and creates an equivalent function on the provider. Instead of the original function is placed a restAPI request to FaaS.

Pre-Requisites

To use this conversor you need to have an active account in one of this FaaS services:

  • Amazon AWS Lambda;
  • Google Functions;
  • Microsoft Azure Functions.

Get credentials parameters on AWS

  • Log in to your AWS Management Console.
  • Click on your user name at the top right of the page.
  • Click on the Security Credentials link from the drop-down menu.
  • Find the Access Credentials section, and copy the latest Access Key ID.
  • Click on the Show link in the same row, and copy the Secret Access Key.

    You should obtain this parameters:

  • access_key_id

  • secret_access_key

Get credentials parameters on Azure

You should obtain this parameters:

  • subscription_id
  • azure_tenant_id
  • azure_client_id
  • azure_client_secret

    Follow this instructions: click

Get credentials parameters on GCP

  • Create a service account and set permissions to operate the Compute Engine and VPC Networks.

    You should obtain a JSON file with this parameters:

  • client_x509_cert_url

  • client_email
  • client_id
  • project_id
  • private_key_id
  • zone

The JSON file location will be prompted by the framework during its process.

Workflow

node2faas-workflow

Conversion Process

node2faas-workflow

Framework Composition

node2faas-composition

Installation

npm install node2faas

or

git clone https://github.com/node2faas/framework.git

cd node2faas

npm link

Usage

  • Run: node2faas --help on your terminal to get the CLI Instructions

node2faas-help

  • Run: node2faas --target [/path/to/original/application]

  • Follow de conversor instructions

  • After proccess, check the directory output and your application converted to operate with FaaS should be there.

Features

  • Convert only .js files (other file types are skipped)
  • Stores provider credentials after first execution (don't ask again)
  • Creates new FaaS function on the choose provider
  • Creates all provider API Gateway resources
  • Annotations (add a comment anywhere inside function definition)

    • Skip publication:
      • //@node2faas-skip
    • Force publication:
      • //@node2faas-force

Limitations

The framework is prepared to work only with:

  • Providers: - AWS Lambda - GCP Functions - Azure Functions
  • Function types: - exported - Ex: exports.functionName = function(params) { ... }

Examples

This project contains some examples to guide you. Look inside examples folder.

Overload example

  • available in path: examples/mocked/bounds

The load example explores 3 potential function loads:

  • Memory -> process with high memory consumption
  • CPU -> process with high CPU consumption
  • I/O -> process with high I/O consumption

Evaluations

Tests without orchestrator

  • 1 to 100 concurrent requests to each service (traditional and converted)
  • Simple Test (simple math operations)
  • CPU stress Test (multiple cycles of simple operations)
  • Memory stress Test (multiple cycles of writing on memory operations)
  • I/O stress Test (multiple cycles of writing on disk operations)
  • All data generated in this evaluation is available in path: evaluations/preliminary/outputs
  • Files generated have this structure: initial timestamp in nanoseconds,final timestamp in nanoseconds,duration in nanoseconds,output from service

Test Architecture

node2faas-test-arch

Results of Simple Test

simple-test

Results of CPU Stress Test

cpu-test

Results of Memory Stress Test

memory-test

Results of Memory I/O Test

io-test

Tests with Terraform as orchestrator

  • CPU stress Test (multiple cycles of simple operations)
  • Memory stress Test (multiple cycles of writing on memory operations)
  • I/O stress Test (multiple cycles of writing on disk operations)

Parameters

conclusive-test-params

  • All data generated in this evaluation is available in path: evaluations/conclusive/results

  • A list of test case was generated using the parameters. This table is available in file: evaluation/conclusive/test_cases.csv

  • Files generated have this structure: id test case,sequence,test output,duration in nanoseconds

Results of CPU Bound Test

cpu-conclusive-test

Results of Memory Bound Test

mem-conclusive-test

Results of I/O Bound Test

io-conclusive-test

Reliability rates

reliability

Minimal and maximal execution time

min_max_exec_time

Publications

  • 2019, May => CLOSER, Heraklion, Greece (paper)

  • 2020, May => CLOSER, Online Streaming (paper)

  • 2020, Nov => CCGRID, Melbourne, Australia (paper)

Support

If you need more information, please send a message to: leouesb@gmail.com

0.2.14

2 years ago

0.2.13

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.5

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.4

3 years ago

0.1.0

4 years ago

0.0.1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago