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: support mysql backend as keda trigger #36167

Conversation

claneys
Copy link
Contributor

@claneys claneys commented Dec 11, 2023

Closes: #36166

Airflow currently support two SQL database backend with postgresql and mysql. PostgreSQL being the default one it's also the trigger used by default by the Keda ScaledObject created when enabling autoscaling. Which do not work if using a mysql database. Query has to be changed a bit and mysql trigger parameters aren't the same (pretty sneaky little changes within key names) and most of all the connection string used isn't the correct one when addressing to mysql.

Copy link

boring-cyborg bot commented Dec 11, 2023

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 (ruff, 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.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch 2 times, most recently from b71e8af to b51251a Compare December 15, 2023 16:37
Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

Could you add tests for mounted secret, kedaConnection value, and KEDA scaler when the protocol is MySQL?

chart/templates/_helpers.yaml Outdated Show resolved Hide resolved
@claneys
Copy link
Contributor Author

claneys commented Dec 18, 2023

Could you add tests for mounted secret, kedaConnection value, and KEDA scaler when the protocol is MySQL?

Yes, Sure :)

@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch 3 times, most recently from 622e73e to 19d8afd Compare December 20, 2023 08:12
@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch 3 times, most recently from 419e76c to d6ecfca Compare January 3, 2024 09:57
@claneys
Copy link
Contributor Author

claneys commented Jan 3, 2024

Hi @hussein-awala,

Happy new year :) Is the changes fine to you ? Thanks

@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch 4 times, most recently from cf2c722 to a66df59 Compare January 15, 2024 09:25
@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch 4 times, most recently from 5dd4094 to 2c0cce9 Compare January 19, 2024 15:26
@eladkal eladkal added this to the Airflow Helm Chart 1.12.0 milestone Jan 19, 2024
@eladkal
Copy link
Contributor

eladkal commented Jan 19, 2024

static checks are failing
@claneys can you fix it?

@eladkal eladkal removed this from the Airflow Helm Chart 1.12.0 milestone Jan 19, 2024
Thanks @hussein-awala for review

Signed-off-by: Romain Forlot <[email protected]>
Testing that required key are present for the trigger definition and at the right value

Signed-off-by: Romain Forlot <[email protected]>
@claneys claneys force-pushed the feat/support-mysql-keda-trigger-provisionned-by-helm branch from 2c0cce9 to 53f84fa Compare January 20, 2024 13:37
@claneys
Copy link
Contributor Author

claneys commented Jan 20, 2024

@eladkal Sure, I update the PR to make it pass.

@eladkal
Copy link
Contributor

eladkal commented Jan 20, 2024

@claneys static tests are failing

Signed-off-by: Romain Forlot <[email protected]>
@potiuk potiuk merged commit f3cc5f5 into apache:main Jan 20, 2024
62 checks passed
Copy link

boring-cyborg bot commented Jan 20, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 19, 2024
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 changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Also support mysql Keda trigger in scaledObject
5 participants