Skip to content

Commit

Permalink
change to sourceBucket
Browse files Browse the repository at this point in the history
  • Loading branch information
mythilytm committed Dec 30, 2024
1 parent bb99194 commit 06d6113
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/generate-ai-training-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
name: Generate AI Training Set Task

on:
push:
branches:
- CHI-3162-link-transcripts-dir
workflow_dispatch:
inputs:
environment:
Expand Down Expand Up @@ -49,14 +52,14 @@ jobs:
- name: Run New ECS task
id: run-task
run: |
CLUSTER="${{ inputs.environment }}-ecs-cluster"
FAMILY="${{ inputs.environment }}-hrm-scheduled-task"
SUBNETS=$(if [ ${{ inputs.environment }} == "development" ]; then echo "subnet-034e5c652dbad09dd"; else echo "subnet-00b4e88c0ea178f3d"; fi)
SECURITY_GROUPS=($(if [ ${{ inputs.environment}} == "development" ]; then echo "sg-09194f9a648baf082 sg-047498d4c7b2cedd8 sg-06d6458accc0ec5ed sg-0ace4338c75e5d3de";
else echo "sg-02fd053fe7b4660ed sg-0e7119c4423f2c7b0 sg-066d0055caa7cbe90 sg-0c7fb74e11cb64ff8"; fi))
COMMAND="npm run start:generate-ai-training-set ${{ inputs.environment }} ${{ inputs.helpline-shortcodes }} tl-aselo-ai-${{ inputs.environment }}-us-east-1"
TASK_ROLE="arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ inputs.environment }}-ecsTaskRole"
EXEC_ROLE="arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ inputs.environment }}-ecsTaskExecutionRole"
CLUSTER="development-ecs-cluster"
FAMILY="development-hrm-scheduled-task"
SUBNETS="subnet-034e5c652dbad09dd"
SECURITY_GROUPS="sg-09194f9a648baf082,sg-047498d4c7b2cedd8,sg-06d6458accc0ec5ed,sg-0ace4338c75e5d3de"
COMMAND="npm run start:generate-ai-training-set development as tl-aselo-ai-development tl-aselo-ai-development"
TASK_ROLE="arn:aws:iam::712893914485:role/development-ecsTaskRole"
EXEC_ROLE="arn:aws:iam::712893914485:role/development-ecsTaskExecutionRole"
aws ecs run-task \
--cluster $CLUSTER \
Expand Down
11 changes: 7 additions & 4 deletions hrm-domain/scheduled-tasks/generate-ai-training-set/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,19 @@ export const generate = async (
sourceBucket,
);
} catch (error) {
console.info(
`No transcript found for contact ${trainingSetContact.contactId} in ${shortCode} bucket. Skipping...`,
);
// console.info(
// `No transcript found for contact ${trainingSetContact.contactId} in ${shortCode} bucket. Skipping...`,
// );
callback();
return;
}
console.log(
`Uploading contact ${trainingSetDoc.contactId} from ${sourceBucket}`,
);
await uploadTrainingSetDocument(
trainingSetDoc.contactId,
JSON.stringify(trainingSetDoc),
targetBucket,
sourceBucket,
shortCode,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const attachTranscript = async (
? `${shortCode.toLowerCase()}/${trainingSetContact.transcriptKey}`
: trainingSetContact.transcriptKey;

console.log(`Reading transcript from ${readBucket}/${readKey}`);

const transcriptDocJson = await getS3Object({
key: readKey,
bucket: readBucket,
Expand Down

0 comments on commit 06d6113

Please sign in to comment.