Dragonfly 最新版本 v2.0.9 发布

2803afb9ee0e81d3b4670dc00e440d06.gif

文|戚文博(花名:百蓦)

Dragonfly Maintainer

蚂蚁集团软件工程师

b11acf2ec47eb752f217df44f6cc416f.jpeg

主要负责「基于 P2P 的文件以及镜像加速系统」。

本文 5005 字 阅读 13 分钟

9e772f20c036523ff50e6c778130cb5b.png

Dragonfly 最新正式版本 v2.0.9 已经发布!感谢 Dragonfly 的贡献者们,同时也感谢默默支持 Dragonfly 项目的各个公有云团队。欢迎访问 d7y.io[1] 网站来了解详情,下面具体介绍 v2.0.9 版本带来了那些更新。

59163364ae643d7d1edef2eec26831e5.png

功能

1、下载任务可以根据优先级(Priority)进行下载。优先级可以在下载任务时 Cli 中作为参数传入,也可以在 Manager Console 设置对应应用关联的优先级。具体不同优先级的功能可以参考文档 priority protoc definition[2] 

2、Scheduler 配置新增 PieceDownloadTimeout 字段,做用是当某个 Piece 下载超过 Timeout 时,设置对应的 Task 状态变更为失败。防止异常 Task 元信息残留在 Scheduler 中。

3、gRPC 服务新增 Health Service 和 Reflection 服务。

4、Manager 支持 Redis 哨兵模式(sentinal model)

5、重构 Dynconfig 模块移除 json.Unmarshal 操作,提高 Dynconfig 模块运行时效率。并且支持通过健康检查的方式过滤异常地址服务。

6、修复当前无可用服务时,gRPC 未构建哈希环所造成的异常。

7、早期版本当同一个 Task 的多个 Piece 并发下载时,Scheduler 会调度多个 Parent 给当前 Peer 进行下载,但多个 Piece 基本都会从单个 Parent 进行下载。当前版本更改多个 Piece 可以从不同的 Parent 并发下载,可以防止流量集中在部分热点 Parent,提高下载效率的同时也提高了带宽平均利用率。

8、Peer 调用 Manager 获取匹配的 Scheduler Cluster 的时候。如果没有匹配到任何 Scheduler Cluster,那么 Manager 会返回所有的 Scheduler Cluster 提供给 Peer。Peer 会使用 Health Check 通过的 Scheduler Cluster 地址供后续下载调度使用。

9、支持 ORAS[3] 网客户端的回源下载协议,扩展容器镜像生态支持。

10、增加 UDP Ping 包的支持和虚拟网络拓扑的 gRPC Protoc 定义。未来会新增基于网络探测构建虚拟网络拓扑结构,提高调度算法的精确度。

11、完成 V2 版本的 P2P 协议[4] 网的定义。Scheduler 和 Manager 对应实现了 V2 版本的 P2P 协议的功能。未来会基于 V2 版本的 P2P 协议和 Rust 语言重写 Dfdaemon,提高客户端性能的同时能够依赖更加标准且扩展性更强的 V2 版本的 P2P 协议。

12、OSS 客户端回源协议新增基于 STS 临时访问凭证来访问 OSS 源站。

13、Scheduler 新增 Host TTLandhostGCInterval 配置,主要作用于 Host 元数据的释放。可以保证在 Peer 主机异常退出的情况下,仍然可以释放掉异常的 Host 元数据,防止脏数据残留。

14、Manager 的 Searcher 模块新增根据 CIDR[5] 条件去筛选当前 Peer 匹配的 Scheduler Cluster,提供更精确的匹配计算方式。

15、重构 V1 版本 P2P 协议的 Metric,新增加了 V2 版本 P2P 协议的 Metric,并且根据新的 Metrics 更新 Helm Charts[6]  的 PrometheusRule 对应的告警规则。重新整理 Dragonfly Grafana Dashboards[7] 方便用户可以一键导入 Dashboards,观测 P2P 网络流量以及服务相关数据。

具体文档可以参考 Monitoring[8]  ,Grafana Dashboard 维护在项目 Dragonflyoss/Monitoring[9] 中。版本更新包含的更多细节可以参考 ChangeLog[10] 

破坏性变更

老版本 Manager 由于使用了默认的 JWT Key 生成 JWT Token 会引起安全性问题,具体可以参考 security issues[11] 。所以 Manager 服务配置文件新增了 JWT 配置[12] 

当老版本 Manager 升级过程中需要在新版本 Manager 的配置文件中新增 JWT Key 配置,并且 JWT Key 是需要用户自己生成,具体 JWT Key 如何配置可以参考 Setting it in the Manager Configuration[13] 

公有云厂商支持

Alibaba Cloud(阿里云)- 阿里云提供安装 Dragonfly 1.x 在容器镜像仓库 Container Registry[14] 。使用文档可以参考 Use P2P Acceleration in ASK[15] 。推荐使用更加高效且稳定的 Dragonfly 2.0[16] ,部署文档参考 Setup Dragonfly in Kubernetes[17]

Google Cloud Platform(GCP)- GCP 提供一键点击部署 Dragonfly 在 Google Kubernetes Engine(GKE)[18] 的 Marketplace[19],具体文档可以参考 Click to Deploy Dragonfly[20]

Volcano Engine(火山引擎)- 火山引擎在容器服务(VKE and 和镜像仓库(CR)中集成了 CNCF 孵化项目 Dragonfly。欢迎访问 VKE[21] & CR[22] 了解更多。

Baidu AI Cloud(百度智能云)- 百度智能云提供在 Cloud Container Engine(CCE)[24] 一键部署 P2P 加速服务,其能力来自于 Dragonfly。

|相关链接|

Dragonfly 社区官网网站:

[1] Dragonfly 官网:https://d7y.io/

[2] Priority Protoc Definition:https://github.com/dragonflyoss/api/blob/main/pkg/apis/common/v2/common.proto#L74

[3] ORAS:https://github.com/oras-project/oras

[4] V2 版本的 P2P 协议:https://github.com/dragonflyoss/api/tree/main/proto

[5] CIDR:https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

[6] Helm Charts:https://github.com/dragonflyoss/helm-charts

[7] Dragonfly Grafana Dashboards:https://grafana.com/grafana/dashboards/?search=dragonfly

[8] Monitoring:https://d7y.io/docs/concepts/observability/monitoring

[9] Dragonfly Monitor:https://github.com/dragonflyoss/monitoring

[10] ChangeLog:https://github.com/dragonflyoss/Dragonfly2/blob/main/CHANGELOG.md

[11] Security issues:https://github.com/dragonflyoss/Dragonfly2/security/advisories/GHSA-hpc8-7wpm-889w

[12] JWT 配置:https://github.com/dragonflyoss/Dragonfly2/pull/2161

[13] Setting it in the Manager configuration:https://github.com/dragonflyoss/d7y.io/blob/main/docs/reference/configuration/manager.md?plain=1#L56

[14] 阿里云镜像仓库:https://www.alibabacloud.com/product/container-registry

[15] Use P2P Acceleration in ASK:https://www.alibabacloud.com/help/en/container-registry/latest/use-the-p2p-acceleration-feature-in-ask-and-ack-clusters

[16] Dragonfly 仓库:https://github.com/dragonflyoss/Dragonfly2

[17] Setup Dragonfly in Kubernetes:https://d7y.io/docs/getting-started/quick-start/kubernetes/

[18] Google Kubernetes Engine(GKE):https://cloud.google.com/kubernetes-engine

[19] Google Cloud Platform(GCP)Marketplace:https://console.cloud.google.com/marketplace/product/google/dragonfly

[20] Google Cloud Platform(GCP)Dragonfly Marketplace:https://console.cloud.google.com/marketplace/product/google/dragonfly

[21] 火山引擎容器服务(VKE):https://www.volcengine.com/product/vke

[22] 火山引擎镜像仓库(CR):https://www.volcengine.com/product/cr

[23] 百度智能云容器服务(CCE):https://intl.cloud.baidu.com/product/cce.html

[24]Dragonfly 官网:https://d7y.io/

[25]Dragonfly Charts 仓库:https://github.com/dragonflyoss/helm-charts。

[26]Dragonfly Monitor 仓库:https://github.com/dragonflyoss/monitoring。

[27]阿里云容器仓库:https://www.alibabacloud.com/product/container-registry。

[28]阿里云容器服务(ACK)https://www.alibabacloud.com/product/kubernetes。

[29]Google Kubernetes Engine(GKE)https://cloud.google.com/kubernetes-engine。

[30]Google Cloud Platform(GCP)Dragonfly Marketplace:https://console.cloud.google.com/marketplace/product/google/dragonfly

[31]火山引擎容器服务(VKE)https://www.volcengine.com/product/vke

[32]火山引擎容器仓库(CR)https://www.volcengine.com/product/cr

[33]百度智能云容器服务(CCE)https://intl.cloud.baidu.com/product/cce.html

扫码加入 Dragonfly 钉钉群,快来和我们一起讨论吧!

3c6b83cd073da6f42de1097b47fa0523.jpeg

Dragonfly Star 一下✨:
https://github.com/dragonflyoss/Dragonfly2

   本周推荐阅读  

c17f071615b3b833644d16f4377e4fe7.png

Dragonfly 基于 P2P 的文件和镜像分发系统

9cc77cb4e6a24ddcade0bcd595fcb993.png

Dragonfly 中 P2P 传输协议优化

40f08e6f240b71c40db1ceb574e09361.png

Occlum Meetup - 一起来聊机密计算 TEE

78cc755d52e8f96053cf0eb3f51d33b5.png

展台招募|“SOFA 五周年”开源集市等你来!

79781740e615a0400db5e9b73038fc84.jpeg

猜你喜欢

转载自blog.csdn.net/SOFAStack/article/details/129700708