From: Alfonso Martínez Date: Mon, 9 Aug 2021 13:14:21 +0000 (+0200) Subject: mgr/dashboard: cephadm e2e start script: add --expanded option X-Git-Tag: v15.2.15~53^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0be3ff88224b5b59fd57962aea60859176b03fa;p=ceph.git mgr/dashboard: cephadm e2e start script: add --expanded option - Additional improvements: clean npm cache in jenkins env.; display mgr logs on error. Fixes: https://tracker.ceph.com/issues/52082 Signed-off-by: Alfonso Martínez (cherry picked from commit 973a6f534383e84bd92b690eaf2862a5a30ba70c) Conflicts: doc/dev/developer_guide/dash-devel.rst - Add changes to HACKING.rst (dash-devel.rst not in octopus) --- diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index b50182c85ef..c414e430245 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -184,7 +184,7 @@ Note: permissions. run-cephadm-e2e-tests.sh -........................ +......................... ``run-cephadm-e2e-tests.sh`` runs a subset of E2E tests to verify that the Dashboard and cephadm as Orchestrator backend behave correctly. @@ -208,14 +208,24 @@ Start E2E tests by running:: $ cd $ sudo chown -R $(id -un) src/pybind/mgr/dashboard/frontend/{dist,node_modules,src/environments} $ ./src/pybind/mgr/dashboard/ci/cephadm/run-cephadm-e2e-tests.sh - $ kcli delete plan -y ceph # After tests finish. -You can also start a cluster in development mode and later run E2E tests by running:: +You can also start a cluster in development mode (so the frontend build starts in watch mode and you +only have to reload the page for the changes to be reflected) by running:: $ ./src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh --dev-mode - $ # Work on your feature, bug fix, ... + +Note: + Add ``--expanded`` if you need a cluster ready to deploy services (one with enough monitor + daemons spread across different hosts and enough OSDs). + +Test your changes by running: + $ ./src/pybind/mgr/dashboard/ci/cephadm/run-cephadm-e2e-tests.sh - $ # Remember to kill the npm build watch process i.e.: pkill -f "ng build" + +Shutdown the cluster by running: + + $ kcli delete plan -y ceph + $ # In development mode, also kill the npm build watch process (e.g., pkill -f "ng build") Other running options ..................... diff --git a/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh b/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh index af7ef81f43f..4bad63bc597 100755 --- a/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh +++ b/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh @@ -10,6 +10,15 @@ mon_ip=$(ifconfig eth0 | grep 'inet ' | awk '{ print $2}') cephadm bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --allow-fqdn-hostname --dashboard-password-noupdate --shared_ceph_folder /mnt/{{ ceph_dev_folder }} +fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}') + {% for number in range(1, nodes) %} ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}.{{ domain }} + {% if expanded_cluster is defined %} + cephadm shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch host add {{ prefix }}-node-0{{ number }}.{{ domain }} + {% endif %} {% endfor %} + +{% if expanded_cluster is defined %} + cephadm shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch apply osd --all-available-devices +{% endif %} diff --git a/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh b/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh index 61775d0bac4..68c49bb1142 100755 --- a/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh +++ b/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh @@ -17,6 +17,8 @@ on_error() { if [ "$1" != "0" ]; then 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)' for vm_id in 0 1 2 do local vm="ceph-node-0${vm_id}" @@ -42,7 +44,8 @@ DEV_MODE='' for arg in "$@"; do shift case "$arg" in - "--dev-mode") DEV_MODE='true'; EXTRA_PARAMS="-P dev_mode=${DEV_MODE}" ;; + "--dev-mode") DEV_MODE='true'; EXTRA_PARAMS+=" -P dev_mode=${DEV_MODE}" ;; + "--expanded") EXTRA_PARAMS+=" -P expanded_cluster=true" ;; esac done @@ -50,7 +53,11 @@ kcli delete plan -y ceph || true # Build dashboard frontend (required to start the module). cd ${CEPH_DEV_FOLDER}/src/pybind/mgr/dashboard/frontend -NG_CLI_ANALYTICS=false npm ci +export NG_CLI_ANALYTICS=false +if [[ -n "$JENKINS_HOME" ]]; then + npm cache clean --force +fi +npm ci FRONTEND_BUILD_OPTS='-- --prod' if [[ -n "${DEV_MODE}" ]]; then FRONTEND_BUILD_OPTS+=' --deleteOutputPath=false --watch'