From 81ec8da94fc22691c158701ff6aa758cf5c3a0fa Mon Sep 17 00:00:00 2001 From: Lev Date: Sun, 5 Dec 2021 12:02:08 +0300 Subject: [PATCH] feat: Upgrade mariadb and use `command` instead of copying config file (#597) --- docker-compose.yml | 11 +++++++-- installation/docker-compose-common.yml | 11 +++++++-- installation/frappe-mariadb.cnf | 7 ------ tests/pwd.yml | 33 +++++++------------------- 4 files changed, 27 insertions(+), 35 deletions(-) delete mode 100644 installation/frappe-mariadb.cnf diff --git a/docker-compose.yml b/docker-compose.yml index 398c7093..0a14455e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -139,12 +139,19 @@ services: - redis-socketio-vol:/data mariadb: - image: mariadb:10.3 + image: mariadb:10.6 restart: on-failure + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --skip-character-set-client-handshake + - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + # Sometimes db initialization takes longer than 10 seconds and site-creator goes away. + # Frappe doesn't use CONVERT_TZ() function that requires time zone info, so we can just skip it. + - MYSQL_INITDB_SKIP_TZINFO=1 volumes: - - ./installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf - mariadb-vol:/var/lib/mysql site-creator: diff --git a/installation/docker-compose-common.yml b/installation/docker-compose-common.yml index ede3abe1..5699ad7f 100644 --- a/installation/docker-compose-common.yml +++ b/installation/docker-compose-common.yml @@ -20,12 +20,19 @@ services: - redis-socketio-vol:/data mariadb: - image: mariadb:10.3 + image: mariadb:10.6 restart: on-failure + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --skip-character-set-client-handshake + - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + # Sometimes db initialization takes longer than 10 seconds and site-creator goes away. + # Frappe doesn't use CONVERT_TZ() function that requires time zone info, so we can just skip it. + - MYSQL_INITDB_SKIP_TZINFO=1 volumes: - - ./frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf - mariadb-vol:/var/lib/mysql volumes: diff --git a/installation/frappe-mariadb.cnf b/installation/frappe-mariadb.cnf deleted file mode 100644 index 83b2c703..00000000 --- a/installation/frappe-mariadb.cnf +++ /dev/null @@ -1,7 +0,0 @@ -[mysqld] -character-set-client-handshake = FALSE -character-set-server = utf8mb4 -collation-server = utf8mb4_unicode_ci - -[mysql] -default-character-set = utf8mb4 diff --git a/tests/pwd.yml b/tests/pwd.yml index 339900cc..7efe07ed 100644 --- a/tests/pwd.yml +++ b/tests/pwd.yml @@ -151,36 +151,21 @@ services: volumes: - sites-vol:/sites:rw - mariadb-configurator: - image: mariadb:10.3 - deploy: - restart_policy: - condition: none - command: - - "bash" - - "-c" - - > - echo -e "[mysqld]\n - skip-host-cache\n - skip-name-resolve\n - character-set-client-handshake = FALSE\n - character-set-server = utf8mb4\n - collation-server = utf8mb4_unicode_ci\n - [mysql]\n - default-character-set = utf8mb4\n - [mysqld_safe]\n - skip_log_error\n - syslog\n" > /data/frappe.cnf - volumes: - - mariadb-conf-vol:/data:rw - mariadb: - image: mariadb:10.3 + image: mariadb:10.6 deploy: restart_policy: condition: on-failure + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --skip-character-set-client-handshake + - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 environment: - MYSQL_ROOT_PASSWORD=admin + # Sometimes db initialization takes longer than 10 seconds and site-creator goes away. + # Frappe doesn't use CONVERT_TZ() function that requires time zone info, so we can just skip it. + - MYSQL_INITDB_SKIP_TZINFO=1 volumes: - mariadb-conf-vol:/etc/mysql/conf.d - mariadb-vol:/var/lib/mysql