1 Star 0 Fork 75

igit-cn / yomo

forked from YoMo / yomo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

YoMo Go

YoMo 是为边缘计算打造的低时延流式 Serverless 开发框架,基于 QUIC Transport 协议通讯,以 Functional Reactive Programming 为编程范式,简化构建可靠、安全的低时延计算应用的复杂度,挖掘5G潜力,释放实时计算价值。

官网:https://yomo.run (感谢 Vercel 支持)

For english, check: Github

🚀 3分钟教程

1. 安装CLI

注意: YoMo 的运行环境要求 Go 版本为 1.15 或以上,运行 go version 获取当前环境的版本,如果未安装 Go 或者不符合 Go 版本要求时,请安装或者升级 Go 版本。 安装 Go 环境之后,国内用户可参考 https://goproxy.cn/ 设置 GOPROXY,以便下载 YoMo 项目依赖。

# 确保设置了$GOPATH, Golang的设计里main和plugin是高度耦合的
$ echo $GOPATH

如果没有设置$GOPATH,参考这里:如何设置$GOPATH和$GOBIN

$ GO111MODULE=off go get github.com/yomorun/yomo

$ cd $GOPATH/src/github.com/yomorun/yomo

$ make install

YoMo Tutorial 1

2. 创建第一个yomo应用

$ mkdir -p $GOPATH/src/github.com/{YOUR_GITHUB_USERNAME} && cd $_

$ yomo init yomo-app-demo
2020/12/29 13:03:57 Initializing the Serverless app...
2020/12/29 13:04:00 ✅ Congratulations! You have initialized the serverless app successfully.
2020/12/29 13:04:00 🎉 You can enjoy the YoMo Serverless via the command: yomo dev

$ cd yomo-app-demo

YoMo Tutorial 2

CLI将会自动创建一个app.go文件:

package main

import (
	"context"
	"fmt"
	"time"

	y3 "github.com/yomorun/y3-codec-golang"
	"github.com/yomorun/yomo/pkg/rx"
)

// NoiseDataKey 用于通知YoMo只订阅Y3序列化后Tag为0x10的value
const NoiseDataKey = 0x10

// NoiseData 描述了Y3序列化后的Tag为0x10的Value所对应的反序列化数据结构
type NoiseData struct {
	Noise float32 `y3:"0x11"`
	Time  int64   `y3:"0x12"`
	From  string  `y3:"0x13"`
}

var printer = func(_ context.Context, i interface{}) (interface{}, error) {
	value := i.(NoiseData)
	rightNow := time.Now().UnixNano() / int64(time.Millisecond)
	return fmt.Sprintf("[%s] %d > value: %f ⚡️=%dms", value.From, value.Time, value.Noise, rightNow-value.Time), nil
}

var callback = func(v []byte) (interface{}, error) {
	var mold NoiseData
	err := y3.ToObject(v, &mold)
	if err != nil {
		return nil, err
	}
	mold.Noise = mold.Noise / 10
	return mold, nil
}

// Handler will handle data in Rx way
func Handler(rxstream rx.RxStream) rx.RxStream {
	stream := rxstream.
		Subscribe(NoiseDataKey).
		OnObserve(callback).
		Debounce(50).
		Map(printer).
		StdOut()

	return stream
}

3. 调试和运行

  1. 为了方便调试,我们创建了一个云端的数据模拟器,它可以产生源源不断的数据,我们只需要运行yomo dev就可以看到:

YoMo Tutorial 3

恭喜您!第一个YoMo应用已经完美运行起来啦!

Optional: Set $GOPATH and $GOBIN

针对Terminal当前的Session:

export GOPATH=~/.go
export PATH=$GOPATH/bin:$PATH

Shell用户持久保存配置设置:

如果您是zsh用户:

echo "export GOPATH=~/.go" >> .zshrc
echo "path+=$GOPATH/bin" >> .zshrc

如果您是bash用户:

echo 'export GOPATH=~/.go' >> .bashrc
echo 'export PATH="$GOPATH/bin:$PATH"' >> ~/.bashrc

🌶 与更多的优秀开源项目天然集成

Sources

Flows

Sinks

🗺 YoMo系统架构

Edge-Native: YoMo 追求随地部署、随时迁移、随时扩容

yomo-flow-arch

📚 Documentation

YoMo ❤️ Vercel, Our documentation website is

Vercel Logo

🎯 越来越多的数据产生在数据中心之外,YoMo 关注在离数据更近的位置,提供便利的计算框架

  • 对时延敏感的场景
  • 蜂窝网络下的会出现性能抖动,存在丢包、延时,比如LTE、5G
  • 源源不断的高频数据涌向业务处理
  • 对于复杂系统,希望使用 Streaming-Serverless 架构简化

🌟 YoMo 优势:

  • 全程基于 QUIC 协议传输数据,使用UDP协议替代TCP协议后,大幅提升了传输的稳定性和高通率
  • 自研的yomo-codec优化了数据解码性能
  • 全程基于 Rx 实现 Stream Computing 模型,并简化面向流式编程的复杂度
  • 通讯协议级别的“本质安全”

🦸 成为 YoMo 贡献者

首先感谢您的 contributions,是您这样的人让 YoMo 能变得越来越好!参与 YoMo 项目有很多种方式:

🤹🏻‍♀️ 反馈和建议

任何时候,建议和意见都可以写在 Discussion,每一条反馈都一定会被社区感谢!

开源协议

Apache License 2.0

QUIC学习资料

Awesome QUIC Logo

QUIC 的全称是 Quick UDP Internet Connections protocol, 由 Google 设计提出,目前由 IETF 工作组推动进展。其设计的目标是替代 TCP 成为 HTTP/3 的数据传输层协议。熹乐科技在物联网(IoT)和边缘计算(Edge Computing)场景也一直在打造底层基于 QUIC 通讯协议的边缘计算微服务框架 YoMo,长时间关注 QUIC 协议的发展,遂整理该文集并配以适当的中文翻译,方便更多关注 QUIC 协议的人学习。

QUIC Weekly - 每周一草

在线社区:🍖discord/quic
维护者:🦖YoMo

QUIC Weekly - 20210106期

QUIC Weekly - 20201209期

  • Wireshark v3.4.1 发布,增加了很多与 QUIC 相关的更新
  • 📢 draft-ietf-quic-manageability 讨论了 QUIC 传输协议的可管理性,重点讨论影响 QUIC 流量的网络操作的注意事项,比如,要实现 QUIC 的负载均衡,建议参考该文
  • 📢 Applicability of the QUIC Transport Protocol 讨论了QUIC传输协议的适用性,重点讨论了影响通过QUIC开发和部署应用协议的注意事项,比如,实现0-RTT的过程中要注意的安全问题
  • w3c WebTransport 在WebIDL中定义了一组ECMAScript API,允许在浏览器和服务器之间发送和接收数据,在底层实现可插拔协议,在上面实现通用API。本规范使用可插拔的协议,QUIC-TRANSPORT 就是这样一个协议,向服务器发送数据和从服务器接收数据。它可以像WebSockets一样使用,但支持多流、单向流、无序传输、可靠以及不可靠传输。
  • 📽 Google 的 David Schinaz 的视频 QUIC 101
  • Netty 发布了支持 QUIC 的 0.0.1.Final 该 Codec 实现了 IETF QUIC draft-32 版本,基于 qiuche 项目构建
  • Cloudflare 的博客 为 QUIC 加速 UDP 包传输
  • PDF: 软件模拟器 QUIC 协议的性能分析
  • 📢 draft-schinazi-masque-h3-datagram-01 QUIC DATAGRAM 扩展为在 QUIC 上运行的应用协议提供了一种发送不可靠数据的机制,同时利用了QUIC的安全和拥塞控制特性。本文档定义了当在 QUIC 上运行的应用协议是 HTTP/3 时,如何通过在 frame payload 的开头添加一个标识符来使用 QUIC DATAGRAM frame。这允许HTTP消息使用不可靠的DATAGRAM帧来传递相关信息,确保这些帧与HTTP消息正确关联。

QUIC Weekly - 20201202期

QUIC Weekly - 20201125期

QUIC Weekly - 20201118期

QUIC Weekly - 20201111期

QUIC Weekly - 20201104期

QUIC Weekly - 20201028期

  • 📢 DNS-over-QUIC
    • 对科学那啥可是个好东西,太敏感,咱也不敢多说...
  • Paper 基于QUIC的MQTT协议的实现和分析
    • 在端到端的通讯中,确保可靠和安全通信的基础是Transport和Security协议。对于IoT应用,这些协议必须是轻量级的,毕竟IoT设备通常都是硬件能力受限。不幸的是,目前广为流行的TCP/TLS和UDP/DTLS这两种方式,在建连、时延、连接迁移等方面有很多的不足。这篇论文研究了这些缺陷的根源,展示了如何借助QUIC协议优化IoT场景从而达到更高的网络性能,以IoT领域使用范围较广的MQTT协议为例,团队实现了主要的API和功能,并比较了使用QUIC和TCP构建的MQTT协议在有线网络、无线网络和长距离实验场景(long-distance testbeds)中的差异。
    • 测试的结果标明,基于QUIC协议实现的MQTT协议降低建连开销达56%
    • 在半连接场景下,对CPU和内存的消耗分别降低了83%和50%
    • 因为避免了队头阻塞(HOL Blocking)的问题,数据分发时延降低了55%
    • 数据传输速率的抖动也因为QUIC的连接迁移特性得到明显的改善。
  • Article HTTP/3: 你需要知道的下一代互联内网协议
  • Article QUIC和物联网IoT
    • IoT设备是应用QUIC协议的一个好场景,因为这些设备通常工作在无线(蜂窝)网络下(Cellular network),且需要快速建连、0-RTT和重传。但是,这些设备CPU能力普遍较弱。QUIC的作者其实多次提到QUIC对IoT应用场景有很大的提升,可惜的是,至今还没有一套为这个场景设计的协议栈(其实有啊:基于QUIC协议的Edge Computing框架: 🦖YoMo
  • Article 未来的Internet: HTTP/3 — No More TCP, let’s QUIC fix it(谐音梗我翻不出来了...)

QUIC Weekly - 20201021期

QUIC Weekly - 20201014期

  • Adoption Chrome 正在部署 HTTP/3 和 IETF QUIC
    • 当前最新的 Google QUIC 版本(Q050)与 IETF QUIC 有很多相似之处。但是到目前为止,大多数 Chrome 用户在未启用某些命令行选项的情况下没有与 IETF QUIC 服务器通信。
    • Google 搜索延迟减少了2%以上。 YouTube 的重新缓冲时间减少了9%以上,而台式机的客户端吞吐量增加了3%以上,移动设备的客户端吞吐量增加了7%以上。我们很高兴地宣布,Chrome 即将推出对 IETF QUIC(特别是草稿版本 H3-29)的支持。
    • 目前,有25%的 Chrome 稳定用户正在使用 H3-29。我们计划在接下来的几周内增加该数字,并继续监控性能数据。
    • Chrome 将积极支持 IETF QUIC H3-29 和 Google QUIC Q050,让支持 Q050 的服务器有时间更新到 IETF QUIC。
  • Adoption Cloudflare 向用户发送电子邮件,通知从本月开始 H3 将自动启用
  • CDN 最近被误解了。跨站点的浏览器缓存并不是那么重要,重要的是在存在点(POP)进行缓存。这种 POP 与你的终端用户的距离如此之近,可带来性能提升,因为TCP的传输距离很差。QUIC 可以通过改用 UDP 来解决此问题。 HackerNews
  • TechTalk Lucas Pardue:QUIC 和 HTTP/3:开放标准和开放源代码 (2020年10月27日。)
  • OpenSource quiche 已支持 QUIC 和 HTTP/3 不可靠的数据报。在保证数据的传输不是最重要的情况下,它可以降低延迟。
  • 在 Haskell 中开发 QUIC 丢失检测和拥塞控制

IETF进展

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2019~2020 CELLA, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

开源的工业互联网领域实时边缘计算网关和开发框架,通讯层基于QUIC协议更好的展现5G等低时延网络的价值,为流式处理设计的yomo-codec大幅提升吞吐量,基于插件的开发模式使得5分钟即可上线您的物联网实时边缘计算处理系统 展开 收起
Go
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/igit-cn/yomo.git
git@gitee.com:igit-cn/yomo.git
igit-cn
yomo
yomo
master

搜索帮助

14c37bed 8189591 565d56ea 8189591