Skip to main content

npx remotion cloudrun services

EXPERIMENTAL

Cloud Run 处于 Alpha 阶段,这意味着 API 可能会在任何版本中更改,文档尚未完成。请查看 更改日志 以保持最新的重大更改。

npx remotion cloudrun services 命令允许您部署、查看和删除可以渲染视频和静态图像的 GCP Cloud Run 服务。

您每个 GCP 区域和 Remotion 版本只需要一个服务。

deploy

npx remotion cloudrun services deploy
npx remotion cloudrun services deploy

在您的 GCP 项目中创建一个新服务。如果在同一区域中存在一个具有相同 Remotion 版本、相同内存、磁盘空间和超时持续时间的服务,则将返回已部署服务的名称。

示例输出

验证 Cloud Run 服务的部署:

Remotion 版本: 3.3.95
内存限制: 2Gi
CPU 限制: 1.0
超时: 300
项目名称: remotion-example
区域: us-east1

正在部署 Cloud Run 服务...


Cloud Run 已部署!

服务名称: remotion--3-3-95--mem512mi--cpu2--t-1200
版本: 3.3.95
CPU 限制: 2
内存限制: 512Mi
超时: 1200秒
区域: us-east1
服务 URL: https://remotion--3-3-95--mem512mi--cpu2--t-1200-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL: https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-95--mem512mi--cpu2--t-1200/logs

--region

选择的 GCP 区域。服务将访问的站点也应在相同区域,以最小化延迟。

--memoryLimit

Cloud Run 服务可以消耗的 RAM 上限。默认值:2 GB。

--cpuLimit

Cloud Run 服务用于处理请求的 CPU 核心数上限。默认值:1.0。

--minInstances

无论请求量如何,要保持可用的服务实例的最小数量。默认值:0。

note

任何正在运行的实例,即使它们没有执行渲染操作,也会在 GCP 中产生费用。默认的最小实例数量为零,这意味着当没有请求发送到您的服务时,您不会被收费。

--maxInstances

GCP 可以响应传入请求时可以创建的服务实例的最大数量。默认值:100。

--timeoutSeconds

Cloud Run 服务的超时时间。默认值:300 秒。

info

不要与渲染时定义 delayRender() 超时的 --timeout 标志 混淆。

--quiet, -q

仅记录服务名称和“已授予身份验证访问”。

ls

npx remotion cloudrun services ls
npx remotion cloudrun services ls

列出您在 所选区域 部署到 GCP 的服务。

示例输出

us-east1 中的 2 个服务

服务名称:remotion--3-3-95--mem512mi--cpu2--t-1200
版本:3.3.95
CPU 限制:2
内存限制:512Mi
超时:1200 秒
区域:us-east1
服务 URL:https://remotion--3-3-95--mem512mi--cpu2--t-1200-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL:https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-95--mem512mi--cpu2--t-1200/logs

服务名称:remotion--3-3-82--mem512mi--cpu1-0--t-800
版本:3.3.82
CPU 限制:1.0
内存限制:512Mi
超时:800 秒
区域:us-east1
服务 URL:https://remotion--3-3-82--mem512mi--cpu1-0--t-800-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL:https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-82--mem512mi--cpu1-0--t-800/logs

--region

用于列出服务的 GCP 区域

--quiet, -q

仅以空格分隔的列表形式打印服务名称。如果不存在服务,则打印 ()

rm

npx remotion cloudrun services rm remotion--3-3-82--mem512mi--cpu1-0--t-800
npx remotion cloudrun services rm remotion--3-3-82--mem512mi--cpu1-0--t-800

从您的 GCP 项目中删除一个或多个服务。传递一个以空格分隔的服务列表以进行删除。

示例输出


服务名称: remotion--3-3-82--mem2gi--cpu1-0--t-800
版本: 3.3.82
CPU 限制: 1.0
内存限制: 2Gi
超时: 300秒
区域: us-east1
服务 URL: https://remotion--3-3-82--mem2gi--cpu1-0--t-800-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL: https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-82--mem2gi--cpu1-0--t-800/logs 删除? (Y/n): Y
已删除!


--region

用于选择的 GCP 区域

--yes, -y

跳过确认。

rmall

npx remotion cloudrun services rmall
npx remotion cloudrun services rmall

从您的 GCP 项目中删除特定区域的所有服务。

示例输出

us-east1 中有 2 个服务

服务名称: remotion--3-3-95--mem512mi--cpu2--t-1200
版本: 3.3.95
CPU 限制: 2
内存限制: 512Mi
超时: 1200秒
区域: us-east1
服务 URL: https://remotion--3-3-95--mem512mi--cpu2--t-1200-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL: https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-95--mem512mi--cpu2--t-1200/logs

删除? (Y/n) n
跳过服务 - remotion--3-3-95--mem512mi--cpu2--t-1200。

服务名称: remotion--3-3-82--mem512mi--cpu1-0--t-800
版本: 3.3.82
CPU 限制: 1.0
内存限制: 512Mi
超时: 800秒
区域: us-east1
服务 URL: https://remotion--3-3-82--mem512mi--cpu1-0--t-800-1a2b3c4d5e-ue.a.run.app
GCP 控制台 URL: https://console.cloud.google.com/run/detail/us-east1/remotion--3-3-82--mem512mi--cpu1-0--t-800/logs

删除? (Y/n) n
跳过服务 - remotion--3-3-82--mem512mi--cpu1-0--t-800。

--region

从中删除服务的 GCP 区域

--yes, -y

跳过确认。

另请参阅