地区选择
Cloud Run 处于 Alpha 状态,且尚未积极开发。
在使用 Remotion Cloud Run 上线之前,你需要考虑将服务和存储桶(将存放你的网站和渲染内容)部署到哪个 GCP 区域。
🌐 Before going live with Remotion Cloud Run, you need to think about into which GCP region you are deploying your service and bucket (which will hold your sites and renders).
本文件解释了如何选择一个区域以及你需要考虑哪些因素。
🌐 This document explains how to select a region and which considerations you need to make.
可用地区
🌐 Available regions
以下 GCP 地区可用:
🌐 The following GCP regions are available:
asia-east1asia-east2asia-northeast1asia-northeast2asia-northeast3asia-south1asia-south2asia-southeast1asia-southeast2australia-southeast1australia-southeast2europe-central2europe-north1europe-southwest1europe-west1europe-west2europe-west3europe-west4europe-west6europe-west8europe-west9me-west1northamerica-northeast1northamerica-northeast2southamerica-east1southamerica-west1us-central1us-east1us-east4us-east5us-south1us-west1us-west2us-west3us-west4
你可以调用 getRegions() 或输入 npx remotion cloudrun regions 来以编程方式获取此列表。
🌐 You can call getRegions() or type npx remotion cloudrun regions to get this list programmatically.
默认区域
🌐 Default region
默认区域是 us-east1。
🌐 The default region is us-east1.
选择一个区域
🌐 Selecting a region
有三种方式选择一个区域:
🌐 There are 3 ways to select a region:
- 在使用 Node.JS API 时,你必须将区域明确传递给每个函数。确保你的项目符合 Typescript 类型或遵循文档。
- 使用 CLI 时,你可以使用
REMOTION_GCP_REGION环境变量设置区域。最好将其放在.env文件中。 - 你也可以将
--region标志传递给所有 CLI 命令以覆盖区域。该标志优先于环境变量。
在使用 Node.JS API 时,REMOTION_GCP_REGION 环境变量和 --region 标志不起作用。你需要显式传递一个区域。
如果你不设置区域,Remotion 将使用默认区域。
🌐 If you don't set a region, Remotion will use the default region.
我应该选择哪个地区?
🌐 Which region should I choose?
请注意,每个地区属于两种不同定价等级之一。某些地区还提供低 CO2 强度的电力使用。每个等级的完整地区列表可在 Cloud Run 文档 中查看。
其他考虑因素
🌐 Other considerations
- Cloud Run 服务和 Cloud Storage 存储桶应该位于同一地区,以消除跨数据中心的延迟。