π₯ Make videos programmatically with React
move GCP installer
Jonny Burgeref77dcb08fb3
diff --git a/.gitignore b/.gitignoreindex 8704f60eef..453de13eaa 100644--- a/.gitignore+++ b/.gitignore@@ -18,5 +18,5 @@ packages/cloudrun/remotion-lambda-gcp.code-workspacepackages/example/sa-key.jsonpackages/example/public/pts-framermp4withoutfileextension.mp4packages/it-tests/packages/example/out/element-2.png-packages/cloudrun/gcpInstaller/terraform*-packages/cloudrun/gcpInstaller/*.tfplan+packages/cloudrun/src/gcpInstaller/terraform*+packages/cloudrun/src/gcpInstaller/*.tfplandiff --git a/packages/cloudrun/.eslintrc b/packages/cloudrun/.eslintrcindex 979d4d7138..1a478661e6 100644--- a/packages/cloudrun/.eslintrc+++ b/packages/cloudrun/.eslintrc@@ -15,7 +15,7 @@},"overrides": [{- "files": "./gcpInstaller/**",+ "files": "./src/gcpInstaller/**","rules": {"no-console": "off"}diff --git a/packages/cloudrun/src/admin/bundle-installer.ts b/packages/cloudrun/src/admin/bundle-installer.tsindex ef8df5a688..a6628deb92 100644--- a/packages/cloudrun/src/admin/bundle-installer.ts+++ b/packages/cloudrun/src/admin/bundle-installer.ts@@ -14,17 +14,14 @@ const bundleInstaller = async () => {bundle: true,outfile: bundlemjs,format: 'esm',- entryPoints: [path.resolve(__dirname, '../../gcpInstaller/install.mts')],+ entryPoints: [path.resolve(__dirname, '../gcpInstaller/install.mts')],});const tfoutfile = path.join(outdir, 'main.tf');- copyFileSync(- path.resolve(__dirname, '../../gcpInstaller/main.tf'),- tfoutfile- );+ copyFileSync(path.resolve(__dirname, '../gcpInstaller/main.tf'), tfoutfile);execSync(- `tar -cf ../../gcpInstaller/gcpInstaller.tar -C . ${path.relative(+ `tar -cf ../gcpInstaller/gcpInstaller.tar -C . ${path.relative(outdir,bundlemjs)} ${path.relative(outdir, tfoutfile)}`,diff --git a/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts b/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.tsindex ca3b4ce372..2248e15552 100644--- a/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts+++ b/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts@@ -41,7 +41,6 @@ export const renderArgsCheck = async (subcommand: string, args: string[]) => {urlOrId: siteName,bucketName: remotionBucket,});- Log.info(`Serve URL: ${serveUrl}\n`);}let composition: string = args[1];@@ -97,10 +96,8 @@ export const renderArgsCheck = async (subcommand: string, args: string[]) => {}if (serviceName) {- Log.info('Cloud Run service name passed, fetching Cloud Run url...');region = region ?? getGcpRegion();const {uri} = await getServiceInfo({serviceName, region});- Log.info('cloud run url found: ', uri);cloudRunUrl = uri;}diff --git a/packages/cloudrun/src/cli/commands/render/renderMedia.ts b/packages/cloudrun/src/cli/commands/render/renderMedia.tsindex b20bfaa4e6..ffc92e2697 100644--- a/packages/cloudrun/src/cli/commands/render/renderMedia.ts+++ b/packages/cloudrun/src/cli/commands/render/renderMedia.ts@@ -64,8 +64,6 @@ export const renderMediaSubcommand = async (CliInternals.Log.info(CliInternals.chalk.gray(`-Sending request to Cloud Run:-Cloud Run Service URL = ${cloudRunUrl}Type = mediaComposition = ${composition}diff --git a/packages/cloudrun/src/cli/commands/render/renderStill.ts b/packages/cloudrun/src/cli/commands/render/renderStill.tsindex 5ab54377b3..4e3cd11c08 100644--- a/packages/cloudrun/src/cli/commands/render/renderStill.ts+++ b/packages/cloudrun/src/cli/commands/render/renderStill.ts@@ -47,6 +47,7 @@ export const renderStillSubcommand = async (configImageFormat:ConfigInternals.getUserPreferredStillImageFormat() ?? null,});+ Log.verbose(`Image format: (${imageFormat}), ${imageFormatReason}`);// Todo: Check cloudRunUrl is valid, as the error message is obtuseCliInternals.Log.info(CliInternals.chalk.gray(@@ -75,13 +76,13 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}let doneIn: DoneIn = null;- const updateProgress = () => {+ const updateProgress = (newline: boolean) => {progressBar.update([- `Rendering on Cloud Run: `,+ `Rendering on Cloud Run:`,`${doneIn === null ? '...' : `Rendered in ${doneIn}ms`}`,].join(' '),- false+ newline);};@@ -103,27 +104,21 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}outputFile: outName,});doneIn = Date.now() - renderStart;- updateProgress();+ updateProgress(true);if (res.status === 'success') {- Log.info(`-- `);Log.info(- CliInternals.chalk.blueBright(- `-π€ Rendered still on Cloud Run! π€-- Public URL = ${decodeURIComponent(res.publicUrl)}- Cloud Storage Uri = ${res.cloudStorageUri}- Size (KB) = ${Math.round(Number(res.size) / 1000)}- Bucket Name = ${res.bucketName}- Privacy = ${res.privacy}- Render ID = ${res.renderId}- Image Format = ${imageFormat} (${imageFormatReason})- `.trim()+ CliInternals.chalk.gray(`Cloud Storage Uri = ${res.cloudStorageUri}`)+ );+ Log.info(CliInternals.chalk.gray(`Render ID = ${res.renderId}`));+ Log.info(+ CliInternals.chalk.gray(+ `${Math.round(Number(res.size) / 1000)} KB, Privacy: ${+ res.privacy+ }, Bucket: ${res.bucketName}`));+ Log.info(CliInternals.chalk.blue(`β ${res.publicUrl}`));if (downloadName) {Log.info('');diff --git a/packages/cloudrun/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tarsimilarity index 100%rename from packages/cloudrun/gcpInstaller/gcpInstaller.tarrename to packages/cloudrun/src/gcpInstaller/gcpInstaller.tardiff --git a/packages/cloudrun/gcpInstaller/install.mts b/packages/cloudrun/src/gcpInstaller/install.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/install.mtsrename to packages/cloudrun/src/gcpInstaller/install.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/checkEnvFile.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/checkEnvFile.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/checkEnvFile.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/checkEnvFile.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/checkTerraformStateFile.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/checkTerraformStateFile.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/checkTerraformStateFile.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/checkTerraformStateFile.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/colorCodes.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/colorCodes.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/colorCodes.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/colorCodes.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/generateEnvPrompt.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/generateEnvPrompt.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/generateEnvPrompt.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/generateEnvPrompt.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/projectIdPrompt.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/projectIdPrompt.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/projectIdPrompt.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/projectIdPrompt.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/splashScreen.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/splashScreen.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/splashScreen.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/splashScreen.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/taskPrompt.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/taskPrompt.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/taskPrompt.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/taskPrompt.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/terraformApplyPrompt.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/terraformApplyPrompt.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/terraformApplyPrompt.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/terraformApplyPrompt.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/components/tfSuccessScreen.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/components/tfSuccessScreen.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/components/tfSuccessScreen.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/components/tfSuccessScreen.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/tasks/generateEnv.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/tasks/generateEnv.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/tasks/generateEnv.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/tasks/generateEnv.mtsdiff --git a/packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mts b/packages/cloudrun/src/gcpInstaller/installerScripts/tasks/setupGcpProject.mtssimilarity index 100%rename from packages/cloudrun/gcpInstaller/installerScripts/tasks/setupGcpProject.mtsrename to packages/cloudrun/src/gcpInstaller/installerScripts/tasks/setupGcpProject.mtsdiff --git a/packages/cloudrun/gcpInstaller/main.tf b/packages/cloudrun/src/gcpInstaller/main.tfsimilarity index 100%rename from packages/cloudrun/gcpInstaller/main.tfrename to packages/cloudrun/src/gcpInstaller/main.tfdiff --git a/packages/cloudrun/tsconfig.json b/packages/cloudrun/tsconfig.jsonindex 199e5e4c21..846d07dc95 100644--- a/packages/cloudrun/tsconfig.json+++ b/packages/cloudrun/tsconfig.json@@ -5,8 +5,10 @@"esModuleInterop": true,"strict": true,"outDir": "dist",- "resolveJsonModule": true+ "resolveJsonModule": true,+ "composite": true,+ "rootDir": "src"},- "include": ["src/**/*", "gcpInstaller/**/*", "gcpInstaller/*"],+ "include": ["src"],"exclude": ["node_modules"]}diff --git a/packages/docs/docs/cloudrun/generate-env.md b/packages/docs/docs/cloudrun/generate-env.mdindex 691b69d1c8..dacf173e4d 100644--- a/packages/docs/docs/cloudrun/generate-env.md+++ b/packages/docs/docs/cloudrun/generate-env.md@@ -20,7 +20,7 @@ GCP allows a maximum of 10 keys per service account. If you have already created3. Within the Cloud Shell, type the following command and follow the prompts.```bash- curl -L https://github.com/UmungoBungo/remotion/raw/gcp-lambda-alternative/packages/cloudrun/gcpInstaller/gcpInstaller.tar | tar -x -C . && node install.mjs+ curl -L https://github.com/UmungoBungo/remotion/raw/gcp-lambda-alternative/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar | tar -x -C . && node install.mjs```_The first command downloads a tar file from the Remotion repo, and extracts it to the current directory. The second command runs the installer script._diff --git a/packages/docs/docs/cloudrun/setup.md b/packages/docs/docs/cloudrun/setup.mdindex a82786bfcf..de5bb70078 100644--- a/packages/docs/docs/cloudrun/setup.md+++ b/packages/docs/docs/cloudrun/setup.md@@ -90,7 +90,7 @@ This means that you can pull in a script that runs a couple of gcloud and Terraf// TODO: Switch to remotion-dev repo```bash- curl -L https://github.com/UmungoBungo/remotion/raw/gcp-lambda-alternative/packages/cloudrun/gcpInstaller/gcpInstaller.tar | tar -x -C . && node install.mjs+ curl -L https://github.com/UmungoBungo/remotion/raw/gcp-lambda-alternative/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar | tar -x -C . && node install.mjs```- Select <Step>1</Step> if you are using Remotion Cloud Run for the first time in this GCP project or want to upgrade.