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

Readiness health checks #3351

Merged
merged 21 commits into from
Aug 17, 2023
Merged

Readiness health checks #3351

merged 21 commits into from
Aug 17, 2023

Conversation

ameowlia
Copy link
Member

@ameowlia ameowlia commented Jul 19, 2023

Context

This PR is part of the effort to add readiness health checks to Cloud Foundry. Deeper discussion of why can be read here in this CFF RFC.

Design

Users can set these 3 new properties on the app manifest. Error cases for invalid values etc are handled the same way as the other aready existing health-check properties.

applications:
- name: test-app
  processes:
  - type: web
    health-check-http-endpoint: /health
    health-check-invocation-timeout: 2
    health-check-type: http
    timeout: 80
    readiness-health-check-http-endpoint: /ready       # 👈 new property
    readiness-health-check-invocation-timeout: 2       # 👈 new property
    readiness-health-check-type: http                  # 👈 new property

Acceptance

As an App Dev
When I set the readiness health check properties in my app manifest
Then I see those properties set on my app process
And then those properties are sent to bbs on the LRP

This change includes

  • Values can be set on the app manifest
  • Values set on app manifest are validated
  • These properties are stored in the DB
  • /v3/apps/:guid/manifest returns these properties
  • Docs for the /v3/apps/:guid/manifest are updated
  • /v3/processes returns these properties on the process
  • Docs for the /v3/processes are updated
  • These processes are passed to the LRP
  • When these changes are run with a new diego-release then everything works.

Contribution Steps

  • I have reviewed the contributing guide
  • I have viewed, signed, and submitted the Contributor License Agreement
  • I have made this pull request to the main branch
  • I have run all the unit tests using bundle exec rake
  • I have run CF Acceptance Tests
  • Remove all TODOs from code

Related PRs

@ameowlia ameowlia closed this Jul 21, 2023
@ameowlia ameowlia force-pushed the readiness-health-checks branch from 5b196ca to 1e3aa63 Compare July 21, 2023 14:29
@ameowlia ameowlia changed the title Readiness health checks via app manifest Readiness health checks Jul 21, 2023
@ameowlia ameowlia reopened this Jul 21, 2023
ameowlia and others added 10 commits July 31, 2023 16:02
Only adds it to manifest and validates the values. Does not do anything
with these values yet.

Signed-off-by: Marc Paquette <[email protected]>
Signed-off-by: Amelia Downs <[email protected]>
Now when a user supplies the readiness health check properties via the
app manifest, the values are stored on the process, and saved in the
database.

Signed-off-by: Renee Chu <[email protected]>
was added by mistake.

Signed-off-by: Maria Shaldybin <[email protected]>
split out readiness health check types into its own method
now with more ruby style!
@sethboyles sethboyles force-pushed the readiness-health-checks branch from b88514b to 01145c4 Compare July 31, 2023 23:02
…-manifest

Readiness health checks story 4 manifest endpoints
* Add readiness health check properties to process endpoints

GET /v3/processes
GET /v3/processes/:guid
PATCH /v3/processes/:guid
GET /v3/apps/:guid/processes
GET /v3/apps/:guid/processes/:type
PATCH /v3/apps/:guid/processes/:type
POST /v3/apps/:guid/processes/:type/actions/scale

* Add readiness health check examples to API docs
ActualLRP has routable set to true once readiness health check succeeds.
In case if routable is not provided instance reporter sets it to true
for backwards compatibility.

Signed-off-by: Josh Russett <[email protected]>
* Validate health_check_interval/readiness_health_check_interval in the manifest
* Save health_check_interval/readiness_health_check_interval in database
* Regenerate bbs protobuf models
* Pass health_check_interval/readiness_health_check_interval in LRP
* Display health_check_interval/readiness_health_check_interval in manifest
* Add health-check-interval/readiness-health-check-interval to manifest diff
* Add health-check-interval/readiness-health-check-interval to manifest docs
* Add health_check_interval/readiness_health_check_interval to /v3/processes
* Add health_check_interval/readiness_health_check_interval to API docs
* Copy health_check_interval/readiness_health_check_interval during rolling deploy

Signed-off-by: Maria Shaldybin <[email protected]>
Signed-off-by: Josh Russett <[email protected]>
@moleske
Copy link
Member

moleske commented Aug 16, 2023

I clicked rerun on the mysql 5.7 unit test as that had one failed test that is a known thing (it is checking number of seconds that happened and it was off by one 🙄)

The docs check is some links are missing, so those need double checked. Not sure what the complexity rubocop is picking up, I didn't follow up on that

ameowlia and others added 4 commits August 17, 2023 17:32
Signed-off-by: Amelia Downs <[email protected]>
- these functions are idomatic ruby with no nested if statements
- rubocop is just counting if statements so no current concerns
- please review if this changes
@moleske moleske marked this pull request as ready for review August 17, 2023 19:40
Copy link
Member

@moleske moleske left a comment

Choose a reason for hiding this comment

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

approving as individual small commits were pr-ed to this branch and each of them were approved. and of course all unit tests are passing

@moleske moleske merged commit 89eb910 into main Aug 17, 2023
@moleske moleske deleted the readiness-health-checks branch August 17, 2023 20:59
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.

5 participants