EasyFaaS is a stateless and high performance function computing service engine

EasyFaaS is a stateless and high performance function computing service engine

2022-09-14 0 1,233
Resource Number 38551 Last Updated 2025-02-24
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

EasyFaaS recommended in this issue is a functional computing service engine with light dependence, strong adaptability, low resource consumption, stateless and high performance.

Features

  • Dependence light : EasyFaaS only relies on Linux kernel, does not rely on Docker, Kubernetes and other external services
  • Adaptive : EasyFaaS can run on a variety of system environments, including Docker, Kubernetes and bare metal
  • Less resource occupation : fewer modules, smaller service system module occupation
  • Stateless : Each EasyFaaS Pod itself is stateless and internally autonomous
  • High performance : Shorter scheduling links, less overhead, and better performance

For

  • Edge computing -Edge
  • Internet of Things -IoT
  • CICD
  • Privatization
  • CDN

Fast start

Based on Linux (kernel 4.0+), pre-installed docker provides two ways for developers to get started quickly:

    • Mode 1: Run in all-in-one mode
    • Method 2: Run

with docker-compose

  • Method 3: Compile, package and deploy

Method 1: Run in all-in-one mode

Compile

Compile all modules Note: If you are in a linux environment or do not need to compile individual modules, just run the command 1.1

$ make

Cross-compile for other platforms:

$ KUN_BUILD_PLATFORMS="linux/amd64" make

Compile only one module:

$ make WHAT=./pkg/controller

Packing

$ scripts/build-image.sh -h
Usage: scripts/build-image.sh [OPTIONS]
-h --help 
-m= --module= module name 
-i= --image= image name 
-t= --tag= mirror tag 
-e= --env= deployment environment (mirroring repository configuration) 

Package the all-in-one image, which will contain the controller component, funclet component, and stubs component. Note that the runtime is not currently open source, directly pull the image can be executed:

$ scripts/build-image.sh -m=one -i=easyfaas -t=dev

If you need to publish a packaged image, you need to specify REGISTRY, such as

$REGISTRY=registry.baidubce.com/< your_namespace> / ./scripts/build-image.sh -m=one -i=easyfaas  -t=dev

< Upload image

If on the local machine, otherwise need to upload the image

docker push [OPTIONS] NAME[:TAG]
Such as:
docker push registry.baidubce.com/< your_namespace> /< your_image_name> :< your_image_tag> 

Start service

export faasPath=/< your_path_prefix> /easyfaas/faas

#runner runtime please download the image directly 
docker run -td -e WITHRUNNER=1 -e WITHNODEJS10=1  -e  WITHNODEJS12=1 -e WITHPYTHON3=1 --name runner-runtime  -v ${faasPath}/runtime:/var/faas/runtime -v ${faasPath}/runner:/var/faas/runner  registry.baidubce.com/easyfaas-public/runner-runtime:demo1.0

# Start all-in-one service 
docker run -td --privileged -v ${faasPath}/runner:/var/faas/runner -v ${faasPath}/runtime:/var/faas/runtime -v ${faasPath}/data:/var/faas/runner-data --name easyfaas  registry.baidubce.com/easyfaas-public/all-in-one:demo1.0

Operation run

After the installation is complete, run the following command to enter the container:

$ docker exec -it easyfaas bash

Method 2: Run the easyfaas service locally with docker-compose

Ensure the normal operation of the local Docker service. Because the underlying of the easyfaas service depends on the underlying linux features such as cgroup/loop devices, it is recommended that the Linux system be preferred.

easyfaas component image

As described in the overall architecture diagram, easyfaas is composed of 4 components, namely controller component, funclet component, runner runtime component, And FUN-Registry, a native code repository built by the stubs module.

You can directly use the public image released by easyfaas. If the local computer cannot access the public network, you can download and store the image file in the tar file from the server that can access the external network environment, and then load the tar file to the server without public network.

< Running easyfaas service

The main configuration is in the./scripts/docker-compose/compose-local/.env file, where

  • CONTROLLER_EXPORT_PORT: Service port exposed by the controller component
  • REGISTRY_EXPORT_PORT : Service port of mock native function code repository service component
  • FUNCTION_DATA_DIR: local function code directory
  • easyfaas_REPO : mirror warehouse repo
  • CONTROLLER_TAG : controller component image tag, the full image ID is {easyfaas_REPO}/controller:{{easyfaas_REPO}/controller:{CONTROLLER_TAG}
  • FUNCLET_TAG : funclet component image tag, full image ID is {easyfaas_REPO}/mini-funclet:{{easyfaas_REPO}/mini-funclet:{CONTROLLER_TAG}
  • RUNTIME_TAG: The runner runtime component image tag, the full image ID is {easyfaas_REPO}/runner runtime:{{easyfaas_REPO}/runner runtime:{CONTROLLER_TAG}
  • REGISTRY_TAG: Local mock function repository component tag, full image ID {easyfaas_REPO}// fun-registry :{{easyfaas_REPO}// fun-registry :{CONTROLLER_TAG}
# env file configuration example 
$ cat ./scripts/docker-compose/compose-local/.env
CONTROLLER_EXPORT_PORT=8899
REGISTRY_EXPORT_PORT=8002
FUNCTION_DATA_DIR=/tmp/funcData
easyfaas_REPO=registry.baidubce.com/easyfaas-public
CONTROLLER_TAG = demo1.0
FUNCLET_TAG = demo1.0
RUNTIME_TAG = demo1.0
REGISTRY_TAG = demo1.0 < / code > < / pre >

Start service

Run the following command to start the service and run docker ps to see if the component is running correctly: The controller component container, funclet component container and FUN-Registry component container are resident containers. Check whether the containers work properly

# Start service
$ cd ./scripts/docker-compose/compose-local/
$ sh app_control.sh start

# Check service
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5bec1b3fd3e4 controller:demo1.0 "./controller --maxproc…" 3 days ago Up 3 days minikun_minikun_1
8b6b1f6d2b1d mini-funclet:demo1.0 "./funclet --logtost…" 3 days ago Up 3 days minikun_funclet_1
5082b7249d28 func-registry:demo1.0 "/stubs --port=8002 …" 3 days ago Up 3 days minikun_registry_1

$Check whether the service is running properly

Core function

EasyFaaS is a stateless and high performance function computing service engine插图

Technical architecture

EasyFaaS is a stateless and high performance function computing service engine插图1

General view

Core Module description

controller

Responsible for traffic scheduling and container pool status management.

  • Implement the container scheduling function.
  • Supports concurrency at the configuration function level.
  • Support container status management, scheduling container status by policy.
  • Supports health check and cooldown/reborn can be determined according to runtime status.

funclet

Manage user work containers, including basic container resources and function run resources.

  • Container management: implements the init/warmup/reset process for containers.
  • Network management: realize functions related to container networks and manage network resources reasonably.
  • Mount management: Realize dynamic mount of user containers, and periodically reclaim the mount directory of user containers.
  • Process management: properly manage the child processes generated by the user container and handle the child processes that exit unexpectedly.
  • Resource capacity management: dynamically adjust the memory resources of the user’s working container.

runner-runtime

runner is responsible for managing the runtime of user functions. Runtime supports the runtime of various development languages. Currently, this component only provides container image

.

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code EasyFaaS is a stateless and high performance function computing service engine https://ictcoder.com/easyfaas-is-a-stateless-and-high-performance-function-computing-service-engine/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services