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

Bring back CentOS 7 #410

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/intergration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
PAUSE_TEST: "${{ inputs.pause_test }}"
strategy:
matrix:
version: ["focal", "jammy"]
version: ["focal", "jammy", "7"]
steps:
- uses: "actions/checkout@v3"
- name: "Setup Python env"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ endif
ifeq ($(OS_VERSION),jammy)
PLATFORM = ubuntu
endif
ifeq ($(OS_VERSION),7)
PLATFORM = centos
endif

package: ## Build package - OS_VERSION must be one of: jammy, focal.
@docker run \
-v ${pwd}:/twindb-backup \
Expand Down
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TwinDB Backup
:target: https://pyup.io/repos/github/twindb/backup/
:alt: Updates

TwinDB Backup is a multipurpose tool for backing up MySQL database and regulare files/directories on the file system.
TwinDB Backup is a multipurpose tool for backing up MySQL database and regular files/directories on the file system.
It can store backup copies on a remote SSH server, Amazon S3 or
Google Cloud Storage.

Expand Down Expand Up @@ -128,9 +128,9 @@ Install TwinDB Backup.
.. code-block:: console

# Download the package
wget https://twindb-release.s3.amazonaws.com/twindb-backup/3.2.0/focal/twindb-backup_3.2.0-1_amd64.deb
wget https://twindb-release.s3.amazonaws.com/twindb-backup/3.3.0/focal/twindb-backup_3.3.0-1_amd64.deb
# Install TwinDB Backup
apt install ./twindb-backup_3.2.0-1_amd64.deb
apt install ./twindb-backup_3.3.0-1_amd64.deb

Configuring TwinDB Backup
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -145,7 +145,8 @@ The TwinDB Backup package can build on a machine with Docker service.
Possible ``OS_VERSION`` values:

* jammy
* focal.
* focal
* 7 (for CentOS 7)

.. code-block:: console

Expand All @@ -157,7 +158,7 @@ The package file will be generated in ``omnibus/pkg/``:
.. code-block:: console

$ ls omnibus/pkg/*.deb
omnibus/pkg/twindb-backup_3.2.0-1_amd64.deb
omnibus/pkg/twindb-backup_3.3.0-1_amd64.deb

Once the package is built you can install it with rpm/dpkg or upload it to your repository
and install it with apt or yum.
Expand Down
6 changes: 4 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Installation
Supported versions:

* Ubuntu jammy, focal
* CentOS 7

**TwinDB Backup** can be installed from a DEB package.
The packages are available in the `Releases <https://github.com/twindb/backup/releases>`_.
Expand All @@ -21,10 +22,11 @@ Possible ``OS_VERSION`` values:

* jammy
* focal
* 7 (for CentOS 7)

.. code-block:: console

# export OS_VERSION=bionic
# export OS_VERSION=jammy
# make package

.. note:: The build process requires a lot of available memory.
Expand All @@ -36,7 +38,7 @@ The package file will be generated in ``omnibus/pkg/``:
.. code-block:: console

$ ls omnibus/pkg/*.deb
omnibus/pkg/twindb-backup_3.2.0-1_amd64.deb
omnibus/pkg/twindb-backup_3.3.0-1_amd64.deb

Once the package is built you can install it with rpm/dpkg or upload it to your repository
and install it with apt or yum.
Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/projects/twindb-backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# and /opt/twindb-backup on all other platforms
install_dir '/opt/twindb-backup'

build_version '3.2.1'
build_version '3.3.0'

build_iteration 1

Expand Down
18 changes: 17 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.2.1
current_version = 3.3.0
commit = True
tag = False

Expand All @@ -15,6 +15,22 @@ replace = __version__ = "{new_version}"
search = build_version '{current_version}'
replace = build_version '{new_version}'

[bumpversion:file(1):README.rst]
search = wget https://twindb-release.s3.amazonaws.com/twindb-backup/{current_version}/focal/twindb-backup_{current_version}-1_amd64.deb
replace = wget https://twindb-release.s3.amazonaws.com/twindb-backup/{new_version}/focal/twindb-backup_{new_version}-1_amd64.deb

[bumpversion:file(2):README.rst]
search = apt install ./twindb-backup_{current_version}-1_amd64.deb
replace = apt install ./twindb-backup_{new_version}-1_amd64.deb

[bumpversion:file(3):README.rst]
search = omnibus/pkg/twindb-backup_{current_version}-1_amd64.deb
replace = omnibus/pkg/twindb-backup_{new_version}-1_amd64.deb

[bumpversion:file:docs/installation.rst]
search = omnibus/pkg/twindb-backup_{current_version}-1_amd64.deb
replace = omnibus/pkg/twindb-backup_{new_version}-1_amd64.deb

[bdist_wheel]
universal = 1

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name="twindb-backup",
version="3.2.1",
version="3.3.0",
description="TwinDB Backup tool for files, MySQL et al.",
long_description=readme + "\n\n" + history,
author="TwinDB Development Team",
Expand Down
28 changes: 28 additions & 0 deletions support/bootstrap/master/centos/master1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -exu

TB_VERSION=$(PYTHONPATH=/twindb-backup python -c "from twindb_backup import __version__; print __version__")

wait_time=2
for _ in $(seq 5)
do
yum clean all
yum -y install /twindb-backup/omnibus/pkg/twindb-backup-"${TB_VERSION}"-1.x86_64.rpm && break
echo "Waiting ${wait_time} seconds before retry"
sleep ${wait_time}
wait_time=$((wait_time * 2))
done

set +u
if ! test -z "${DEV}"; then
/bin/cp -R /twindb-backup/twindb_backup /opt/twindb-backup/embedded/lib/python3.9/site-packages
fi

# MySQL sets random root password. Reset to empty
systemctl stop mysqld
rm -rf /var/lib/mysql
mkdir /var/lib/mysql
mysqld --initialize-insecure
chown -R mysql:mysql /var/lib/mysql
systemctl start mysqld
25 changes: 25 additions & 0 deletions support/bootstrap/master/centos/slave.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -exu

TB_VERSION=$(PYTHONPATH=/twindb-backup python -c "from twindb_backup import __version__; print __version__")

wait_time=2
for _ in $(seq 5)
do
yum clean all
yum -y install /twindb-backup/omnibus/pkg/twindb-backup-"${TB_VERSION}"-1.x86_64.rpm && break
echo "Waiting ${wait_time} seconds before retry"
sleep ${wait_time}
wait_time=$((wait_time * 2))
done

set +u
if ! test -z "${DEV}"; then
/bin/cp -R /twindb-backup/twindb_backup /opt/twindb-backup/embedded/lib/python3.9/site-packages
fi

# MySQL sets random root password. Reset to empty
systemctl stop mysqld
rm -rf /var/lib/mysql
mkdir /var/lib/mysql
1 change: 1 addition & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SUPPORTED_IMAGES = [
"twindb/backup-test:jammy",
"twindb/backup-test:focal",
"twindb/backup-test:centos-7",
]

try:
Expand Down
1 change: 1 addition & 0 deletions tests/integration/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
DOCKER_IMAGES = {
"jammy": "twindb/backup-test:jammy",
"focal": "twindb/backup-test:focal",
"7": "twindb/backup-test:centos-7",
}

SUPPORTED_OS = list(DOCKER_IMAGES.keys())
Expand Down
2 changes: 1 addition & 1 deletion twindb_backup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class and saves the backup copy in something defined in a destination class.

__author__ = "TwinDB Development Team"
__email__ = "[email protected]"
__version__ = "3.2.1"
__version__ = "3.3.0"
STATUS_FORMAT_VERSION = 1
LOCK_FILE = "/var/run/twindb-backup.lock"
LOG_FILE = "/var/log/twindb-backup-measures.log"
Expand Down
16 changes: 15 additions & 1 deletion vagrant/environment/puppet/modules/profile/manifests/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
'docker.io',
'strace',
'jq',
'make'
'make',
'apparmor-utils'
]

package { $packages:
Expand Down Expand Up @@ -100,4 +101,17 @@
require => File['/etc/twindb']
}

service { 'apparmor':
ensure => stopped,
enable => false,
}

exec { 'disable apparmor':
path => '/bin:/sbin:/usr/sbin',
command => 'aa-disable /etc/apparmor.d/usr.sbin.mysqld',
creates => '/etc/apparmor.d/disable/usr.sbin.mysqld',
require => [
Package['apparmor-utils'],
]
}
}
Loading