Skip to content

Commit 39af61e

Browse files
committed
mgr/dashboard: cephadm e2e job: display info on error & other improvements
- 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 <[email protected]>
1 parent f300687 commit 39af61e

File tree

7 files changed

+18
-32
lines changed

7 files changed

+18
-32
lines changed

src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
2222
cephadm_shell="cephadm shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
2323

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

src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
parameters:
22
nodes: 4
3+
node_ip_offset: 100
34
pool: ceph-dashboard
45
network: ceph-dashboard
5-
domain: cephlab.com
6+
gateway: 192.168.100.1
7+
netmask: 255.255.255.0
68
prefix: ceph
79
numcpus: 1
810
memory: 2048
@@ -22,9 +24,12 @@ parameters:
2224
reserveip: true
2325
reservedns: true
2426
sharedkey: true
25-
domain: {{ domain }}
2627
nets:
27-
- {{ network }}
28+
- name: {{ network }}
29+
ip: 192.168.100.{{ node_ip_offset + number }}
30+
gateway: {{ gateway }}
31+
mask: {{ netmask }}
32+
dns: {{ gateway }}
2833
disks: {{ disks }}
2934
pool: {{ pool }}
3035
sharedfolders: [{{ ceph_dev_folder }}]

src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -eEx
44

55
cleanup() {
66
set +x
@@ -18,15 +18,15 @@ on_error() {
1818
printf "\n\nERROR $1 thrown on line $2\n\n"
1919
printf "\n\nCollecting info...\n\n"
2020
printf "\n\nDisplaying MGR logs:\n\n"
21-
kcli ssh -u root -- ceph-node-00 'cephadm logs -n $(cephadm ls | grep -Eo "mgr\.ceph[0-9a-z.-]+" | head -n 1)'
21+
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'
2222
for vm_id in 0 1 2
2323
do
2424
local vm="ceph-node-0${vm_id}"
2525
printf "\n\nDisplaying journalctl from VM ${vm}:\n\n"
2626
kcli ssh -u root -- ${vm} 'journalctl --no-tail --no-pager -t cloud-init' || true
2727
printf "\n\nEnd of journalctl from VM ${vm}\n\n"
2828
printf "\n\nDisplaying container logs:\n\n"
29-
kcli ssh -u root -- ${vm} 'podman logs --names --since 30s $(podman ps -aq)' || true
29+
kcli ssh -u root -- ${vm} 'podman logs --names --since 30s \$(podman ps -aq)' || true
3030
done
3131
printf "\n\nTEST FAILED.\n\n"
3232
fi
@@ -80,7 +80,7 @@ while [[ -z $(kcli ssh -u root -- ceph-node-00 'journalctl --no-tail --no-pager
8080
kcli list vm
8181
if [[ ${CLUSTER_DEBUG} != 0 ]]; then
8282
kcli ssh -u root -- ceph-node-00 'podman ps -a'
83-
kcli ssh -u root -- ceph-node-00 'podman logs --names --since 30s $(podman ps -aq)'
83+
kcli ssh -u root -- ceph-node-00 'podman logs --names --since 30s \$(podman ps -aq)'
8484
fi
8585
kcli ssh -u root -- ceph-node-00 'journalctl -n 100 --no-pager -t cloud-init'
8686
done

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import {
66
describe('Create cluster add host page', () => {
77
const createCluster = new CreateClusterWizardHelper();
88
const createClusterHostPage = new CreateClusterHostPageHelper();
9-
const hostnames = [
10-
'ceph-node-00.cephlab.com',
11-
'ceph-node-01.cephlab.com',
12-
'ceph-node-02.cephlab.com',
13-
'ceph-node-[01-03].cephlab.com'
14-
];
9+
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-[01-03]'];
1510
const addHost = (hostname: string, exist?: boolean, pattern?: boolean, labels: string[] = []) => {
1611
cy.get('button[data-testid=table-action-button]').click();
1712
createClusterHostPage.add(hostname, exist, false, labels);

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ describe('Create cluster create osds page', () => {
2020

2121
describe('when Orchestrator is available', () => {
2222
it('should create OSDs', () => {
23-
const hostnames = [
24-
'ceph-node-00.cephlab.com',
25-
'ceph-node-02.cephlab.com',
26-
'ceph-node-03.cephlab.com'
27-
];
23+
const hostnames = ['ceph-node-00', 'ceph-node-02', 'ceph-node-03'];
2824
for (const hostname of hostnames) {
2925
osds.create('hdd', hostname, true);
3026

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ describe('when cluster creation is completed', () => {
77
const services = new ServicesPageHelper();
88
const hosts = new HostsPageHelper();
99

10-
const hostnames = [
11-
'ceph-node-00.cephlab.com',
12-
'ceph-node-01.cephlab.com',
13-
'ceph-node-02.cephlab.com',
14-
'ceph-node-03.cephlab.com'
15-
];
10+
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];
1611

1712
beforeEach(() => {
1813
cy.login();

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/08-hosts.e2e-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ describe('Host Page', () => {
55
const hosts = new HostsPageHelper();
66
const services = new ServicesPageHelper();
77

8-
const hostnames = [
9-
'ceph-node-00.cephlab.com',
10-
'ceph-node-01.cephlab.com',
11-
'ceph-node-02.cephlab.com',
12-
'ceph-node-03.cephlab.com'
13-
];
8+
const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];
149

1510
beforeEach(() => {
1611
cy.login();

0 commit comments

Comments
 (0)