Skip to content

Commit 2e41dfb

Browse files
committed
feat: MAFD-340 Document how transcription container is started
1 parent adbfb91 commit 2e41dfb

1 file changed

Lines changed: 31 additions & 8 deletions

File tree

source/documentation/services/couch25k.html.md.erb

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Couch to 5K is the Better Health running coach app.
1111

1212
The app follows the [standard pattern](documentation/guides/standard-pattern) but also has a BuddyRun feature which runs in a separate ECS container and uses Redis. This uses WebSockets through the ALB instead of HTTP.
1313

14-
---
15-
1614
## Architecture Overview
1715

1816
```mermaid
@@ -34,8 +32,6 @@ graph TD;
3432
BuddyRun --> Redis
3533
```
3634

37-
---
38-
3935
## Components
4036

4137
### Applications
@@ -47,8 +43,6 @@ graph TD;
4743

4844
- **Repo:** [c25k-iac](https://github.com/ukhsa-collaboration/c25k-iac) – Terraform defining the AWS infrastructure.
4945

50-
---
51-
5246
## Environments
5347

5448
| Environment | URL |
@@ -57,8 +51,6 @@ graph TD;
5751
| **Staging** | https://couchto5kstg.phedigital.co.uk |
5852
| **Dev** | https://couchto5kdev.phedigital.co.uk |
5953

60-
---
61-
6254
## DNS Overview
6355

6456
The `phedigital.co.uk` apex lives in the phe-prd account. That zone delegates `couchto5kprod.phedigital.co.uk`, `couchto5kstg.phedigital.co.uk` and `couchto5kdev.phedigital.co.uk` to the respective landing-zone accounts, where Terraform manages the ALB aliases and CDN records. Each environment also hosts a `cdn.phedigital<env>.co.uk` record that aliases the CloudFront distribution in us-east-1.
@@ -119,3 +111,34 @@ graph TD
119111
```
120112

121113
If any hosted zone is recreated, update the corresponding NS records in the phe-prd root so delegation stays valid.
114+
115+
### Enabling Transcriptions
116+
The app uses AWS Transcribe to generate transcripts of the audio content. This is run in the Staging environment and the output is manually copied to the production S3 bucket.
117+
To run the Transcription container in Staging, run the following commands from a terminal with AWS CLI access to the staging account:
118+
119+
120+
```bash
121+
SUBNET=$(aws ec2 describe-subnets \
122+
--filters 'Name=tag:Type,Values=Private' \
123+
--query 'Subnets[0].SubnetId' \
124+
--output text)
125+
126+
SECURITY_GROUP=$(aws ec2 describe-security-groups \
127+
--query "SecurityGroups[?contains(GroupName, 'c25k-transcriber-service')].GroupId | [0]" \
128+
--output text)
129+
130+
TASK_DEFINITION=$(aws ecs list-task-definitions \
131+
--family-prefix aw-c25k-euw2-uat-ecssvc-c25k-transcriber \
132+
--sort DESC \
133+
--query 'taskDefinitionArns[0]' \
134+
--output text)
135+
136+
aws ecs run-task \
137+
--cluster aw-c25k-euw2-uat-ecscluster \
138+
--task-definition "$TASK_DEFINITION" \
139+
--launch-type FARGATE \
140+
--network-configuration \
141+
"awsvpcConfiguration={subnets=[$SUBNET],securityGroups=[$SECURITY_GROUP],assignPublicIp=DISABLED}"
142+
```
143+
144+
Once the container is no longer needed, it should be stopped to avoid unnecessary costs. This can be done through the AWS Console.

0 commit comments

Comments
 (0)