Skip to content

VED-1103: Refactor Batch Processor (recordprocessor) deployment to a dedicated pipeline stage#1279

Open
Thomas-Boyle wants to merge 62 commits intomasterfrom
1103-batch-record-refactor
Open

VED-1103: Refactor Batch Processor (recordprocessor) deployment to a dedicated pipeline stage#1279
Thomas-Boyle wants to merge 62 commits intomasterfrom
1103-batch-record-refactor

Conversation

@Thomas-Boyle
Copy link
Contributor

  • Added a new GitHub Actions workflow for deploying the Recordprocessor batch processor.
  • Updated the continuous deployment workflow to include a dependency on the new Recordprocessor deployment.
  • Introduced a new variable for the Recordprocessor image tag in Terraform configuration.
  • Refactored ECS task definition to use the new image tag variable for the Recordprocessor container.

…deployment dependencies

- Added a new GitHub Actions workflow for deploying the Recordprocessor batch processor.
- Updated the continuous deployment workflow to include a dependency on the new Recordprocessor deployment.
- Introduced a new variable for the Recordprocessor image tag in Terraform configuration.
- Refactored ECS task definition to use the new image tag variable for the Recordprocessor container.
- Explicitly set the AWS_INFRA_ROLE_ARN secret in the continuous deployment workflow.
- Upgrade aws-actions/configure-aws-credentials and aws-actions/amazon-ecr-login to specific versions for improved stability.
- Removed the separate Recordprocessor deployment workflow and integrated its functionality into the backend deployment workflow.
- Added a new input parameter `enable_recordprocessor` to conditionally build and push the Recordprocessor Docker image.
- Updated dependencies in the backend deployment to ensure proper execution order and image tagging for the Recordprocessor.
- Enhanced the continuous deployment workflow by simplifying dependencies and improving clarity.
Copy link
Contributor

@edhall-nhs edhall-nhs left a comment

Choose a reason for hiding this comment

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

Discussed on a call but to summarise:

  • Integrate in deploy-backend workflow, not separate
  • Add manual check that ECR repo exists first
  • Pass through new image tag

… repository

- Changed the behavior of the ECR repository check to fail the build-and-push-recordprocessor job if the repository does not exist, instead of skipping the image build and push. This ensures that the deployment process is more robust and provides clearer feedback on repository availability.
- Modified the backend deployment workflow to include a new step for resolving the image tag based on the `enable_recordprocessor` input. This change ensures that the image tag is set to the output of the build-and-push step if the Recordprocessor is enabled, otherwise defaults to "latest". This enhances the clarity and reliability of the image tagging process during deployment.
- Renamed the ECR repository from `processing_repository` to `recordprocessor_repository` for clarity.
- Added a lifecycle policy to manage images, retaining the last 10 images to optimize storage and maintain relevant versions.
@edhall-nhs
Copy link
Contributor

TODO: manually push account level changes to add lifecycle policy and update terraform name of ECR repository

Warning ⚠️ Because the terraform name has changed, the repo will be deleted and recreated. This should be fine however since it currently only contains images for this PR. We'll need to add a meaningless change to the recordprocessor to trigger the build and push job after applying the account level changes.

Thomas-Boyle and others added 7 commits March 15, 2026 13:14
* Add cleanup step for recordprocessor ECR images in PR teardown workflow

* Refactor PR teardown workflow to queue image deletions for recordprocessor ECR
… manual runs (#1301)

* Enhance deploy-backend workflow to allow optional recordprocessor image tag input. Update logic to handle provided image tag during deployment, ensuring proper validation when building the image is disabled.

* Clarify description for recordprocessor image tag in deploy-backend workflow, specifying its requirement when image building is disabled.

* Remove conditional check for workflow dispatch in AWS connection step of deploy-backend workflow.
Copy link
Contributor

@edhall-nhs edhall-nhs left a comment

Choose a reason for hiding this comment

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

All looks good to me. I think we should hold off merging until there have been a few more reviews and we've done the team demo / workshop as it's a fundamental change

"rules": [
{
"rulePriority": 1,
"description": "Keep last 10 images",
Copy link
Contributor

Choose a reason for hiding this comment

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

We can discuss this policy in the demo to see what the team thinks. Might be that we can get rid of it tbh since we've updated the PR teardown now.

@sonarqubecloud
Copy link

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.

2 participants