Skip to content

πŸŽ₯ Make videos programmatically with React

bug fixes from new service naming

Matt McGillivrayb42e8b9d8427
diff --git a/packages/cloudrun/src/api/deploy-service.ts b/packages/cloudrun/src/api/deploy-service.ts
index 5d680c714a..7006e620f9 100644
--- a/packages/cloudrun/src/api/deploy-service.ts
+++ b/packages/cloudrun/src/api/deploy-service.ts
@@ -16,7 +16,8 @@ export type DeployServiceInput = {
};
export type DeployServiceOutput = {
- name: string | null | undefined;
+ fullName: string | null | undefined;
+ shortName: string | null | undefined;
uri: string | null | undefined;
alreadyExists: boolean;
};
@@ -37,6 +38,14 @@ export const deployService = async (
validateProjectID(options.projectID);
validateRemotionVersion(options.remotionVersion);
+ if (!options.memory) {
+ options.memory = '512Mi';
+ }
+
+ if (!options.cpu) {
+ options.cpu = '1.0';
+ }
+
const parent = `projects/${options.projectID}/locations/${options.region}`;
const cloudRunClient = getCloudRunClient();
@@ -55,7 +64,8 @@ export const deployService = async (
if (existingService) {
return {
- name: serviceName,
+ fullName: `projects/remotion-6/locations/${options.region}/services/${serviceName}`,
+ shortName: serviceName,
uri: null,
alreadyExists: true,
};
@@ -79,7 +89,8 @@ export const deployService = async (
const [response] = await operation.promise();
return {
- name: response.name,
+ fullName: response.name,
+ shortName: serviceName,
uri: response.uri,
alreadyExists: false,
};
diff --git a/packages/cloudrun/src/cli/commands/services/deploy.ts b/packages/cloudrun/src/cli/commands/services/deploy.ts
index 3a83893409..ee52503eea 100644
--- a/packages/cloudrun/src/cli/commands/services/deploy.ts
+++ b/packages/cloudrun/src/cli/commands/services/deploy.ts
@@ -18,8 +18,11 @@ export const cloudRunDeploySubcommand = async () => {
const remotionVersion = VERSION;
const allowUnauthenticated =
parsedCloudrunCli['allow-unauthenticated'] ?? false;
- const memory = parsedCloudrunCli.memory ?? '512Mi';
- const cpu = parsedCloudrunCli.cpu ?? '1.0';
+ let memory = parsedCloudrunCli.memory ?? '512Mi';
+ let cpu = parsedCloudrunCli.cpu ?? '1.0';
+
+ memory = String(memory);
+ cpu = String(cpu);
if (!CliInternals.quietFlagProvided()) {
Log.info(
@@ -60,8 +63,13 @@ Validating Deployment of Cloud Run Service:
redeploy: true,
});
- if (!deployResult.name) {
- Log.error('service name not returned from Cloud Run API.');
+ if (!deployResult.fullName) {
+ Log.error('full service name not returned from Cloud Run API.');
+ throw new Error(JSON.stringify(deployResult));
+ }
+
+ if (!deployResult.shortName) {
+ Log.error('short service name not returned from Cloud Run API.');
throw new Error(JSON.stringify(deployResult));
}
@@ -77,9 +85,9 @@ Validating Deployment of Cloud Run Service:
`
Service Already Deployed! Check GCP Console for Cloud Run URL.
- Full Service Name = ${deployResult.name}
+ Full Service Name = ${deployResult.fullName}
Project = ${projectID}
- GCP Console URL = https://console.cloud.google.com/run/detail/${region}/${deployResult.name}/revisions
+ GCP Console URL = https://console.cloud.google.com/run/detail/${region}/${deployResult.shortName}/revisions
`.trim()
)
);
@@ -91,17 +99,17 @@ Validating Deployment of Cloud Run Service:
`
πŸŽ‰ Cloud Run Deployed! πŸŽ‰
- Full Service Name = ${deployResult.name}
+ Full Service Name = ${deployResult.fullName}
Cloud Run URL = ${deployResult.uri}
Project = ${projectID}
- GCP Console URL = https://console.cloud.google.com/run/detail/${region}/${deployResult.name}/revisions
+ GCP Console URL = https://console.cloud.google.com/run/detail/${region}/${deployResult.shortName}/revisions
`.trim()
)
);
}
await allowUnauthenticatedAccessToService(
- deployResult.name,
+ deployResult.fullName,
allowUnauthenticated
);
} catch (e: any) {