Skip to content

🎥 Make videos programmatically with React

remove some unused

Jonny Burger5e79af200a3d
diff --git a/packages/lambda/src/benchmark.ts b/packages/lambda/src/benchmark.ts
deleted file mode 100644
index f4561f652e..0000000000
--- a/packages/lambda/src/benchmark.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import {InvokeCommand} from '@aws-sdk/client-lambda';
-import {CliInternals} from '@remotion/cli';
-import {getLambdaClient} from './shared/aws-clients';
-
-const toTest = [12, 15, 20, 100];
-const runs = [1, 2, 3, 4, 5];
-
-export const benchmark = CliInternals.xns(async () => {
- for (const chunkSize of toTest) {
- for (const run of runs) {
- const id = `invoking with ${chunkSize},run ${run}/${runs.length}`;
- console.time(id);
- const res = await getLambdaClient('eu-central-1').send(
- new InvokeCommand({
- FunctionName: 'remotion-render-test-5455111895707452',
- // @ts-expect-error
- Payload: JSON.stringify({
- serveUrl:
- 'http://remotion-bucket-0.0469902062423555.s3.eu-central-1.amazonaws.com',
- type: 'launch',
- composition: 'my-video',
- chunkSize,
- }),
- })
- );
- console.timeEnd(id);
- const string = Buffer.from(res.Payload as Uint8Array).toString();
- console.log(string);
- }
- }
-});
diff --git a/packages/lambda/src/functions/chunk-optimization/write-profile.ts b/packages/lambda/src/functions/chunk-optimization/write-profile.ts
deleted file mode 100644
index 72f67be7e1..0000000000
--- a/packages/lambda/src/functions/chunk-optimization/write-profile.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import {timingProfileName} from '../../shared/constants';
-import {getCurrentRegion} from '../helpers/get-current-region';
-import {lambdaWriteFile} from '../helpers/io';
-import {TimingProfile} from './types';
-
-export const writeTimingProfile = async ({
- data,
- bucketName,
- renderId,
- expectedBucketOwner,
-}: {
- data: TimingProfile;
- bucketName: string;
- renderId: string;
- expectedBucketOwner: string;
-}) => {
- await lambdaWriteFile({
- bucketName,
- body: JSON.stringify(data),
- key: timingProfileName(renderId),
- region: getCurrentRegion(),
- acl: 'private',
- expectedBucketOwner,
- });
-};
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 5426ccb2ba..f2065174cd 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -24,7 +24,6 @@ import {
getOptimization,
writeOptimization,
} from './chunk-optimization/s3-optimization-file';
-import {writeTimingProfile} from './chunk-optimization/write-profile';
import {deleteTmpDir} from './helpers/clean-tmpdir';
import {concatVideosS3} from './helpers/concat-videos';
import {deleteChunks} from './helpers/delete-chunks';
@@ -42,6 +41,7 @@ import {
getTmpDirStateIfENoSp,
writeLambdaError,
} from './helpers/write-lambda-error';
+('./chunk-optimization/write-profile');
type Options = {
expectedBucketOwner: string;
@@ -250,12 +250,6 @@ const innerLaunchHandler = async (params: LambdaPayload, options: Options) => {
region: getCurrentRegion(),
expectedBucketOwner: options.expectedBucketOwner,
});
- await writeTimingProfile({
- data: chunkData,
- bucketName: params.bucketName,
- renderId: params.renderId,
- expectedBucketOwner: options.expectedBucketOwner,
- });
const optimizedProfile = optimizeInvocationOrder(
optimizeProfileRecursively(chunkData, 400)
);
diff --git a/packages/lambda/src/run.ts b/packages/lambda/src/run.ts
index 1ac941bb6d..7a4c9fc266 100644
--- a/packages/lambda/src/run.ts
+++ b/packages/lambda/src/run.ts
@@ -1,5 +1,4 @@
import {CliInternals} from '@remotion/cli';
-import {writeFileSync} from 'fs';
import path from 'path';
import {deployFunction} from './api/deploy-function';
import {deployProject} from './api/deploy-project';
@@ -10,7 +9,7 @@ import {getRenderProgress} from './api/get-render-progress';
import {cleanupLambdas, getRemotionLambdas} from './cleanup/cleanup-lambdas';
import {getAwsRegion} from './cli/get-aws-region';
import {Log} from './cli/log';
-import {lambdaLs, lambdaReadFile} from './functions/helpers/io';
+import {lambdaLs} from './functions/helpers/io';
import {AwsRegion} from './pricing/aws-regions';
import {getLambdaClient} from './shared/aws-clients';
import {callLambda} from './shared/call-lambda';
@@ -18,11 +17,9 @@ import {
getSitesKey,
LambdaRoutines,
REMOTION_BUCKET_PREFIX,
- timingProfileName,
} from './shared/constants';
import {makeS3Url} from './shared/make-s3-url';
import {sleep} from './shared/sleep';
-import {streamToString} from './shared/stream-to-string';
const DEPLOY = false;
@@ -117,20 +114,4 @@ CliInternals.xns(async () => {
break;
}
}
-
- const logs = await lambdaLs({
- bucketName: res.bucketName,
- prefix: timingProfileName(res.renderId),
- region: getAwsRegion(),
- expectedBucketOwner: null,
- });
-
- for (const log of logs) {
- const content = await lambdaReadFile({
- bucketName: res.bucketName,
- key: log.Key as string,
- region: getAwsRegion(),
- });
- writeFileSync(log.Key as string, await streamToString(content));
- }
});
diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.ts
index 80fc3adea2..c356ed6c59 100644
--- a/packages/lambda/src/shared/constants.ts
+++ b/packages/lambda/src/shared/constants.ts
@@ -62,8 +62,6 @@ export const chunkKeyForIndex = ({
renderId: string;
index: number;
}) => `${chunkKey(renderId)}${String(index).padStart(8, '0')}`;
-export const timingProfileName = (renderId: string) =>
- `${rendersPrefix(renderId)}/timing-profile.json`;
export const getErrorKeyPrefix = (renderId: string) =>
`${rendersPrefix(renderId)}/errors/`;
export const optimizationProfile = (siteId: string, compositionId: string) =>