Create SolidQueue healthcheck process#1378
Conversation
lfdebrux
left a comment
There was a problem hiding this comment.
Looks good to me! I just have a few style comments 😁
bcd4ec4 to
42b5db4
Compare
* 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
683ccb5 to
d97ff39
Compare
|
|
🎉 A review copy of this PR has been deployed! It is made of up two components Important Not all of the functionality of forms-runner is present in 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 For the sign in details and more information, see the review apps wiki page. |



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
healthcheckfile 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 aHealthy"Health status".