基础设施服务商Rivet发布了开源工具OpenOrange,允许开发者将Cloudflare Workers代码迁移至AWS、Google Cloud、Azure、Rivet Cloud或自有服务器上运行 1。该工具旨在消除云厂商的运行时限制并降低特定场景下的成本,同时保持原有的开发体验 1。
在技术实现上,OpenOrange基于Node.js实现了Workers API并映射到Rivets基础设施,而非直接运行workerd 1。这一架构解决了Cloudflare Worker原有的128 MB内存上限问题,使资源占用完全取决于用户所选硬件配置 1。
在兼容性方面,OpenOrange保持了相同的开发者体验,支持wrangler.jsonc配置文件、Bindings以及环境变量 1。针对成本敏感的场景,特别是因Durable Objects持续活跃而导致高额按GB-second计费的情况,Rivet声称在Graviton EC2实例上运行可使成本降至原费用的约五分之一 1。
对于数据迁移,工具提供了orange migrate命令以实现Durable Objects数据的零停机转移;但需注意,D1数据库在迁移过程中会导致几分钟的服务中断 1。目前,OpenOrange以Apache 2.0协议开源并由Rivet独立维护,官方明确声明该项目与Cloudflare Inc.无关联且未获其背书 1。
Rivet has released OpenOrange, an open-source tool designed to allow developers to migrate and run Cloudflare Workers code on diverse infrastructure including AWS, Google Cloud Platform, Azure, Rivet Cloud, and private servers 1. The utility is maintained by Rivet and operates independently of Cloudflare Inc., having neither affiliation with nor endorsement from the company 1. Unlike solutions that directly execute workerd, OpenOrange implements the Workers API using Node.js and maps it to Rivet’s underlying infrastructure 1.
A primary motivation for adopting this tool is overcoming specific runtime limitations imposed by Cloudflare, such as the 128 MB memory cap, by allowing resources to scale according to the hardware selected by the user 1. Additionally, the tool addresses cost concerns related to Durable Objects; when these objects remain active continuously, they incur high per-GB-second billing on Cloudflare, whereas running them on Graviton EC2 instances via OpenOrange is claimed to reduce costs to approximately one-fifth of the original expense 1.
OpenOrange aims to preserve the existing developer experience by maintaining compatibility with wrangler.jsonc configurations, bindings, and environment variables 1. For data migration, the tool provides an orange migrate command that facilitates zero-downtime transfers for Durable Objects 1. However, users should note that migrating D1 databases will result in a service interruption lasting several minutes 1. The project is distributed under the Apache 2.0 license 1.
评论
还没有评论,欢迎留下第一条。