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: Add new containerProbe type exec for command execution #114

Merged

Conversation

astromechza
Copy link
Member

@astromechza astromechza commented Nov 29, 2024

This fixes #113 to add the exec type container probe option. This is equivalent to:

Most other container runtimes (fly.io, gcp cloud run, ECS app, azure container app) all use http/grpc/tcp health probes instead, presumably because these are cheaper for the dataplane to execute reliably. However since the reference implementations of Score support exec probes, we can add this as an option.

I think it's important we allow both types to be specified for a probe so that the runtime can pick the one it supports and still get the right final behavior.

Examples:

score-compose can convert:

readinessProbe:
  exec:
    - /bin/bash
    - -c
    - "true"

to

healthcheck: ["CMD", "/bin/bash", "-c", "true"]

score-k8s can convert:

readinessProbe:
  httpGet:
    port: 8080
    path: /
  exec:
    command: ["/bin/curl", "-f", "http://localhost:8080"]

into:

readinessProbe:
  httpGet:
    port: 8080
    path: /

Since the http variant of the probe is supported and cheaper to run.

@astromechza astromechza linked an issue Nov 29, 2024 that may be closed by this pull request
@astromechza astromechza force-pushed the 113-feature-add-support-for-exec-health-and-readiness-checks branch from 9f70208 to 14d4942 Compare November 29, 2024 11:22
@astromechza astromechza changed the title chore: ensure schema testing runs on push feat: Add new containerProbe type exec for command execution Nov 29, 2024
@astromechza astromechza added the new feature/idea New feature or request label Nov 29, 2024
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
@astromechza astromechza force-pushed the 113-feature-add-support-for-exec-health-and-readiness-checks branch from fab392a to 935b9e4 Compare November 29, 2024 11:57
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
@astromechza astromechza marked this pull request as ready for review November 29, 2024 11:58
Copy link

@chrishumanitec chrishumanitec left a comment

Choose a reason for hiding this comment

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

One open question: is choice of which probe to use if both supported implementation specific?

score-v1b1.json Outdated
"required": [
"httpGet"
],
"description": "The probe may be defined as either http, command execution, or both when the deployment runtime supports one and not the other.",

Choose a reason for hiding this comment

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

Should the spec define which one takes precedence if both are supported - or should that be implementation specific?

Copy link
Member Author

Choose a reason for hiding this comment

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

@chrishumanitec I think perhaps if both are supported we should use the command execution, as this likely has deeper or more specific functionality than the simple http one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the description.

@astromechza astromechza force-pushed the 113-feature-add-support-for-exec-health-and-readiness-checks branch from 8d05858 to caec65a Compare January 6, 2025 08:58
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
@astromechza astromechza force-pushed the 113-feature-add-support-for-exec-health-and-readiness-checks branch from caec65a to 8695704 Compare January 6, 2025 10:27
Copy link
Contributor

@mathieu-benoit mathieu-benoit left a comment

Choose a reason for hiding this comment

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

LGTM

@astromechza astromechza merged commit ef1ed10 into main Jan 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature/idea New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for exec health and readiness checks
3 participants