Skip to content

🎥 Make videos programmatically with React

deployService and getServices api docs

Matt McGillivray1ebbf887aabc
diff --git a/packages/cloudrun/src/cli/commands/services/deploy.ts b/packages/cloudrun/src/cli/commands/services/deploy.ts
index 99a17132a2..6153f2448b 100644
--- a/packages/cloudrun/src/cli/commands/services/deploy.ts
+++ b/packages/cloudrun/src/cli/commands/services/deploy.ts
@@ -18,7 +18,7 @@ export const cloudRunDeploySubcommand = async () => {
const remotionVersion = parsedCloudrunCli['remotion-version'] ?? VERSION;
const allowUnauthenticated =
parsedCloudrunCli['allow-unauthenticated'] ?? false;
- let memoryLimit = parsedCloudrunCli.memoryLimit ?? '512Mi';
+ let memoryLimit = parsedCloudrunCli.memoryLimit ?? '2Gi';
let cpuLimit = parsedCloudrunCli.cpuLimit ?? '1.0';
const timeoutSeconds = parsedCloudrunCli.timeoutSeconds ?? 300;
diff --git a/packages/docs/docs/cloudrun.md b/packages/docs/docs/cloudrun.md
index 1957ed8f78..b412a4f70c 100644
--- a/packages/docs/docs/cloudrun.md
+++ b/packages/docs/docs/cloudrun.md
@@ -72,8 +72,7 @@ You can control Remotion Cloud Run using the `npx remotion cloudrun` command.
## Node.JS API
-// TODO: Link to API reference
-Everything you can do using the CLI, you can also control using Node.JS APIs. See the reference [here](#).
+Everything you can do using the CLI, you can also control using Node.JS APIs. See the reference [here](/docs/cloudrun/api).
## License
diff --git a/packages/docs/docs/cloudrun/deployservice.md b/packages/docs/docs/cloudrun/deployservice.md
index f859d07f32..ee744d3164 100644
--- a/packages/docs/docs/cloudrun/deployservice.md
+++ b/packages/docs/docs/cloudrun/deployservice.md
@@ -8,7 +8,7 @@ crumb: "Cloudrun API"
Creates a [GCP Cloud Run](https://cloud.google.com/run) service in your GCP project that will be able to render a video in the cloud.
-If a service with the same version, memory limit and cpu limit already existed, it will be returned instead without a new one being created. This means this service can be treated as idempotent.
+If a service with the same Remotion version, memory limit, cpu limit and timeout already existed in the specified region, it will be returned instead without a new one being created. This means this service can be treated as idempotent.
## Example
@@ -35,15 +35,15 @@ An object with the following properties:
### `remotionVersion`
-The Remotion version of the service. Remotion is versioning the Cloud Run service and a render can only be triggered from a version of `@remotion/cloudrun` that is matching the one of the service.
+The Remotion version of the service. Remotion is versioning the Cloud Run service and a render can only be triggered from a version of `@remotion/cloudrun` that is matching the service.
### `memoryLimit`
-The upper bound on the amount of RAM that the Cloud Run service can consume. By default we recommend a value of 2GiB. You may increase or decrease it depending on how memory-consuming your video is. The minimum allowed number is `512MiB`, the maximum allowed number is `32GiB`. Since the costs of Remotion Cloud Run is directly proportional to the amount of RAM, we recommend to keep this amount as low as possible.
+The upper bound on the amount of RAM that the Cloud Run service can consume. By default we recommend a value of 2GiB. You may increase or decrease it depending on how memory-consuming your video is. The minimum allowed number is `512MiB`, the maximum allowed number is `32GiB`. Since the costs of Remotion Cloud Run is directly proportional to the amount of RAM, we recommend to keep this amount as low as possible. As the Memory limit is raised, there is a [corresponding minimum CPU Limit](https://cloud.google.com/run/docs/configuring/memory-limits#cpu-minimum) that must be observed.
### `cpuLimit`
-The maximum number of CPU cores that the Cloud Run service can use to process requests.
+The maximum number of CPU cores that the Cloud Run service can use to process requests. The default is 1. As the CPU limit is raised, there is a [corresponding minimum Memory Limit](https://cloud.google.com/run/docs/configuring/cpu#setting) that must be observed.
### `timeoutSeconds`
@@ -57,6 +57,10 @@ The [project ID](https://cloud.google.com/resource-manager/docs/creating-managin
The [GCP region](/docs/cloudrun/region-selection) which you want to deploy the Cloud Run Service too.
+### `performImageVersionValidation`
+
+Default as true. This will validate that an image exists in the public Artifact Registry that matches the Remotion Version you are trying to deploy. Can be set false for a potential time saving.
+
## Return value
An object with the following values:
diff --git a/packages/docs/docs/cloudrun/getservices.md b/packages/docs/docs/cloudrun/getservices.md
index a3ebf3b552..e07ddbe2e5 100644
--- a/packages/docs/docs/cloudrun/getservices.md
+++ b/packages/docs/docs/cloudrun/getservices.md
@@ -6,7 +6,7 @@ slug: /cloudrun/getservices
crumb: "Cloudrun API"
---
-Retrieves a list of services that Remotion deployed to GCP Cloud Run in a certain region.
+Retrieves a list of Remotion services deployed to GCP Cloud Run in a certain region, or for all regions.
The parameter `compatibleOnly` determines whether only services that are compatible with the installed version of Remotion Cloud Run should be returned.
@@ -46,7 +46,29 @@ An object containing the following properties:
### `region`
-The [GCP region](/docs/cloudrun/region-selection) that you would like to query.
+The [GCP region](/docs/cloudrun/region-selection) that you would like to query. It is also possible to pass 'all regions' here, to ignore the region constraint.
+
+## Example
+
+```ts twoslash
+// @module: esnext
+// @target: es2017
+
+import { getServices } from "@remotion/cloudrun";
+
+const info = await getServices({
+ region: "all regions",
+ compatibleOnly: true,
+});
+
+for (const service of info) {
+ console.log(service.serviceName); // "remotion--3-3-82--mem2gi--cpu2--t-1100"
+ console.log(service.timeoutInSeconds); // 1100
+ console.log(service.memoryLimit); // 2Gi
+ console.log(service.cpuLimit); // 2
+ console.log(service.remotionVersion); // "3.3.82"
+}
+```
### `compatibleOnly`
@@ -76,6 +98,14 @@ The Remotion version of the service. Remotion is versioning the Cloud Run servic
The timeout that has been assigned to the Cloud Run service.
+### `uri`
+
+The endpoint of the service.
+
+### `region`
+
+The region of the deployed service. Useful if passing 'all regions' to the region input.
+
## See also
- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/cloudrun/src/api/get-services.ts)