Skip to main content

npx remotion cloudrun 服务部署

EXPERIMENTAL
npx remotion cloudrun services deploy

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

🌐 Creates a new service in your GCP project. If a service exists in the same region, with the same Remotion version, with the same amount of memory, disk space and timeout duration, the name of the already deployed service will be returned instead.

示例输出

验证 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 区域。服务将访问的站点也应位于同一区域,以最大限度地减少延迟。

🌐 The GCP region to select. The site that the service will be accessing should also be in this same region to minimise latency.

--memoryLimit

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

🌐 The upper bound on the amount of RAM that the Cloud Run service can consume. Default: 2 GB.

--cpuLimit

Cloud Run 服务可用来处理请求的最大 CPU 内核数。默认值:1.0。

🌐 The maximum number of CPU cores that the Cloud Run service can use to process requests. Default: 1.0.

--minInstances

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

🌐 The minimum number of service instances to have available, regardless of requests. Default: 0.

note

任何正在运行的实例,即使它们没有执行渲染,也将在 GCP 中计费。默认的最少实例数为零,这意味着当没有请求发送到你的服务时,你不会被收费。

--maxInstances

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

🌐 The maximum number of service instances that can be create by GCP in response to incoming requests. Default: 100.

--timeoutSeconds

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

🌐 Timeout of the Cloud Run service. Default: 300 seconds.

info

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

--onlyAllocateCpuDuringRequestProcessingv4.0.221

如果将此设置为 true,cpu_idle 将在服务清单中设置为 true。 在没有请求被处理时,CPU 分配将被禁用,这可能会带来显著的成本节省。

🌐 If this is set to true, cpu_idle will be set to true in the service manifest.
CPU alloction will be disabled while no request is being processed, which can lead to significant cost savings.

--quiet, -q

只记录服务名称,以及“已授权访问”。

🌐 Only logs the service name, and 'Authenticated access granted'.

另请参阅

🌐 See also