Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch existing task processor health checks to new liveness probe #5161

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Feb 25, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This accommodates for changes introduced in Flagsmith/flagsmith-task-processor#25 by intercepting python manage.py checktaskprocessorthreadhealth command and redirecting it to new liveness probe introduced in #5151.

How did you test this code?

Ran python manage.py checktaskprocessorthreadhealth and made sure the correct HTTP call is made.

@khvn26 khvn26 requested a review from a team as a code owner February 25, 2025 12:53
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team February 25, 2025 12:53
Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:49pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 7:49pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 7:49pm

@github-actions github-actions bot added the api Issue related to the REST API label Feb 25, 2025
@khvn26 khvn26 requested a review from rolodato February 25, 2025 12:53
@github-actions github-actions bot added the feature New feature or request label Feb 25, 2025
Copy link
Contributor

github-actions bot commented Feb 25, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5161 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5161 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5161 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5161 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Uffizzi Ephemeral Environment deployment-61312

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5161

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.49%. Comparing base (9a58249) to head (ce4c15c).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5161      +/-   ##
==========================================
+ Coverage   97.47%   97.49%   +0.02%     
==========================================
  Files        1224     1223       -1     
  Lines       42590    42581       -9     
==========================================
+ Hits        41515    41516       +1     
+ Misses       1075     1065      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


sys.exit(0 if 200 >= status < 300 else 1)
def main() -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a deprecation warning when this is being used? In case we need to troubleshoot other customer deployments that have similar issues, this could tell us immediately if they are using the old style healthchecks or not.

I understand this code is only ever called by Docker Compose healthchecks, which should be removed.

Otherwise LGTM 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@khvn26 khvn26 requested a review from rolodato February 25, 2025 15:54
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 25, 2025
@rolodato
Copy link
Member

@khvn26 Added 236df86 to remove healthchecks from Docker Compose, and bake them directly into the Dockerfile. I understand this should only be used automatically by Compose, and not ECS, Kubernetes or other orchestrators.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 25, 2025
@khvn26 khvn26 requested a review from a team as a code owner February 26, 2025 21:19
@khvn26 khvn26 requested review from kyle-ssg and removed request for a team February 26, 2025 21:19
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard feature New feature or request and removed feature New feature or request labels Feb 26, 2025
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 26, 2025
@khvn26
Copy link
Member Author

khvn26 commented Feb 27, 2025

In 121128e, I added support for the new Task processor endpoint that now accepts command line arguments for Gunicorn as well. This enables HTTP healthchecks directly on Task processor containers.

We'll need to merge Flagsmith/flagsmith-task-processor#25 and change the dependency reference before we merge this.

I also refreshed documentation related to Task processor operation.

@khvn26 khvn26 force-pushed the feat/adapt-removed-task-processor-health-cmd branch from e9ae682 to 8be11b8 Compare February 27, 2025 13:02
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Feb 27, 2025
@khvn26 khvn26 requested a review from a team as a code owner February 27, 2025 19:48
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants