From: Alfonso Martínez Date: Fri, 21 Jan 2022 14:57:39 +0000 (+0100) Subject: mgr/dashboard: cephadm e2e job: display info on error & other improvements X-Git-Tag: v16.2.8~200^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1cf00521d453b74d20f307197dcee2648ded807f;p=ceph.git 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 (cherry picked from commit 39af61efb24dac6f41ba0752944882d35ad287db) --- diff --git a/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh b/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh index 80ee2e5926b22..bcb70acaf7b81 100755 --- a/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh +++ b/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh @@ -16,9 +16,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 %} diff --git a/src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml b/src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml index bdd84b7f1cdb3..5d9f0723d58d4 100755 --- a/src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml +++ b/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 @@ -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 }}] diff --git a/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh b/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh index b7e1a9875f57f..2da13af55fc21 100755 --- a/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh +++ b/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -ex +set -eEx cleanup() { set +x @@ -18,7 +18,7 @@ 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}" @@ -26,7 +26,7 @@ on_error() { 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 @@ -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 diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts index 02b61167de3bb..a8d4b8768ceda 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts @@ -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); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts index 268cf0ad78626..12a2ac8b57d5f 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts @@ -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); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts index 531a31b339d30..8a0d7ccf45ab6 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts @@ -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(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/08-hosts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/08-hosts.e2e-spec.ts index 942321542b899..20fbeaf90f80a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/08-hosts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/08-hosts.e2e-spec.ts @@ -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();