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

Fix/21994 liveness probe #22041

Merged
merged 9 commits into from
Mar 8, 2022
Merged

Conversation

Wilderone
Copy link
Contributor

This MR resolve two problems:

  1. Remove "exec" argument for sh in livenessProbe, because of this leads to false-success of probe check
  2. Move livenessProbe's code to values, so client can redefine it.

Related issue #21994

I am not sure about version of this change, so just upgrade patch version.

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Mar 7, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 7, 2022

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

chart/Chart.yaml Outdated
@@ -19,7 +19,7 @@
---
apiVersion: v2
name: airflow
version: 1.5.0-dev
version: 1.5.1-dev
Copy link
Member

Choose a reason for hiding this comment

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

I tihnk this should not be changed. We are voting on 1.5.0 and my bet is that we will issue and rc2

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we don't need to touch this here.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

I like this but I need @ephraimbuddy @jedcunningham @kaxil chiming in :)

@potiuk potiuk added this to the Airflow Helm Chart 1.5.0 milestone Mar 7, 2022
@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Mar 7, 2022
@github-actions
Copy link

github-actions bot commented Mar 7, 2022

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

Copy link
Contributor

@ephraimbuddy ephraimbuddy left a comment

Choose a reason for hiding this comment

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

LGTM.

@potiuk
Copy link
Member

potiuk commented Mar 7, 2022

The mypy static checks are unrelated (and already fixed in main - can you please rebase and fix the other static check (which is related :)). Pre-commit might help you with automatically fixing it

@potiuk
Copy link
Member

potiuk commented Mar 7, 2022

(and removal of the version change too :))

Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

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

Thanks for opening this! Can you also add some tests?

- sh
- -c
- |
CONNECTION_CHECK_MAX_COUNT=0 /entrypoint python -Wignore -c "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
CONNECTION_CHECK_MAX_COUNT=0 /entrypoint python -Wignore -c "
CONNECTION_CHECK_MAX_COUNT=0 exec /entrypoint python -Wignore -c "

This is where the exec should be, and I think we want to keep it so timeoutSeconds can actually function.

Copy link
Member

Choose a reason for hiding this comment

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

Yep.

@@ -1504,6 +1504,20 @@
"description": "How often (in seconds) to perform the probe. Minimum value is 1.",
"type": "integer",
"default": 60
},
"exec": {
"description": "Custom exec command for livenessProbe",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"description": "Custom exec command for livenessProbe",
"description": "Command for livenessProbe",

I'm also not sure we need to maintain the nesting of exec.command. I'd rather we flatten it and just have livenessProbe.command. My 2c, thoughts?

chart/Chart.yaml Outdated
@@ -19,7 +19,7 @@
---
apiVersion: v2
name: airflow
version: 1.5.0-dev
version: 1.5.1-dev
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we don't need to touch this here.

@@ -235,6 +236,9 @@ def test_livenessprobe_values_are_configurable(self):
"spec.template.spec.containers[0].livenessProbe.failureThreshold", docs[0]
)
assert 444 == jmespath.search("spec.template.spec.containers[0].livenessProbe.periodSeconds", docs[0])
assert ["sh", "-c", "echo", "wow such test"] == jmespath.search(
Copy link
Member

Choose a reason for hiding this comment

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

😄

@potiuk potiuk merged commit 99cf75d into apache:main Mar 8, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 8, 2022

Awesome work, congrats on your first merged pull request!

@jedcunningham
Copy link
Member

Thanks @Wilderone! Congrats on your first commit 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants