YoMo

YoMo is an open-source Streaming Serverless Framework for building low-latency edge computing applications. Built atop QUIC transport protocol and functional reactive programming interface, makes build geo-distributed system quickly. Used in Metaverse, real-time web applications, AR/VR, IoT etc.

๐ŸŒถ Features

  • โšก๏ธ Low-latency Guaranteed by implementing atop of QUIC
  • ๐Ÿ” Security TLS v1.3 on every data packet by design
  • ๐Ÿ“ฑ 5G/WiFi-6 Reliable networking in Celluar/Wireless
  • ๐ŸŒŽ Geo-Distributed Edge Mesh Edge-Mesh Native architecture makes your services close to end users
  • ๐Ÿ“ธ Event-First Architecture leverages serverless service to be event driven and elastic
  • ๐Ÿฆ– Streaming Serverless Write only a few lines of code to build applications and microservices
  • ๐Ÿš€ Y3 a faster than real-time codec
  • ๐Ÿ“จ Reactive stream processing based on Rx

๐Ÿš€ Getting Started

Prerequisite

Install Go

1. Install CLI

$ curl -fsSL "https://bina.egoist.sh/yomorun/cli?name=yomo" | sh

Or build from source

$ go install github.com/yomorun/cli/yomo@latest

Verify Your YoMo CLI Installation

Use the following command to verify that the installation was successful:

$ yomo version
Quiz Time: What do you see?
- You're good to go!
- Please make sure you have installed the latest version!

Create a YoMo App

The yomo init command should set up everything for you.

$ yomo init yomo-app-demo

โŒ›  Initializing the Serverless app...
โœ…  Congratulations! You have initialized the serverless function successfully.
โ„น๏ธ   You can enjoy the YoMo Serverless via the command:
โ„น๏ธ      DEV:    yomo dev -n Noise yomo-app-demo/app.go
โ„น๏ธ      PROD:   First run source application, eg: go run example/source/main.go
        Second: yomo run -n yomo-app-demo yomo-app-demo/app.go

$ cd yomo-app-demo

YoMo CLI will automatically create an app.go with the following content:

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "time"

    "github.com/yomorun/yomo/rx"
)

// NoiseData represents the structure of data
type NoiseData struct {
    Noise float32 `json:"noise"` // Noise value
    Time  int64   `json:"time"`  // Timestamp (ms)
    From  string  `json:"from"`  // Source IP
}

var echo = func(_ context.Context, i interface{}) (interface{}, error) {
    value := i.(*NoiseData)
    value.Noise = value.Noise / 10
    rightNow := time.Now().UnixNano() / int64(time.Millisecond)
    fmt.Println(fmt.Sprintf("[%s] %d > value: %f โšก๏ธ=%dms", value.From, value.Time, value.Noise, rightNow-value.Time))
    return value.Noise, nil
}

// Handler will handle data in Rx way
func Handler(rxstream rx.Stream) rx.Stream {
    stream := rxstream.
        Unmarshal(json.Unmarshal, func() interface{} { return &NoiseData{} }).
        Debounce(50).
        Map(echo).
        StdOut()

    return stream
}

func DataTags() []byte {
    return []byte{0x33}
}

3. Build and Run

Run yomo dev from the terminal. you will see the following message:

$ yomo dev

โ„น๏ธ   YoMo serverless function file: app.go
โŒ›  Create YoMo serverless instance...
โŒ›  YoMo serverless function building...
โœ…  Success! YoMo serverless function build.
โ„น๏ธ   YoMo serverless function is running...
โ„น๏ธ   Run: /Users/xiaojianhong/Downloads/yomo-app-demo/sl.yomo
2021/06/07 12:00:06 Connecting to zipper dev.yomo.run:9000 ...
2021/06/07 12:00:07 โœ… Connected to zipper dev.yomo.run:9000
[10.10.79.50] 1623038407236 > value: 1.919251 โšก๏ธ=-25ms
[StdOut]:  1.9192511
[10.10.79.50] 1623038407336 > value: 11.370256 โšก๏ธ=-25ms
[StdOut]:  11.370256
[10.10.79.50] 1623038407436 > value: 8.672209 โšก๏ธ=-25ms
[StdOut]:  8.672209
[10.10.79.50] 1623038407536 > value: 4.826996 โšก๏ธ=-25ms
[StdOut]:  4.826996
[10.10.79.50] 1623038407636 > value: 16.201773 โšก๏ธ=-25ms
[StdOut]:  16.201773
[10.10.79.50] 1623038407737 > value: 13.875483 โšก๏ธ=-26ms
[StdOut]:  13.875483

๐ŸŒŸ Show case

๐Ÿ“š Examples

All examples can be run by Task, following the Install Task, execute task -l in this directory will list all the examples.

$ cd example
$ task -l |grep example

* example-basic:            YoMo basic usage
* example-pipeline:             Unix pipeline to cloud
* example-iopipe:           IO Pipe
* example-multi-sfn:            Multiple stream functions
* example-cascading-zipper:         Cascading zippers

can run each example directly by task example-basic, task example-cascading-zipper and etc.

  • 0-basic: process the streams from IoT sound sensor.
  • 1-pipeline: read the local streams (f.e. /dev/urandom) and use yomo-source to send the streams over cloud.
  • 2-iopipe: use io.Copy() to pipe the local streams (f.e. /dev/urandom) to yomo-source.
  • 3-multi-sfn: use 3 stream functions to process the streams in different cases.
    • stream-fn-1: calculate the sound value in real-time.
    • stream-fn-2: print the warning message when the sound value reaches a threshold.
    • stream-fn-3: calculate the average value in a sliding window.
  • 4-cascading-zipper: source connect to zipper-1, then zipper-1 will auto sync streams to the zippers in other regions.

๐ŸŽฏ Focuses on computing at the edge

YoMo is best for:

  • Making latency-sensitive applications.
  • Dealing with high network latency and packet loss.
  • Handling continuous high-frequency data with stream processing.
  • Building complex systems with streaming serverless architecture.

๐Ÿฆธ Contributing

First off, thank you for considering making contributions. It's people like you that make YoMo better. There are many ways in which you can participate in this project, for example:

  • File a bug report. Be sure to include information like what version of YoMo you are using, what your operating system is, and steps to recreate the bug.
  • Suggest a new feature.
  • Read our contributing guidelines to learn about what types of contributions we are looking for.
  • We have also adopted a code of conduct that we expect project participants to adhere to.

๐Ÿคน๐Ÿปโ€โ™€๏ธ Feedback

If you have any questions, please feel free to come to our discussion board. Any feedback would be greatly appreciated!

License

Apache License 2.0

Thanks

YoMo โค๏ธ Vercel This website is

Vercel Logo

Edit this page on GitHub Updated at Sun, Mar 20, 2022
ย  Source