Skip to content

Commit

Permalink
mgr/dashboard: cephadm e2e job: display info on error & other improve…
Browse files Browse the repository at this point in the history
…ments

- Fix: ensure that on_error trap is called (display more info on error).
- Set static IPs to VMs.
- Remove domain in cluster definition to avoid side effects of potential dns misconfiguration.
- Minor improvements.

Fixes: https://tracker.ceph.com/issues/53991

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
  • Loading branch information
alfonsomthd committed Jan 24, 2022
1 parent f300687 commit 39af61e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh
Expand Up @@ -22,9 +22,9 @@ fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
cephadm_shell="cephadm shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"

{% for number in range(1, nodes) %}
ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}.{{ domain }}
ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}
{% if expanded_cluster is defined %}
${cephadm_shell} ceph orch host add {{ prefix }}-node-0{{ number }}.{{ domain }}
${cephadm_shell} ceph orch host add {{ prefix }}-node-0{{ number }}
{% endif %}
{% endfor %}

Expand Down
11 changes: 8 additions & 3 deletions src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml
@@ -1,8 +1,10 @@
parameters:
nodes: 4
node_ip_offset: 100
pool: ceph-dashboard
network: ceph-dashboard
domain: cephlab.com
gateway: 192.168.100.1
netmask: 255.255.255.0
prefix: ceph
numcpus: 1
memory: 2048
Expand All @@ -22,9 +24,12 @@ parameters:
reserveip: true
reservedns: true
sharedkey: true
domain: {{ domain }}
nets:
- {{ network }}
- name: {{ network }}
ip: 192.168.100.{{ node_ip_offset + number }}
gateway: {{ gateway }}
mask: {{ netmask }}
dns: {{ gateway }}
disks: {{ disks }}
pool: {{ pool }}
sharedfolders: [{{ ceph_dev_folder }}]
Expand Down
8 changes: 4 additions & 4 deletions src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -ex
set -eEx

cleanup() {
set +x
Expand All @@ -18,15 +18,15 @@ on_error() {
printf "\n\nERROR $1 thrown on line $2\n\n"
printf "\n\nCollecting info...\n\n"
printf "\n\nDisplaying MGR logs:\n\n"
kcli ssh -u root -- ceph-node-00 'cephadm logs -n $(cephadm ls | grep -Eo "mgr\.ceph[0-9a-z.-]+" | head -n 1)'
kcli ssh -u root -- ceph-node-00 'cephadm logs -n \$(cephadm ls | grep -Eo "mgr\.ceph[0-9a-z.-]+" | head -n 1) -- --no-tail --no-pager'
for vm_id in 0 1 2
do
local vm="ceph-node-0${vm_id}"
printf "\n\nDisplaying journalctl from VM ${vm}:\n\n"
kcli ssh -u root -- ${vm} 'journalctl --no-tail --no-pager -t cloud-init' || true
printf "\n\nEnd of journalctl from VM ${vm}\n\n"
printf "\n\nDisplaying container logs:\n\n"
kcli ssh -u root -- ${vm} 'podman logs --names --since 30s $(podman ps -aq)' || true
kcli ssh -u root -- ${vm} 'podman logs --names --since 30s \$(podman ps -aq)' || true
done
printf "\n\nTEST FAILED.\n\n"
fi
Expand Down Expand Up @@ -80,7 +80,7 @@ while [[ -z $(kcli ssh -u root -- ceph-node-00 'journalctl --no-tail --no-pager
kcli list vm
if [[ ${CLUSTER_DEBUG} != 0 ]]; then
kcli ssh -u root -- ceph-node-00 'podman ps -a'
kcli ssh -u root -- ceph-node-00 'podman logs --names --since 30s $(podman ps -aq)'
kcli ssh -u root -- ceph-node-00 'podman logs --names --since 30s \$(podman ps -aq)'
fi
kcli ssh -u root -- ceph-node-00 'journalctl -n 100 --no-pager -t cloud-init'
done
Expand Up @@ -6,12 +6,7 @@ import {
describe('Create cluster add host page', () => {
const createCluster = new CreateClusterWizardHelper();
const createClusterHostPage = new CreateClusterHostPageHelper();
const hostnames = [
'ceph-node-00.cephlab.com',
'ceph-node-01.cephlab.com',
'ceph-node-02.cephlab.com',
'ceph-node-[01-03].cephlab.com'
];
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-[01-03]'];
const addHost = (hostname: string, exist?: boolean, pattern?: boolean, labels: string[] = []) => {
cy.get('button[data-testid=table-action-button]').click();
createClusterHostPage.add(hostname, exist, false, labels);
Expand Down
Expand Up @@ -20,11 +20,7 @@ describe('Create cluster create osds page', () => {

describe('when Orchestrator is available', () => {
it('should create OSDs', () => {
const hostnames = [
'ceph-node-00.cephlab.com',
'ceph-node-02.cephlab.com',
'ceph-node-03.cephlab.com'
];
const hostnames = ['ceph-node-00', 'ceph-node-02', 'ceph-node-03'];
for (const hostname of hostnames) {
osds.create('hdd', hostname, true);

Expand Down
Expand Up @@ -7,12 +7,7 @@ describe('when cluster creation is completed', () => {
const services = new ServicesPageHelper();
const hosts = new HostsPageHelper();

const hostnames = [
'ceph-node-00.cephlab.com',
'ceph-node-01.cephlab.com',
'ceph-node-02.cephlab.com',
'ceph-node-03.cephlab.com'
];
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];

beforeEach(() => {
cy.login();
Expand Down
Expand Up @@ -5,12 +5,7 @@ describe('Host Page', () => {
const hosts = new HostsPageHelper();
const services = new ServicesPageHelper();

const hostnames = [
'ceph-node-00.cephlab.com',
'ceph-node-01.cephlab.com',
'ceph-node-02.cephlab.com',
'ceph-node-03.cephlab.com'
];
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];

beforeEach(() => {
cy.login();
Expand Down

0 comments on commit 39af61e

Please sign in to comment.