Skip to content

Create SolidQueue healthcheck process#1378

Merged
sarahseewhy merged 3 commits into
mainfrom
create-solidqueue-healthcheck-process
May 21, 2025
Merged

Create SolidQueue healthcheck process#1378
sarahseewhy merged 3 commits into
mainfrom
create-solidqueue-healthcheck-process

Conversation

@sarahseewhy
Copy link
Copy Markdown
Contributor

@sarahseewhy sarahseewhy commented May 7, 2025

What problem does this pull request solve?

Trello: https://trello.com/c/f7js82Cm/635-run-solid-queue-as-its-own-ecs-task

We want to run the Solid Queue worker as a separate ECS task (see this PR: govuk-forms/forms-deploy#1558). The worker ECS task needs a healthcheck to verify the task is running ok.

This pull requests implements a "lifecycle hook" that creates a healthcheck file when Solid Queue starts and removes the file when the process stops.

According to the Solid Queue README a lifecycle hook is the encouraged approach for this type of scenario (see README).

Thanks to @lfdebrux's research I've implemented something similar to SideKiq's file-based readiness probe (see README).

I've tested this locally and in dev. The file gets created when the process starts and removed when the process stops. When deployed along side the relevant infrastructure changes the ECS tasks start running and achieve a Healthy "Health status".

Comment thread bin/jobs Outdated
lfdebrux
lfdebrux previously approved these changes May 9, 2025
Copy link
Copy Markdown
Contributor

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

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

Looks good to me! I just have a few style comments 😁

Comment thread bin/jobs Outdated
Comment thread bin/jobs Outdated
@sarahseewhy sarahseewhy force-pushed the create-solidqueue-healthcheck-process branch from bcd4ec4 to 42b5db4 Compare May 9, 2025 14:00
* Add a lifecycle hook which creates a file in the /tmp when SolidQueue process starts and removes the file when the SolidQueue process stops
* This file will act as a healthcheck, the ECS task can check for the existence of the file
* Be more succinct in my wording
* Remove redundent `Rails.root.join`
* Make healthcheck file more explicitly connected to SolidQueue
@sarahseewhy sarahseewhy force-pushed the create-solidqueue-healthcheck-process branch from 683ccb5 to d97ff39 Compare May 21, 2025 07:30
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@sarahseewhy sarahseewhy merged commit 2b22e5b into main May 21, 2025
7 checks passed
@sarahseewhy sarahseewhy deleted the create-solidqueue-healthcheck-process branch May 21, 2025 07:39
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