-
Notifications
You must be signed in to change notification settings - Fork 0
REFACTOR transcription microservice into the monollith #25
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
637f80f
ADD transcriptionJob model to prisma schema
SergioNR 56d9658
ADD npm package AWS transcribe
SergioNR 7ec6f1f
RENAME updateAnalysisEntryInDb to markAnalysisEntryAsSubmitted for cl…
SergioNR 6906c00
ADD transcription normalizer util
SergioNR 34a2999
ADD functionality to get S3 objects from AWS S3
SergioNR c9cd86c
ADD cronjob to get completedTranscriptionJobs
SergioNR 8d410ca
UPDATE prisma schema to include language code
SergioNR 48cdbc2
ADD analysisService layer
SergioNR 18e6982
ADD transcriptionModel - WIP
SergioNR c5002b8
ADD AWS Transcribe logic
SergioNR 699cda8
REFACTOR analysisEntry controller to favor internal functions vs queues
SergioNR fc8df48
UPDATE swagger & REMOVE "success" attribute from PATCH analysisEntry
SergioNR a8101ef
ADD logic to update the transcriptJob after successful AWS transcribe…
SergioNR 42c08ad
REMOVE queue-related transcription model functions
SergioNR 6e9b646
REFACTOR transcription model from microservice to monolith
SergioNR 31725c5
ADD no-plusplus rule exception to eslint
SergioNR b618c75
ADD no-await-in-loop rule exception in eslint
SergioNR fb3ce07
REMOVE lavinMQ implementation
SergioNR 6a7666d
ADD error logging to completedTranscriptionJobScheduler CRON job
SergioNR 5bb51e6
FIX typo in transcription job creation function
SergioNR 3d5aa70
REMOVE mediaType attribute & remove requirement for analysisId
SergioNR 610fa72
ADD logging to transcription request job
SergioNR 8b75d68
ADD logic to handle completed transcription jobs
SergioNR 765db4b
ADD no-restricted-syntax rule to eslint exceptions
SergioNR aedb52e
COMPLETE logic for requesting & processing transcription jobs
SergioNR 8bf9d84
UPDATE db to include transcriptionJob table
SergioNR fdd9ef2
FIX typo in Transcribe.js
SergioNR e1030ca
ADD proper error logging to transcription function
SergioNR 0e52887
REFACTOR transcription job retrieval logic for more clarity
SergioNR db31a5c
ADD prisma schema formatting
SergioNR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,5 +23,3 @@ AWS_SECRET_ACCESS_KEY= | |
| AWS_ACCESS_KEY_ID= | ||
| AWS_REGION= | ||
| AWS_BUCKET= | ||
|
|
||
| LAVINMQ_HOST= | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
prisma/migrations/20251222131114_add_transcription_job_table/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| -- CreateEnum | ||
| CREATE TYPE "TranscriptionJobStatus" AS ENUM ('PENDING', 'IN_PROGRESS', 'COMPLETED'); | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE "TranscriptionJob" ( | ||
| "id" SERIAL NOT NULL, | ||
| "analysis_entry_id" TEXT NOT NULL, | ||
| "status" "TranscriptionJobStatus" NOT NULL DEFAULT 'PENDING', | ||
| "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "language_code" TEXT NOT NULL, | ||
|
|
||
| CONSTRAINT "TranscriptionJob_pkey" PRIMARY KEY ("id") | ||
| ); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX "TranscriptionJob_id_key" ON "TranscriptionJob"("id"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX "TranscriptionJob_analysis_entry_id_key" ON "TranscriptionJob"("analysis_entry_id"); | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "TranscriptionJob" ADD CONSTRAINT "TranscriptionJob_analysis_entry_id_fkey" FOREIGN KEY ("analysis_entry_id") REFERENCES "AnalysisEntry"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { CronJob } from 'cron'; | ||
| import { handleCompletedVideoTranscriptionJobs } from '../services/analysisService.js'; | ||
| import { logError, logInfo } from '../config/loggerFunctions.js'; | ||
|
|
||
| export const getCompletedTranscriptionJobsScheduler = new CronJob('15 * * * *', async () => { | ||
| try { | ||
| logInfo('Checking transcription job status'); | ||
| await handleCompletedVideoTranscriptionJobs(); | ||
| } catch (error) { | ||
| logError('Error checking transcription job status', error); | ||
| } | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language code is hardcoded to 'es-ES'. This should be configurable based on the analysis requirements or user preferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - Will only be in es-ES for the time being - its more efficient to hardcore for now