-
Notifications
You must be signed in to change notification settings - Fork 150
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
Modify api-db and keycloak-db to support MySQL8 #3816
base: main
Are you sure you want to change the base?
Conversation
e852bb1
to
413c39b
Compare
0f210e0
to
961286f
Compare
I tweaked this a bit to leave the existing docker-compose.yaml file alone and leverage make targets with a compose override for mysql specific changes to keep the overrides isolated. This lets you now use the defaults Having the ability to do both allows for verifying that not only do the migrations succeed in mysql, that they hopefully also succeed in mariadb. |
The only thing I haven't tried locally is starting on a MariaDB container, then attempting to change to MySQL. I'm going to guess this will be a real pain to script for local development since our compose stack isn't really designed with in place upgrading in mind. #3829 does offer the ability to do stable to unstable chart upgrades that could potentially test the viability of a MariaDB pod to MySQL pod upgrade in a helm pre or post upgrade task somehow. This would be super risky though. We may have to continue to support MariaDB pod only, but ensure any future migrations are valid for MySQL. |
305e944
to
56f170f
Compare
There might be some issues with MySQL strict mode that make this difficult to support alongside MariaDB. Mostly that the Luckily(?) AWS appear to have strict mode disabled by default in RDS MySQL 8. Unsure about other providers. But we could document this as a requirement when we start to think about supporting external DB providers in the charts. |
services/api/database/migrations/20241231000100_mysql8_compatibility.js
Outdated
Show resolved
Hide resolved
services/api/database/migrations/20241231000100_mysql8_compatibility.js
Outdated
Show resolved
Hide resolved
4d447ed
to
31e614d
Compare
One thing to be aware of with keycloak using mysql, is that it also has to connect to the lagoon api db and uses the hardcoded |
I refactored the mysql overrides to make it simpler to switch, and also able to run through the entire test suite with mysql with the use of Edit: Some minor chart changes are required to handle this switch. Just verifying the required changes to be as minimal/backwards compatible |
f928f1b
to
13553f1
Compare
13553f1
to
17c7afc
Compare
Found some things in the upstream images that are a bit annoying and breaks the mysql image from working in tests and charts. I modified the charts with some minimal database vendor changes and added the overrides that are in the images pull request to this branch. Ideally, the images PR would be merged and we just consume those newer images when they would be released. I also added a password entrypoint in the api-db and keycloak-db so that the charts don't need to specify a vendor in the password, the vendoring happens in the entrypoint now. The api-db and keycloak-db chart values have vendor types defined defaulting to mariadb. This branch has had the vendor default set to be I just want to ensure that the entire jenkins test suite runs through with images built on mysql and I'll feel much better about it. |
In order to support MySQL8 as well as MariaDB-based databases, a couple of schema changes are needed. These are mostly to control the size of indexes, and set enum types to be compatible.
There is no current change planned, but should a Lagoon admin wish to migrate to a cloud database for Lagoon [NOTE THAT THIS IS NOT CURRENTLY POSSIBLE], these changes will have to be in place prior to migration. Additionally, MySQL strict mode is not supported (due to Lagoon's love of zero dates).
There are a couple of local-development additions to support mysql for testing etc.