Skip to content

Commit

Permalink
Use media-download as volume for storing files
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Jan 6, 2025
1 parent 8a72f04 commit e8a1d03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cdk/lib/transcription-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ export class TranscriptionService extends GuStack {
mediaDownloadTask.taskDefinition.addVolume(volume);
mediaDownloadTask.containerDefinition.addMountPoints({
sourceVolume: volume.name,
containerPath: '/opt', // needs to match WORKDIR in media-download Dockerfile
containerPath: '/media-download', // needs to match DOWNLOAD_DIRECTORY in media-download index.ts
readOnly: false,
});

Expand Down
9 changes: 8 additions & 1 deletion packages/media-download/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
MediaDownloadJob,
} from '@guardian/transcription-service-common';

const DOWNLOAD_DIRECTORY = '/media-download';

const uploadToS3 = async (
s3Client: S3Client,
metadata: MediaMetadata,
Expand Down Expand Up @@ -139,7 +141,12 @@ const main = async () => {
)
: undefined;

const metadata = await downloadMedia(job.url, '/tmp', job.id, proxyUrl);
const metadata = await downloadMedia(
job.url,
DOWNLOAD_DIRECTORY,
job.id,
proxyUrl,
);
if (!metadata) {
await reportDownloadFailure(config, sqsClient, job);
} else {
Expand Down

0 comments on commit e8a1d03

Please sign in to comment.