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

Remove SNS #68

Merged
merged 7 commits into from
Mar 25, 2024
Merged

Remove SNS #68

merged 7 commits into from
Mar 25, 2024

Conversation

philmcmahon
Copy link
Contributor

@philmcmahon philmcmahon commented Mar 15, 2024

What does this change?

Initially when we started this project we had an idea to have the worker instances post to a single SNS topic which then feeds into multiple sqs topics for different services (giant, composer etc). Later, we decided that we didn't want to mix up output destined for giant with output for the transcription-service-output-handler - we shouldn't share data with services that aren't supposed to be consuming it,

Having SNS provided some benefit of easy email notifications when a worker had finished a transcription, though again for privacy/spam reasons we've switched this off #65

However, when trying to integrate the transcription service with giant I found that using SNS added some complexity:

  • having to create a giant output topic
  • having to add the SNS sdk to giant

So, given that we're not getting much benefit out of SNS, this PR removes it from the transcription service

How to test

I've tested this on CODE and verified that transcription still works

@philmcmahon philmcmahon requested a review from a team March 15, 2024 10:20
Copy link
Contributor

@zekehuntergreen zekehuntergreen left a comment

Choose a reason for hiding this comment

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

This looks good!
It would be great to update the architecture diagram with these changes when they're merged

clean_up

@@ -28,7 +28,6 @@ export const getParameters = async (
} while (nextToken);

if (parameters) {
logger.info('Fetched parameters from Parameter Store');
Copy link
Contributor

Choose a reason for hiding this comment

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

🙏

publishTranscriptionOutputFailure(
snsClient,
config.app.destinationTopicArns.transcriptionService,
await publishTranscriptionOutputFailure(
Copy link
Contributor

Choose a reason for hiding this comment

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

good call - it's probably important to await the result of this before updating scale in protection

@@ -79,7 +79,7 @@ export const getConfig = async (): Promise<TranscriptionConfig> => {
const destinationTopic = findParameter(
Copy link
Contributor

Choose a reason for hiding this comment

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

destinationQueueUrls ?

Comment on lines +6 to +7
messageId: z.string(),
body: stringToJSONSchema.pipe(TranscriptionOutput),
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: I'm not sure I understand these changes. output-handler is still reading off of the same sqs queue, right? Why has the shape of the message changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was unexpected for me as well - I had to work out the structure of the new message by printing it out but I think think previously you'd have an sqs message wrapped around an sns notification, whereas now you've got an sqs message wrapped around the message itself.

@marjisound marjisound merged commit c29ba23 into main Mar 25, 2024
1 check passed
@marjisound marjisound deleted the pm-remove-sns branch March 25, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants