Skip to content

Conversation

@calebwoofenden
Copy link

@calebwoofenden calebwoofenden commented Oct 28, 2022

Update from version 10.5.3 to version 12.1.2 of the bitnami/postgresql chart. This version changes the name of the username and password variables, so I've changed those here as well. Version 10.5.3 is over a year old and a lot of new features have been added since then.

I also updated the dependency for bitnami/postgresql listed in the Chart.yaml to point at bitnami's chart repo. This means you can just change the version of the chart in Chart.yaml and then run helm dependency update and it will fetch that version for you and place the .tgz file in the charts dir and update the Chart.lock

Closes: #27353

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

boring-cyborg bot commented Oct 28, 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

@potiuk
Copy link
Member

potiuk commented Oct 29, 2022

Oh yeah. Some test failures to fix :). Good that we have them. But they should be clear guidelines on what to fix :)

@potiuk potiuk force-pushed the update-bitnami-postgresql-chart branch from 71e7275 to b81144f Compare October 29, 2022 18:17
@potiuk
Copy link
Member

potiuk commented Oct 29, 2022

I also rebased to latest main - partially to help you to see the errors better and partially to verify two improvements I've done to surface "helm test" errors better and to fix the "noise" generated by static checks (side-effect of another change I implemented recently). I hope it will be clearer now to see the errors that should be fixed @calebwoofenden :)

@calebwoofenden calebwoofenden force-pushed the update-bitnami-postgresql-chart branch from b81144f to c899315 Compare October 31, 2022 13:49
@calebwoofenden
Copy link
Author

calebwoofenden commented Oct 31, 2022

Oh yeah. Some test failures to fix :). Good that we have them. But they should be clear guidelines on what to fix :)

I see one about the newsfragment file which is an easy change. I also see this:

Error:  templates/: values don't meet the specifications of the schema(s) in the following chart(s):
airflow:
- postgresql.auth: Additional property enablePostgresUser is not allowed
- postgresql.auth: Additional property existingSecret is not allowed
- postgresql.auth: Additional property postgresPassword is not allowed
- postgresql.auth: Additional property usePasswordFiles is not allowed
- postgresql.auth: Additional property database is not allowed
- postgresql.auth: Additional property replicationPassword is not allowed
- postgresql.auth: Additional property replicationUsername is not allowed
- postgresql.auth: Additional property secretKeys is not allowed

I guess because I'm including a couple of properties under postgresql.auth it wants me to include all of the properties that are available under that key from the bitnami chart?

@jedcunningham
Copy link
Member

Probably better to just turn additionalProperties on instead.

@calebwoofenden calebwoofenden force-pushed the update-bitnami-postgresql-chart branch from 2b0ffe6 to ebb142c Compare October 31, 2022 18:35
@calebwoofenden
Copy link
Author

Looks like tests are passing now! The new version of the postgres chart changes the "headless" service name suffix from "headless" to "hl" and that was throwing off a bunch of tests. Thanks for the tip about the additionalProperties parameter also.

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.

@calebwoofenden, can we also fail the install via NOTES if folks are using the old user/password config location?

In theory no one is using this for real instances, but I'd rather be defensive here.

(Also, I realize this is a breaking change, but I think it's worthwhile given this should be a dev only scenario)

@jedcunningham
Copy link
Member

I've also verified the tarball is the same as the one from bitnami.

@jedcunningham jedcunningham added this to the Airflow Helm Chart 1.8.0 milestone Nov 2, 2022
@calebwoofenden
Copy link
Author

Not really sure what to make of the test failures now, though I think I saw this failure on a few previous test runs (but not all).

>       assert sorted(list_of_sa_names_in_objects) == sorted(CUSTOM_SERVICE_ACCOUNT_NAMES)
E       AssertionError: assert ['TestCleanup...stRedis', ...] == ['TestCleanup...stRedis', ...]
E         Left contains one more item: 'default'
E         Use -v to get the full diff

It seems like this is saying there is an extra ServiceAccount being created called default?

@potiuk
Copy link
Member

potiuk commented Nov 7, 2022

Not really sure what to make of the test failures now, though I think I saw this failure on a few previous test runs (but not all).

>       assert sorted(list_of_sa_names_in_objects) == sorted(CUSTOM_SERVICE_ACCOUNT_NAMES)
E       AssertionError: assert ['TestCleanup...stRedis', ...] == ['TestCleanup...stRedis', ...]
E         Left contains one more item: 'default'
E         Use -v to get the full diff

It seems like this is saying there is an extra ServiceAccount being created called default?

You can just run the test yourself. It's easy to run the tests and you should be able to debug it with pytest. You can run the pytest tests inside breeze development environment - https://github.com/apache/airflow/blob/main/BREEZE.rst. Should take few minutes to set-up and then once you enter Breeze you shouls be able to run pytest tests/chart/..... and debug and see more details on what is the problem.

Also apparently the K8S tests fail - airflow installation via the Helm Chart fails with timeout. You can a https://github.com/apache/airflow/blob/main/TESTING.rst#running-tests-with-kubernetes - there you can see even step-by-step instructions how to create cluster, deploy airflow and run tests. Likely you would need to see in the k8s logs why installing airflow via the Helm chart fails (again breeze has full support to make it super- easy including running k9s tool that helps with k8s inspection and debugging).

@calebwoofenden
Copy link
Author

Hm, I merged main again a couple times and now the tests are passing. Could it be flaky tests?

@potiuk
Copy link
Member

potiuk commented Nov 7, 2022

You are a new user and you have not merged any PR to Airlfow yet, so by github limitations we need to approve your workflows after you rebase/merge. I just did, so we will yet see if they fail

@potiuk
Copy link
Member

potiuk commented Nov 7, 2022

But no - I believe they were not flakes

@potiuk
Copy link
Member

potiuk commented Nov 7, 2022

Yep. Sounds like the problem is real.

@calebwoofenden
Copy link
Author

Thanks, I didn't realize that the full tests were not running unless you triggered them. I ran the Breeze setup locally and identified the issue.

The postgres user was being created with a randomly-generated password instead of using the value in auth.password. The parameters of the bitnami/postgresql chart didn't behave exactly how I thought - it turns out that auth.username and auth.password are only for accounts other than the postgres admin user. To set the password for the postgres user you need to set auth.postgresPassword. I added this parameter as well as auth.enablePostgresUser, and added more detail to the NOTES.txt fail message.

@calebwoofenden calebwoofenden changed the title Update bitanmi/postgresql dependency chart to latest version Update bitnami/postgresql dependency chart to latest version Nov 10, 2022
@calebwoofenden
Copy link
Author

Fixed the json schema for the new params to allow null. There's still one test failure, test_rbac.py:test_service_account_custom_names_in_objects. It seems to be failing because the namespace includes a ServiceAccount called default, which it seemingly doesn't expect. As far as I can tell every namespace will contain a default ServiceAccount. I'm kind of at a loss on this one.

@potiuk
Copy link
Member

potiuk commented Nov 14, 2022

Thanks, I didn't realize that the full tests were not running unless you triggered them. I ran the Breeze setup locally and identified the issue.

Only for new contributor who never merged a PR before :) . Once we merge this one, the word (Airlfow's one) is yours :)

@calebwoofenden
Copy link
Author

Yes, it looks like it's the same failure I saw with this test case finding a ServiceAccount called default and not liking that. Every namespace must have a default ServiceAccount though. I don't really know where to start with this one.

@potiuk
Copy link
Member

potiuk commented Nov 18, 2022

I just re-run it let's see. I would have to see the tests to know where it came from.

@potiuk potiuk force-pushed the update-bitnami-postgresql-chart branch from 6c960eb to cb3f764 Compare November 18, 2022 00:21
@potiuk
Copy link
Member

potiuk commented Nov 27, 2022

Needs fixes I am afraid.

@potiuk
Copy link
Member

potiuk commented Dec 4, 2022

I think there is one simple test to fix (and I guess we are close to release a Helm chart shortly (we just released Airflow 2.5.0 and usually Helm Chart follows shortly). Can you please fix the problem @calebwoofenden ?

@dnskr
Copy link
Contributor

dnskr commented Dec 29, 2022

Hi @calebwoofenden!
It would be great to have your PR merged to 1.8.0 chart release. Will you have time to have a look and fix the test? Looks like it should be easy to make the last step after great effort you made.

@potiuk
Copy link
Member

potiuk commented Jan 17, 2023

Hi @calebwoofenden! It would be great to have your PR merged to 1.8.0 chart release. Will you have time to have a look and fix the test? Looks like it should be easy to make the last step after great effort you made.

Yep. Would be great to merge that one in :)

@snjypl
Copy link
Contributor

snjypl commented Jan 20, 2023

@calebwoofenden @potiuk i have opened a PR #29071 with fixes to the failing unittest and also upgraded the chart to lastest version 12.1.9

i dont have permission to update this PR with those changes.

@potiuk potiuk closed this Jan 21, 2023
@potiuk
Copy link
Member

potiuk commented Jan 21, 2023

Closed as #29071 has been merged.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to the latest version of bitnami/postgresql

7 participants