Commit Graph

121 Commits

Author SHA1 Message Date
Michal Nasiadka dd3e46cd83 mariadb-clustercheck: Add a script handling signals
Since socat does not rewrite SIGTERM to exit 0 (see [1]) - let's fix it in a
different way.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809633

Change-Id: If27d93c509496651f8aa5e49a7d63b24eda91a8e
2024-01-09 16:19:38 +00:00
Michal Nasiadka 1841cc852d mariadb: Add log for mariadb-upgrade
Change-Id: I7c01ba1127f3f0bbfddf373fa66cd2627e627415
2023-07-26 17:20:16 +02:00
Michal Nasiadka 05f6fe8c30 mariadb: Bump to current LTS (10.11)
Depends-On: I2189dafca070accfd8efcd4b8cc4221c6decdc9f
Change-Id: I849608a8b90f48912e102ddab395b1a229346c5a
2023-06-26 08:48:14 +00:00
Mark Goddard 9035251443 mariadb-clustercheck: ensure /var/log/kolla/mariadb exists
If mariadb-clustercheck starts before mariadb, the directory may not
exist, and the command fails.

This is necessary for the refactored MariaDB restart in
I5a12670d07077d24047aaff57ce8d33ccf7156ff.

Change-Id: Ie1b36eb9a403611c2f86aa4c1d500d324e5291f3
2023-05-30 15:50:01 +00:00
Michal Nasiadka 1cae428f95 mariadb: log bootstrap output to file
Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/882344

Change-Id: Id627edcc2a42643ad3ae6184d972aca760474634
2023-05-08 10:12:25 +00:00
Michal Nasiadka d58203e81b mariadb: update clustercheck branch to match db version
Change-Id: I99bda6801995727dbeaa07219f336e22c8346ada
2022-12-01 10:49:22 +01:00
Marcin Juszkiewicz 878b00013b Move to CentOS Stream 9
OpenStack 'zed' requires Python 3.8+ so RHEL 8 family has to go.

This changeset moves to CentOS Stream 9 while move to RockyLinux 9 is
planned as final solution.

CI moved to CentOS Stream 9 nodes.

Depends-on: https://review.opendev.org/c/openstack/kolla-ansible/+/839715

Change-Id: I113b9984294cf8663d3fc0c8840320e1d40ea731
2022-09-27 07:40:06 +00:00
Zuul dcbc4424a6 Merge "centos: we install 'hostname' in base image" 2022-09-23 15:21:21 +00:00
Marcin Juszkiewicz e511db7048 centos: we install 'hostname' in base image
There is no need to install it in other images.

Change-Id: I9fdb987533662ee532141b06fc23b64c92788429
2022-09-13 12:46:36 +02:00
Christian Berendt 0040c6d3f6 Add missing labels blocks
Change-Id: I1396131c3e33e5f139339a203ebfb48841a358d7
2022-09-12 21:08:03 +02:00
Marcin Juszkiewicz b8572209e7 mariadb-clustercheck: do not install xinetd
We moved to socat on kolla-ansible side.

Change-Id: Icce201677dceaab8ca6f045158bbf565eef3a324
2022-07-29 12:10:29 +02:00
Marcin Juszkiewicz e21aeb5ae9 flatten images a bit
As we have one type of images now some RUN calls could be merged so we
will have less layers in resulting images.

Change-Id: I5178c58fbd8c65efe825dc249c0f1368ef0fe8e0
2022-04-21 18:53:14 +00:00
Tim Shearer 1d96a2bbe1 Adjust permissions on _extend_start files.
Explicitly set the permissions on the kolla-toolbox kolla_extend_start
file. Also, since all extend_start files are sourced rather than
executed, the executable bits are now cleared throughout the project.

Change-Id: I5c2deb4a2e33575d57c852089f856a9acc6818d0
2022-04-11 17:22:24 +02:00
Marcin Juszkiewicz a1510870e8 drop infra_image_prefix
We have one install_type only now so that infra stuff is not needed
anymore.

Change-Id: I60d50ba7699d46d001eaef365fb84b0ce8e9b262
2022-04-11 06:22:21 +00:00
Maksim Malchuk 83efe32546 Unify curl use (customisation options)
This change adds and unifies an ability to override hardcoded URLs for
air-gapped environments via the usual blocks mechanism. Also, this
change replaces ENV with ARG instruction for the variables used only
in building images, and uses bash variable expansion where it possible.

This change is a continuation of the I46b77978926fc2b578a68d1aaa944b2198af0685

Change-Id: I1fbad333b1bc95484e6f4c5145d5936a0e2db84f
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2022-03-11 15:58:05 +03:00
Radosław Piliszek 4563971073 Move all distros to upstream MariaDB 10.5
Per meeting's agreement [1].

[1] https://meetings.opendev.org/meetings/kolla/2021/kolla.2021-09-22-15.01.log.html#l-71

Change-Id: If24c53b3b89eddfaf2cad39fb9e70cea0f770c96
2021-09-28 17:36:04 +00:00
Michal Arbet acc23bb607 Move clustercheck script to mariadb-base
This patch moves clustercheck script to
mariadb-base image, so it can be used for
mariadb's docker healthcheck.

Change-Id: I4abcbf67a84b7e96f42cd5e1324ff79e47eb1cb5
2021-08-31 16:14:52 +02:00
Zuul ef0a578c48 Merge "Modify healthcheck_mariadb" 2021-05-06 15:16:37 +00:00
Marcin Juszkiewicz e0f8cbc50c move to Debian 'bullseye'
Bullseye is now in hard freeze cycle and goes for release.

https://release.debian.org/bullseye/freeze_policy.html

Co-Authored-By: Michal Nasiadka <mnasiadka@gmail.com>

Change-Id: I543965a2741cebfa759576a4c75669a7bacd4208
2021-04-26 20:01:28 +02:00
LinPeiWen 407d774ffb Modify healthcheck_mariadb
Use the healthcheck_mariadb script to check the status of mariadb
Related patch of kolla-ansible:
  https://review.opendev.org/c/openstack/kolla-ansible/+/780404

Change-Id: I9e8fb8fab1adba03aba4ed9ce42e4d4666bc764b
2021-04-26 15:08:30 +00:00
Michał Nasiadka be15ec9823 Remove mariadb image
It has been deprecated in [1].

[1]: https://review.opendev.org/c/openstack/kolla/+/752430

Change-Id: Iee69d8480960562a3d19752661c0556db65ade45
2021-04-12 11:42:25 +02:00
Zuul a8b6d26d27 Merge "mariadb: Fixes incremental backup failure when full not created today" 2020-12-17 12:19:07 +00:00
Zuul 9707694c34 Merge "Remove footer block from intermediate images" 2020-12-12 21:21:07 +00:00
Michał Nasiadka 22c32a30e6 Unify curl options
Currently we use couple of curl options throughout Dockerfiles, this change
adds all common options to curlrc (-sSLf) and removes usage of those in
Dockerfiles.

Change-Id: I46b77978926fc2b578a68d1aaa944b2198af0685
2020-12-02 18:48:22 +01:00
Mark Goddard 4b792b9a43 Remove footer block from intermediate images
Only the final image in a hierarchy should have the footer block.

neutron-infoblox-ipam-agent image still has two footers because it
inherits from the neutron-server image. We set the user to root at the
beginning of that Dockerfile, so that headers and footers have the right
context.

Change-Id: I95e5bb5583be2a76e289749e8adfc303a4e7197a
2020-11-20 12:20:21 +00:00
abraden ccfe65b5f7 mariadb: Fixes incremental backup failure when full not created today
backup_full() saves the history name in $BACKUP_DIR/last_full_date.
backup_incremental() attempts to read from $BACKUP_DIR/last_full_date
into $LAST_FULL_DATE. After the read attempt; if $LAST_FULL_DATE is zero
length then $(date +%d-%m-%Y) is used.

Change-Id: I4172b814d5d95ae3debbc1cf3feaeee2e2bec9bd
Closes-bug: 1897948
2020-10-23 19:31:33 +00:00
Marcin Juszkiewicz 90adc2b851 introduce 'infra_image_prefix' for infra images
Defaults to 'image_prefix' for now but shows which images gets their
names changed soon.

Change-Id: I0608e8f62f28d6667b4c8753c47553e4cbf75503
2020-07-09 23:31:42 +02:00
Michal Nasiadka 59616d4423 Add mariadb_clustercheck image
Add mariadb_clustercheck image with xinetd and clustercheck binary for haproxy
checking of galera status.
Reorganise existing mariadb images by creating mariadb-base and mariadb-server.

Existing mariadb image will be deprecated (in a separate change).

Change-Id: Ib601f64e1514521154beeaac40f0c058a7119408
2020-04-22 08:46:33 +00:00
Christian Berendt 861f55fbfd Add block labels to all Dockerfiles
Change-Id: I9692dda817ef134d647247431565e1b58cf9da41
2020-03-01 17:25:58 +00:00
Mark Goddard 1fe8012ce2 Actually disable EPEL, and epel-modular
The disable_extra_repos macro accepts a list as its only argument. We
were calling it like this to disable EPEL:

disable_extra_repos('epel')

The macro interpreted this as a request to disable three repos, e, p, l.
Thanks Python! Type validation to be improved separately.

Additionally, on CentOS 8 the EPEL repository was not included in the
repository mapping file, repos.yaml. There is also another EPEL
repository on CentOS 8, epel-modular, which is enabled by default after
installing epel-release.

This change adds mappings for epel and epel-modular repos to repos.yaml,
and fixes the disabling of epel in the base image, as well as disabling
epel-modular.

There are some cases where EPEL is still used (it seemed a bit too
easy...), and the repository has been enabled for these images:

* bifrost-base (nginx)
* ironic-conductor (C7 only, shellinabox)
* freezer-base (C7 only, trickle)
* gnocchi-base (C8 binary only, python3-boto3)
* mariadb (pv)
* mongodb (C7 only, mongodb)
* nova-spicehtml5proxy (C7 only, spice-html5)
* telegraf (C7 only, python2-pip)

A few other things were changed:

* ironic-conductor does not require the ceph repo
* python3-pika is no longer installed in the openstack-base image

Related: blueprint remove-epel

Change-Id: I3761825239dfc462072383cde6276c4fb3e1bf12
2020-02-26 13:46:04 +00:00
Michal Nasiadka 79851d7929 Build images with healthcheck scripts for core services
blueprint container-health-check

Now docker supports healthcheck directive[0] in Dockerfile,
which is helpful for checking container aliveness.

Base for this patch were healthcheck scripts from tripleo[1].

[0] https://docs.docker.com/engine/reference/builder/#healthcheck
[1] https://github.com/openstack/tripleo-common/tree/master/healthcheck

Change-Id: Ifc32713cd4d6b45c74855c0ebf5bb65784701d44
2019-12-09 12:57:10 +00:00
Marcin Juszkiewicz cf11cd6f3d Enable repos only when needed
Disable external repositories by default and enable only when needed.

Depends-on: https://review.opendev.org/696480

Implements: blueprint repos-off-by-default

Change-Id: Icf2a8397a8349e0fe849d88d160409fd234480a9
2019-11-29 11:38:06 +01:00
Mark Goddard 88f374c914 Set pipefail in kolla_mariadb_backup.sh
Without this, a failure in mariabackup would be ignored due to the pipe
to gzip.

Change-Id: I84536b302991e8fb04d5fa67ea266bc428437ce1
Related-Bug: #1843043
2019-10-25 12:35:18 +01:00
Mark Goddard 65b27d772b Fix mariabackup arguments
After switching from innobackupex to mariabackup [1] for database
backups, the kolla_mariadb_backup.sh script was not modified to account
for the difference in arguments between innobackupex and mariabackup.
There is a compatibility mode, the documentation [2] for which covers
some of the differences.

The following have been changed:

- Add explicit --backup argument, now required
- Remove './' positional argument - not required with --stream
- Remove --no-timestamp argument - only supported in innobackupex
  compatibility mode
- Remove --incremental argument - implied by --incremental-history-name
- Remove deprecated --compress argument, which requires qpress to be
  installed (it is not). The stream is now passed through gzip instead
  [3]

[1] https://mariadb.com/kb/en/library/mariabackup-overview/
[2] https://mariadb.com/kb/en/library/mariabackup-options/#-innobackupex
[3] https://mariadb.com/kb/en/library/using-encryption-and-compression-tools-with-mariabackup/

Change-Id: I67cff47cbf56570b8eaeb66092dd87c2769fc8a6
Closes-Bug: #1843043
2019-10-23 15:43:26 +01:00
Marcin Juszkiewicz 016c0f577c Drop Percona XtraBackup in favour of MariaDB Backup
XtraBackup started failing to install on Ubuntu and does not support
MariaDB 10.3 version.

Related-Bug: #1843043

Change-Id: I9cf62c8e03a02574d85e5349df1d23a51d4c99be
2019-09-12 14:14:08 +02:00
Michal Nasiadka 761d587177 Move to MariaDB upstream repo and new version (10.3) on Ubuntu
MariaDB in Ubuntu packages is backlevel (10.1).
Devstack gates are tested on MySQL 5.7 which is not compatible
with MariaDB 10.1.
Neutron recently introduced a db migration
that breaks on MariaDB 10.1, but works on MariaDB 10.3 [0].

Bumping up version to 10.3 on Ubuntu to match CentOS (RDO) version.

[0]: https://review.opendev.org/#/c/677221/

Closes-Bug: #1841907
Change-Id: I16e4c40208912691e3015bfe2065ea0ce2358edb
2019-08-31 06:35:43 +00:00
Doug Szumski 99de712a2d Support customising MariaDB log directory
This retains the default, but allows the directory to be customised
if required. This is useful, for example, when using Kolla Ansible
to deploy multiple instances of MariaDB.

Partially Implements: blueprint support-nova-cells
Change-Id: I042fbe140ee84f2ed72e27635be247cb145aac5f
2019-08-08 16:17:02 +00:00
Rabi Mishra fb4cb9efda Add config option use_dumb_init to add it to container images
Usage of dumb-init can also be disabled from cli with
`--nouse-dumb-init` when building images.

Also moves ENTRYPOINT outside of dumb_init_installation
block.

Change-Id: Id32d54fc9913b83cf121ede5a5e265e0772062ae
Related-Bug: #1821970
2019-04-03 08:27:45 +00:00
Mark Goddard 3c9c72bad0 MariaDB upgrade: specify host and port
While mysql_upgrade seems to work on CentOS images without specifying a
host and port, it fails on Ubuntu without these.

Change-Id: Ie140de57c4fe2f2e4db6a90c18e3535d9cc71ff2
Related-Bug: #1820325
2019-03-23 10:16:19 +00:00
Mark Goddard 3075685d01 Fix MariaDB 10.3 upgrade
There are a couple of issues with the mariadb image currently.

1. it doesn't include mysql_upgrade on CentOS/RHEL. It is necessary to
   run this after an upgrade of MariaDB. This is fixed by installing
   mariadb-server-utils.

2. it inherits the standard dumb-init entrypoint from the base image,
   which includes a --single-child argument. That causes signals to be
   forwarded only to the process executed by dumb-init, which in the
   case of kolla-ansible is mysqld_safe, however mysqld_safe ignores
   SIGTERM. After a timeout, Docker then forcibly kills the container.
   Executing dumb-init without --single-child ensures the TERM signal is
   sent to mysqld, allowing it to shutdown gracefully.

Change-Id: I1a450736721863b91be1ea3d3c8948990de9fdeb
Closes-Bug: #1820325
2019-03-18 19:42:36 +00:00
Alex Schultz ae1322ec10 Use base_package_type
This change updates the docker files to use base_package_type instead
of doing specific distro checks for the rhel/deb generic cases. The
base_distro is still available and is used when a specific distro needs
a customization but if the differences are purely rpm vs deb, then the
base_package_type can be used.

Change-Id: I8d720bb185df65a0178061ccf20b1ab2265da2c5
2019-01-17 08:23:41 -07:00
Eduardo Gonzalez 32beb0a642 Required changes for mariadb 10.3
Mysql-python is a deprecated package and fails to build currently.
Make use of mysqlclient as is a fork of mysql-python with many bug
fixes a python3 support.
percona xtrabackup doenst work with mariadb 10.3,
replaces to use mariadb-backup tool.
https://jira.mariadb.org/browse/MDEV-15774

Change-Id: Icefe3a77fb12d57c869521000d458e3f58435374
2018-12-11 19:31:24 +00:00
Damien Ciabrini 8e2906a59e mariadb: make security_reset.expect's timeout configurable
Under heavy load, when the security_reset script is being run to set
up root password, it might happen that the mysql server doesn't get a
change to evaluate the SQL statement sent by security_reset.expect
before the hardcoded 10 seconds timeout is reached.

Allow the timeout to be overriden via env variable DB_MAX_TIMEOUT,
which is already used as a timeout variable in extend_start.sh

Change-Id: If82c6daca82a48d899605829dc99cf4a352cddcd
Closes-Bug: #1775864
2018-10-24 13:55:15 +02:00
Jeffrey Zhang 14374e715d Bump Ubuntu base image to 18.04
Ubuntu 18.04 has been released. We need upgrade to it this cycle.

Changes made in this patch

- Bump ubuntu repo from xenial to bionic. Some repos do not have bionic
  packages, so still using xenial repos.
- Drop mariadb, percona and nfs-ganesha repo, because these packages are
  already provided by Ubuntu official repo.
- Since qdrouterd does not have bionic repo and xenial packages does not
  work on Ubuntu bionic, just add it into ignore image list.
- Use python-rtslib-fb and targetcli-fb rather than python-rtslib
  and targetcli
- use xen-utils package name rather than with package version one.
- Seems unsigned repo won't work on Ubuntu bionic, stop using infra
  mirrored unsigned repo in gate building job.

Needed-By: https://review.openstack.org/568728
Implement blueprint: ubuntu-bionic
Change-Id: I4e3b0ca669cfbf6316bf591f2d8428fa1a0d6182
2018-05-26 00:24:30 +08:00
Marcin Juszkiewicz 60e1c4b341 mariadb: create /var/run/mysqld under Debian distros
Change-Id: I4fdab197e18b25f6af7275da6ecbdb9c516ba0a5
2018-02-26 12:30:24 +01:00
Martin Mágr 293a1d9f8c Add socat to base image
We would need socat tool to perform healthchecks on the various containers.

Closes-Bug: #1749227
Change-Id: Ibda77a8d041d894f5efac6578e52b11651bca97f
2018-02-14 11:57:34 +01:00
Zuul 9d47c13a54 Merge "Consume RDO packaged mariadb version" 2018-01-23 06:55:01 +00:00
Jeffrey Zhang 502196d8fa Add --wsrep-new-cluster option back in the bootstrap_db function
Ia2acb09e877a586243fc1acb49d8d140cf27d7b5 removed the
"--wsrep-new-cluster" option and left "--wsrep-on=OFF".
But it seems "--wsrep-on=OFF" won't work with mariadb 10.0. and In
Ubuntu, we are still using mariadb 10.0.

Try to add --wsrep-new-cluster back

Change-Id: I4d382d1b9c83def62dc85a773580c8c6b2500f68
2018-01-22 17:36:22 +08:00
Steven Dake a729d132d6 Consume RDO packaged mariadb version
RDO packaged mariadb recieves far more testing and qualification
than any other mariadb package on CentOS.  Lets use that instead
of a hard-pinned old version of mariadb from mariadb.org.

This patch also upgrade MariaDB from 10.0 to 10.1.20 for
RHEL/CentOS/Oracle Linux.

Depends-On: I8374ac2219ad7880970cd789727d01af7cac1077
Depends-On: Ia2acb09e877a586243fc1acb49d8d140cf27d7b5
Co-Authored-By: Xinliang Liu <xinliang.liu@linaro.org>
Change-Id: I071362fc1b8d60199a77e2fe0475d2b4c3b5341b
2018-01-21 19:19:57 +01:00
Xinliang Liu 6ff3a55aed Fix MariaDB bootstrap for 10.1 version
Option "wsrep_on" behaves differently between 10.0 and 10.1 [1]:
"Before MariaDB 10.1, even though this variable is ON by default,
its value get automatically adjusted based on whether mandatory
configurations to turn on Galera replication have been specified.
Since MariaDB 10.1, it is set to OFF by default and must be turned
on to enable Galera replication."

So on MariaDB 10.0 although wsrep_on set to OFF, its value will
automatically adjusted to ON because wsrep mandatory configurations
are set. Whereas on MariaDB 10.1, it will failed at galera provider
'wsrep_ready' checking because wsrep_on is set to OFF.

We can set wsrep_on to ON to handle both 10.0 and 10.1.

But, the point is that the cluster bits, which are creating a cluster
and wsrep_ready checking, are no need at bootstrap stage.

At bootstrap stage it mainly do two things:
Creating required system DBs (by mysql_install_db)
and securing the mariadb (by bootstrap_db).

After the bootstrap stage, it will create a cluster when starting the
first node.

[1] https://mariadb.com/kb/en/library/galera-cluster-status-variables/#wsrep_ready

Partial-Bug: 1740060
Co-Authored-By: Steven Dake <stdake@cisco.com>
Change-Id: Ia2acb09e877a586243fc1acb49d8d140cf27d7b5
2018-01-04 09:31:22 +08:00