From db3b92a9fde63cae13a82198aada209e76175e73 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sat, 30 Mar 2024 08:01:46 +0000 Subject: [PATCH 1/4] add ubuntu-focal support Signed-off-by: Mykola Golub --- sesdev/__init__.py | 3 ++- seslib/constant.py | 8 ++++++++ seslib/deployment.py | 9 +++++++++ seslib/templates/apt.j2 | 9 +++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sesdev/__init__.py b/sesdev/__init__.py index ed8743443..3f305f603 100644 --- a/sesdev/__init__.py +++ b/sesdev/__init__.py @@ -149,7 +149,8 @@ def common_create_options(func): 'sles-15-sp3', 'sles-15-sp4', 'sles-15-sp5', - 'ubuntu-bionic']), + 'ubuntu-bionic', + 'ubuntu-focal']), default=None, help='OS (open)SUSE distro'), click.option('--provision/--no-provision', default=True, diff --git a/seslib/constant.py b/seslib/constant.py index fb44db7a3..b53cd3cfc 100644 --- a/seslib/constant.py +++ b/seslib/constant.py @@ -192,6 +192,10 @@ class Constant(): 'repo': 'https://github.com/ceph/ceph', 'branch': 'master', }, + 'ubuntu-focal': { + 'repo': 'https://github.com/ceph/ceph', + 'branch': 'main', + }, } METADATA_FILENAME = ".metadata" @@ -212,6 +216,7 @@ class Constant(): 'opensuse/Leap-15.3.x86_64': 'leap-15.3', 'opensuse/Tumbleweed.x86_64': 'tumbleweed', 'generic/ubuntu1804': 'ubuntu-bionic', + 'generic/ubuntu2004': 'ubuntu-focal', } OS_BOX_ALIASES = {v: k for k, v in OS_ALIASED_BOXES.items()} @@ -302,6 +307,7 @@ class Constant(): 'leap-15.4': 'zypper', 'tumbleweed': 'zypper', 'ubuntu-bionic': 'apt', + 'ubuntu-focal': 'apt', } OS_CA_REPO = { @@ -495,6 +501,7 @@ class Constant(): 'openSUSE_Tumbleweed' ], 'ubuntu-bionic': [], + 'ubuntu-focal': [], }, 'pacific': { 'leap-15.2': [ @@ -509,6 +516,7 @@ class Constant(): 'https://download.opensuse.org/repositories/filesystems:/ceph:/pacific/' 'openSUSE_Tumbleweed' ], + 'ubuntu-focal': [], }, 'ses7': { 'sles-15-sp2': [ diff --git a/seslib/deployment.py b/seslib/deployment.py index fba687d00..a730ba250 100644 --- a/seslib/deployment.py +++ b/seslib/deployment.py @@ -1199,6 +1199,15 @@ def vet_configuration(self): self.settings.os, self.settings.version ) + # experimental Ubuntu Focal + if self.settings.os in ['ubuntu-focal']: + if self.settings.version in ['octopus', 'pacific', 'quincy', 'reef']: + pass # we support + else: + raise VersionOSNotSupported( + self.settings.os, + self.settings.version + ) # no node may have more than one of any role for node in self.settings.roles: for role in Constant.ROLES_KNOWN: diff --git a/seslib/templates/apt.j2 b/seslib/templates/apt.j2 index 028fc5ca8..c76fd9576 100644 --- a/seslib/templates/apt.j2 +++ b/seslib/templates/apt.j2 @@ -8,6 +8,8 @@ wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add - # https://tracker.ceph.com/issues/45009 is fixed) {% if os == 'ubuntu-bionic' %} {% set codename = 'bionic' %} +{% elif os == 'ubuntu-focal' %} +{% set codename = 'focal' %} {% else %} echo "BADNESS: UNSUPPORTED OS {os}. Bailing out!" exit 0 @@ -30,9 +32,16 @@ curl --silent -L https://download.opensuse.org/repositories/devel:/kubic:/libcon apt-get update apt-cache policy +# XXX: A hack to get some free space on /boot. Otherwise insalling podman +# below may fail when updating initramfs due to not enough space. +rm -f `realpath /boot/*.old` + # install podman apt-get -y install podman +# install jq +apt-get -y install jq + # install cephadm DEB package ./cephadm install which cephadm From 11b834488c778abfb27a04887142b7d308efcc0a Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sat, 30 Mar 2024 08:05:07 +0000 Subject: [PATCH 2/4] add initial quincy and reef support Signed-off-by: Mykola Golub --- sesdev/__init__.py | 36 +++++++++++++++++++++++++++++++- seslib/constant.py | 28 ++++++++++++++++++++++++- seslib/deployment.py | 10 ++++----- seslib/templates/provision.sh.j2 | 4 ++-- tests/test_parse_config_yaml.py | 2 +- 5 files changed, 70 insertions(+), 10 deletions(-) diff --git a/sesdev/__init__.py b/sesdev/__init__.py index 3f305f603..5b42c4444 100644 --- a/sesdev/__init__.py +++ b/sesdev/__init__.py @@ -456,7 +456,7 @@ def _gen_settings_dict( roles_string = "" if version in ['ses7', 'ses7p']: roles_string = Constant.ROLES_SINGLE_NODE['ses7'] - elif version in ['octopus', 'pacific']: + elif version in ['octopus', 'pacific', 'quincy', 'reef']: roles_string = Constant.ROLES_SINGLE_NODE['octopus'] elif version in ['ses6', 'nautilus']: roles_string = Constant.ROLES_SINGLE_NODE['nautilus'] @@ -942,6 +942,40 @@ def pacific(deployment_id, **kwargs): _create_command(deployment_id, settings_dict) +@create.command() +@click.argument('deployment_id', required=False) +@common_create_options +@deepsea_options +@ceph_salt_options +@libvirt_options +@ipv6_options +def quincy(deployment_id, **kwargs): + """ + Creates a Ceph Quincy cluster + """ + _prep_kwargs(kwargs) + settings_dict = _gen_settings_dict('quincy', **kwargs) + deployment_id = _maybe_gen_dep_id('quincy', deployment_id, settings_dict) + _create_command(deployment_id, settings_dict) + + +@create.command() +@click.argument('deployment_id', required=False) +@common_create_options +@deepsea_options +@ceph_salt_options +@libvirt_options +@ipv6_options +def reef(deployment_id, **kwargs): + """ + Creates a Ceph Reef cluster + """ + _prep_kwargs(kwargs) + settings_dict = _gen_settings_dict('reef', **kwargs) + deployment_id = _maybe_gen_dep_id('reef', deployment_id, settings_dict) + _create_command(deployment_id, settings_dict) + + @create.command() @click.argument('deployment_id', required=False) @common_create_options diff --git a/seslib/constant.py b/seslib/constant.py index b53cd3cfc..e0054d8df 100644 --- a/seslib/constant.py +++ b/seslib/constant.py @@ -14,7 +14,7 @@ class Constant(): CONFIG_FILE = os.path.join(A_WORKING_DIR, 'config.yaml') - CORE_VERSIONS = ['nautilus', 'ses6', 'octopus', 'ses7', 'ses7p', 'pacific'] + CORE_VERSIONS = ['nautilus', 'ses6', 'octopus', 'ses7', 'ses7p', 'pacific', 'quincy', 'reef'] DEBUG = False @@ -92,6 +92,12 @@ class Constant(): 'snmp-gateway': 'registry.opensuse.org/filesystems/ceph/pacific/images/' 'ceph/prometheus-snmp_notifier:latest', }, + 'quincy': { + 'ceph': 'quay.io/ceph/ceph:v17', + }, + 'reef': { + 'ceph': 'quay.io/ceph/ceph:v18', + }, } IMAGE_PATHS_PRODUCT = { @@ -429,6 +435,8 @@ class Constant(): 'nautilus': ROLES_DEFAULT["nautilus"], 'octopus': ROLES_DEFAULT["octopus"], 'pacific': ROLES_DEFAULT["octopus"], + 'quincy': ROLES_DEFAULT["octopus"], + 'reef': ROLES_DEFAULT["octopus"], 'ses6': ROLES_DEFAULT["nautilus"], 'ses7': ROLES_DEFAULT["ses7"], 'ses7p': ROLES_DEFAULT["ses7"], @@ -518,6 +526,18 @@ class Constant(): ], 'ubuntu-focal': [], }, + 'quincy': { + 'leap-15.2': [], + 'leap-15.3': [], + 'tumbleweed': [], + 'ubuntu-focal': [], + }, + 'reef': { + 'leap-15.2': [], + 'leap-15.3': [], + 'tumbleweed': [], + 'ubuntu-focal': [], + }, 'ses7': { 'sles-15-sp2': [ 'http://download.nue.suse.com/ibs/Devel:/Storage:/7.0/images/repo/' @@ -587,6 +607,8 @@ class Constant(): 'nautilus': 'deepsea', 'octopus': 'cephadm', 'pacific': 'cephadm', + 'quincy': 'cephadm', + 'reef': 'cephadm', 'caasp4': None, 'k3s': None, 'makecheck': None, @@ -599,6 +621,8 @@ class Constant(): 'nautilus': 'leap-15.1', 'octopus': 'leap-15.2', 'pacific': 'leap-15.3', + 'quincy': 'ubuntu-focal', + 'reef': 'ubuntu-focal', 'caasp4': 'sles-15-sp2', 'k3s': 'tumbleweed', 'makecheck': 'tumbleweed', @@ -612,6 +636,8 @@ class Constant(): 'octopus': 'Ceph Octopus', 'ses7': 'SES 7', 'pacific': 'Ceph Pacific', + 'quincy': 'Ceph Quincy', + 'reef': 'Ceph Reef', 'ses7p': 'SES 7.1', 'makecheck': 'Ceph makecheck', } diff --git a/seslib/deployment.py b/seslib/deployment.py index a730ba250..6ec45012d 100644 --- a/seslib/deployment.py +++ b/seslib/deployment.py @@ -254,7 +254,7 @@ def __maybe_tweak_roles(self): if self.node_counts['master'] == 0: self.settings.roles[0].append('master') self.node_counts['master'] = 1 - if self.settings.version in ['ses7', 'octopus', 'pacific']: + if self.settings.version in ['ses7', 'octopus', 'pacific', 'quincy', 'reef']: if self.node_counts['bootstrap'] == 0: for node_roles in self.settings.roles: if 'mon' in node_roles and 'mgr' in node_roles: @@ -1105,7 +1105,7 @@ def configuration_report(self, "Yes" if self.settings.encrypted_osds else "No") result += " - OSD objectstore: {}\n".format( "FileStore" if self.settings.filestore_osds else "BlueStore") - if self.settings.version in ["octopus", "ses7", "pacific"]: + if self.settings.version in ["octopus", "ses7", "pacific", "quincy", "reef"]: if 'admin' not in v.roles and v.roles != [] and v.roles != ['client']: result += ( " (CAVEAT: the 'admin' role is assumed" @@ -1132,7 +1132,7 @@ def vet_configuration(self): # octopus and beyond require one, and only one, bootstrap role # and bootstrap must have admin role as well (unless this is # merely a partial deployment - then we don't care) - if self.settings.version in ['ses7', 'octopus', 'pacific']: + if self.settings.version in ['ses7', 'octopus', 'pacific', 'quincy', 'reef']: if (not self.settings.stop_before_ceph_salt_config and not self.settings.stop_before_ceph_salt_apply ): @@ -1148,7 +1148,7 @@ def vet_configuration(self): if self.settings.version in ['nautilus', 'ses6']: if self.node_counts['storage'] == 0: raise NoStorageRolesDeepsea(self.settings.version) - if self.settings.version in ['octopus', 'ses7', 'pacific']: + if self.settings.version in ['octopus', 'ses7', 'pacific', 'quincy', 'reef']: if self.node_counts['storage'] == 0: if self.node_counts['rgw'] > 0: raise NoStorageRolesCephadm('rgw') @@ -1159,7 +1159,7 @@ def vet_configuration(self): if self.node_counts['mds'] > 0: raise NoStorageRolesCephadm('mds') # ganesha role only allowed pre-octopus - if self.settings.version in ['octopus', 'ses7', 'pacific']: + if self.settings.version in ['octopus', 'ses7', 'pacific', 'quincy', 'reef']: if self.node_counts["ganesha"] > 0: raise NoGaneshaRolePostNautilus() # there must not be more than one suma role: diff --git a/seslib/templates/provision.sh.j2 b/seslib/templates/provision.sh.j2 index dc44e68f3..bb1b23865 100644 --- a/seslib/templates/provision.sh.j2 +++ b/seslib/templates/provision.sh.j2 @@ -87,11 +87,11 @@ hostnamectl set-hostname {{ node.fqdn }} hostnamectl set-hostname {{ node.name }} {% endif %} -{% if version in ['octopus', 'ses7', 'pacific'] %} +{% if version in ['octopus', 'ses7', 'pacific', 'quincy', 'reef'] %} # persist the journal sed -i -e 's/#Storage=auto/Storage=persistent/' /etc/systemd/journald.conf systemctl restart systemd-journald -{% endif %}{# version in ['octopus', 'ses7', 'pacific'] #} +{% endif %}{# version in ['octopus', 'ses7', 'pacific', 'quincy', 'reef'] #} # if --ssd option was given, set rotational flag on first additional disk {% if ssd %} diff --git a/tests/test_parse_config_yaml.py b/tests/test_parse_config_yaml.py index 65757065b..b8c936c29 100644 --- a/tests/test_parse_config_yaml.py +++ b/tests/test_parse_config_yaml.py @@ -50,4 +50,4 @@ def test_parse_config_yaml(isfile, exists): ['mon', 'mgr', 'storage'], ['mon', 'mgr', 'storage'], ] - assert len(settings['other_roles'].keys()) == 9 + assert len(settings['other_roles'].keys()) == 11 From 79670788033f158adc0113e98edcf63eeb1fffca Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 1 Apr 2024 11:14:13 +0100 Subject: [PATCH 3/4] improve deployment on ubuntu 1) multi-node 2) deployment day 2 Signed-off-by: Mykola Golub --- seslib/templates/provision.sh.j2 | 5 +++++ seslib/templates/ubuntu/provision.sh.j2 | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/seslib/templates/provision.sh.j2 b/seslib/templates/provision.sh.j2 index bb1b23865..2f9c2e6a5 100644 --- a/seslib/templates/provision.sh.j2 +++ b/seslib/templates/provision.sh.j2 @@ -194,8 +194,13 @@ fi # upstream Ceph on Ubuntu {% elif os.startswith('ubuntu') %} {% include "ubuntu/provision.sh.j2" %} +{% if node.name == cephadm_bootstrap_node.name %} +{% include "cephadm/deployment_day_2.sh.j2" %} +{% endif %}{# node == master #} {% endif %}{# end of deploy state machine #} # inform user if reboot is needed (should be the very last thing the provisioner does) +{% if package_manager == 'zypper' %} zypper ps -s || true +{% endif %} diff --git a/seslib/templates/ubuntu/provision.sh.j2 b/seslib/templates/ubuntu/provision.sh.j2 index 2bf49ed71..16fec9927 100644 --- a/seslib/templates/ubuntu/provision.sh.j2 +++ b/seslib/templates/ubuntu/provision.sh.j2 @@ -6,7 +6,23 @@ echo "Stopping the deployment before \"cephadm bootstrap\" because --stop-before exit 0 {% endif %} {# stop_before_cephadm_bootstrap #} -{% if node == master %} +{% if node.name == cephadm_bootstrap_node.name %} + +{% set extra_options = "" %} + +{% if storage_nodes < 3 %} +{% set extra_options = extra_options + " --single-host-defaults" %} +{% endif %} + mkdir -p /etc/ceph -cephadm bootstrap --mon-ip {{ bootstrap_mon_ip }} -{% endif %} {# node == master #} +cephadm bootstrap --mon-ip {{ bootstrap_mon_ip }} {{ extra_options }} \ + --ssh-private-key /root/.ssh/id_rsa --ssh-public-key /root/.ssh/id_rsa.pub + +{% for _node in nodes %} +{% if _node.name != node.name %} +ceph orch host add {{ _node.name }} +scp -r /etc/ceph {{ _node.name }}:/etc +{% endif %} +{% endfor %} + +{% endif %} {# node.name == cephadm_bootstrap_node.name #} From 20f60e617f398f4d578c40083710551564eadf8f Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 1 Apr 2024 14:46:46 +0100 Subject: [PATCH 4/4] doc: add section about ubuntu-focal to README Signed-off-by: Mykola Golub --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 83c9a3dea..6e01ccd88 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ The Jenkins CI tests that `sesdev` can be used to deploy a single-node Ceph * [With wire encryption](#with-wire-encryption) * [Deploying non-SUSE environments](#deploying-non-suse-environments) * [Ubuntu "Bionic Beaver" 18.04](#ubuntu-bionic-beaver-1804) + * [Ubuntu "Focal Fossa" 20.04](#ubuntu-focal-fossa-2004) * [Introspect existing deployments](#introspect-existing-deployments) * [List all existing deployments and their overall status](#list-all-existing-deployments-and-their-overall-status) * [Get status of individual nodes in an existing deployment](#get-status-of-individual-nodes-in-an-existing-deployment) @@ -867,6 +868,28 @@ This will create Ubuntu 18.04 VMs and bootstrap a Ceph Octopus cluster on them using `cephadm bootstrap`. To stop the deployment before bootstrap, give the `--stop-before-cephadm-bootstrap` option. +##### Ubuntu "Focal Fossa" 20.04 + +Ubuntu Focal is supported with the `octopus`, `pacific`, `quincy`, `reef` +deployment versions, and this os is the default for `quincy` and `reef`. +For example: + +``` +sesdev create pacific --os ubuntu-focal +sesdev create pacific --single-node --os ubuntu-focal +``` + +This will create Ubuntu 20.04 VMs and bootstrap a Ceph Pacific cluster on them +using `cephadm bootstrap`. To stop the deployment before bootstrap, give the +`--stop-before-cephadm-bootstrap` option. + +When deploying Ceph Quincy there is no need to specify `--os` option: + +``` +sesdev create quincy +sesdev create quincy --single-node +``` + ### Introspect existing deployments Please note that the `sesdev status` and `sesdev show` commands take