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

add quincy and reef support on ubuntu-focal #709

Merged
merged 4 commits into from
Apr 8, 2024
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
39 changes: 37 additions & 2 deletions sesdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -455,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']
Expand Down Expand Up @@ -941,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
Expand Down
36 changes: 35 additions & 1 deletion seslib/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -192,6 +198,10 @@ class Constant():
'repo': 'https://github.com/ceph/ceph',
'branch': 'master',
},
'ubuntu-focal': {
'repo': 'https://github.com/ceph/ceph',
'branch': 'main',
},
}

METADATA_FILENAME = ".metadata"
Expand All @@ -212,6 +222,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()}
Expand Down Expand Up @@ -302,6 +313,7 @@ class Constant():
'leap-15.4': 'zypper',
'tumbleweed': 'zypper',
'ubuntu-bionic': 'apt',
'ubuntu-focal': 'apt',
}

OS_CA_REPO = {
Expand Down Expand Up @@ -423,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"],
Expand Down Expand Up @@ -495,6 +509,7 @@ class Constant():
'openSUSE_Tumbleweed'
],
'ubuntu-bionic': [],
'ubuntu-focal': [],
},
'pacific': {
'leap-15.2': [
Expand All @@ -509,6 +524,19 @@ class Constant():
'https://download.opensuse.org/repositories/filesystems:/ceph:/pacific/'
'openSUSE_Tumbleweed'
],
'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': [
Expand Down Expand Up @@ -579,6 +607,8 @@ class Constant():
'nautilus': 'deepsea',
'octopus': 'cephadm',
'pacific': 'cephadm',
'quincy': 'cephadm',
'reef': 'cephadm',
'caasp4': None,
'k3s': None,
'makecheck': None,
Expand All @@ -591,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',
Expand All @@ -604,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',
}
Expand Down
19 changes: 14 additions & 5 deletions seslib/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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
):
Expand All @@ -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')
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions seslib/templates/apt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions seslib/templates/provision.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
22 changes: 19 additions & 3 deletions seslib/templates/ubuntu/provision.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 #}
2 changes: 1 addition & 1 deletion tests/test_parse_config_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading