Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /tmp volume to media download task container #129

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,12 @@ service transcription-service-worker start",
{
"ContainerPath": "/media-download",
"ReadOnly": false,
"SourceVolume": "media-download-volume",
"SourceVolume": "media-download-download-volume",
},
{
"ContainerPath": "/tmp",
"ReadOnly": false,
"SourceVolume": "media-download-temp-volume",
},
],
"Name": "media-download-task-TaskContainer",
Expand Down Expand Up @@ -1860,7 +1865,10 @@ service transcription-service-worker start",
},
"Volumes": [
{
"Name": "media-download-volume",
"Name": "media-download-download-volume",
},
{
"Name": "media-download-temp-volume",
},
],
},
Expand Down
17 changes: 13 additions & 4 deletions packages/cdk/lib/transcription-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,24 @@ export class TranscriptionService extends GuStack {
],
});

const volume = {
name: `${mediaDownloadApp}-volume`,
const downloadVolume = {
name: `${mediaDownloadApp}-download-volume`,
};
mediaDownloadTask.taskDefinition.addVolume(volume);
const tempVolume = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth a comment explaining why this is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good shout

name: `${mediaDownloadApp}-temp-volume`,
};
mediaDownloadTask.taskDefinition.addVolume(downloadVolume);
mediaDownloadTask.taskDefinition.addVolume(tempVolume);
mediaDownloadTask.containerDefinition.addMountPoints({
sourceVolume: volume.name,
sourceVolume: downloadVolume.name,
containerPath: '/media-download', // needs to match DOWNLOAD_DIRECTORY in media-download index.ts
readOnly: false,
});
mediaDownloadTask.containerDefinition.addMountPoints({
sourceVolume: tempVolume.name,
containerPath: '/tmp', // needed by yt-dlp
readOnly: false,
});

const pipeRole = new Role(this, 'eventbridge-pipe-role', {
assumedBy: new ServicePrincipal('pipes.amazonaws.com'),
Expand Down
Loading