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

[WIP] mgr/dashboard_v2: Add RGW user and bucket lists (read-only) #146

Closed
wants to merge 164 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
f765359
mgr/dashboard_v2: Initial commit of the dashboard_v2 Manager module
LenzGr Jan 22, 2018
76660e9
mgr/dashboard_v2: Make host and port configurable.
votdev Jan 23, 2018
227e4c0
mgr/dashboard_v2: ceph_module mock to support unit testing
rjfd Feb 27, 2018
72815cd
mgr/dashboard_v2: added first unit test example
rjfd Feb 27, 2018
d4a5bf6
mgr/dashboard_v2: updated READMED with unit testing info
rjfd Jan 23, 2018
d3ba3aa
mgr/dashboard_v2: Fix cherrypy shutdown handler
rjfd Jan 23, 2018
93f4ce5
mgr/dashboard_v2: Add command to create/update username/password.
votdev Jan 23, 2018
a679c86
mgr/dashboard_v2: Create proper text editor config files to maintain …
votdev Jan 23, 2018
4b786b4
mgr/dashboard_v2: Auth API
ricardoasmarques Jan 23, 2018
6974833
mgr/dashboard_v2: Added pylint support and fixed linting errors
rjfd Feb 27, 2018
145db7d
mgr/dashboard_v2: Added `RESTResource` Python class.
sebastian-philipp Jan 24, 2018
1118f23
mgr/dashboard_v2: added tox conf file to run unit tests and linting
rjfd Feb 27, 2018
3713f35
mgr/dashboard_v2: Fix python 2/3 compability problems
rjfd Jan 24, 2018
dfa2913
mgr/dashboard_v2: Updated README
Jan 24, 2018
16bf739
mgr/dashboard_v2: Log script_name on unauthorized access
votdev Jan 25, 2018
ee9fecb
mgr/dashboard_v2: Added test_restresource.py
sebastian-philipp Jan 25, 2018
e841275
mgr/dashboard_v2: use float values when checking session expire time
sebastian-philipp Jan 25, 2018
8df6816
mgr/dashboard_v2: Ignore the __pycache__ directory.
votdev Jan 25, 2018
a7a7013
mgr/dashboard_v2: pass json body keys as args to REST resource methods
rjfd Jan 24, 2018
e96dce3
mgr/dashboard_v2: auth module refactoring
rjfd Jan 25, 2018
5bcca3f
mgr/dashboard_v2: Very simple ping example
rjfd Jan 25, 2018
f9f9876
mgr/dashboard_v2: Added developer notes to README
rjfd Jan 25, 2018
9c7a947
mgr/dashboard_v2: Renamed/moved RESTResource to RESTController
rjfd Jan 25, 2018
e97ed65
mgr/dashboard_v2: add initial frontend code
Jan 22, 2018
816ae8a
mgr/dashboard_v2: Added RESTController test case
sebastian-philipp Jan 25, 2018
9ea0a7d
mgr/dashboard_v2: Refactoring of unit tests
rjfd Jan 25, 2018
001e50e
mgr/dashboard_v2: Fix pylint executor and warnings/errors
rjfd Jan 25, 2018
24fe5dc
mgr/dashboard_v2: Combine coverage and tests results from py27 and py3
rjfd Jan 26, 2018
92cf70f
mgr/dashboard_v2: Add frontend login/logout
ricardoasmarques Jan 25, 2018
02271d0
mgr/dashboard_v2: Rename angular components prefix
ricardoasmarques Jan 26, 2018
9252821
mgr/dashboard_v2: Unit tests refactoring
rjfd Jan 26, 2018
85faff7
mgr/dashboard_v2: Moved set-login-cred command logic to Auth class
rjfd Jan 26, 2018
d2eed2f
mgr/dashboard_v2: Added unit test for module.py
rjfd Jan 26, 2018
3b757c0
mgr/dashboard_v2: .gitignore update
rjfd Jan 26, 2018
e698326
mgr/dashboard_v2: add support for frontend CI coverage and unit testing
rjfd Jan 26, 2018
938f208
mgr/dashboard_v2: fix pycodestyle to exclude the frontend files
rjfd Jan 26, 2018
b3da36e
mgr/dashboard_v2: several code style enhancements
votdev Jan 26, 2018
e6dad32
mgr/dashboard_v2: Disable CherryPi autoreload feature.
votdev Jan 26, 2018
2338df2
mgr/dashboard_v2: removed auth handler form test_auth.py setup
rjfd Jan 29, 2018
b798314
mgr/dashboard_v2: simplify router and fix navigation
Jan 29, 2018
100dad2
mgr/dashboard_v2: Refactoring of the access to mgr module instance
rjfd Jan 29, 2018
2c206a8
mgr/dashboard_v2: Updated README with more developer notes
rjfd Jan 29, 2018
9cbb98d
mgr/dashboard_v2: Added API controller listing endpoint.
sebastian-philipp Jan 30, 2018
cd831c6
mgr/dashboard_v2: Refactor controller base class
votdev Jan 30, 2018
3dbede4
mgr/dashboard_v2: Fix bug in AuthRequired decorator
rjfd Jan 30, 2018
78633bb
mgr/dashboard_v2: Add hosts page
ricardoasmarques Jan 27, 2018
27ec09d
mgr/dashboard_v2: Fix typo on method isLoginActive
ricardoasmarques Jan 30, 2018
0bd2a57
mgr/dashboard_v2: Rename "host" module to "cluster"
ricardoasmarques Jan 30, 2018
3fdd2f9
mgr/dashboard_v2: Added status route to cluster
sebastian-philipp Jan 30, 2018
5c04dc3
mgr/dashboard_v2: Fix content type of JSON responses
Jan 25, 2018
b35f2b1
mgr/dashboard_v2: Fix content type (body) of error page
Jan 26, 2018
316a9d4
mgr/dashboard_v2: Session expire at browser close
votdev Jan 27, 2018
4c1bb68
mgr/dashboard_v2: Don't use localized config for auth
ricardoasmarques Jan 30, 2018
a65851b
mgr/dashboard_v2: Refactored logging
sebastian-philipp Jan 31, 2018
fb0a7a9
mgr/dashboard_v2: Use Awesome Bootstrap Checkbox.
votdev Jan 31, 2018
6215ec7
mgr/dashboard_v2: Mark text with the i18n attribute
votdev Feb 1, 2018
ddfd929
mgr/dashboard_v2: Fix linting errors
sebastian-philipp Feb 1, 2018
a8cc797
mgr/dashboard_v2: Notification queue
rjfd Jan 31, 2018
9c3f918
mgr/dashboard_v2: Updated README with notification queue instructions
rjfd Feb 1, 2018
b9b401b
mgr/dashboard_v2: mocking of rados and rbd modules
rjfd Feb 2, 2018
ea9b35b
mgr/dashboard_v2: Move hosts option to cluster menu
ricardoasmarques Feb 2, 2018
11a0bfd
mgr/dashboard_v2: Add breadcrumb on Hosts page
ricardoasmarques Feb 2, 2018
3015956
mgr/dashboard_v2: Updated README with instruction on how to mock ceph…
rjfd Feb 5, 2018
5b4a8d7
mgr/dashboard_v2: Add table component
Feb 1, 2018
10493ca
mgr/dashboard_v2: add missing codealizer recommended rules
Feb 3, 2018
f9041cb
mgr/dashboard_v2: add tslint import linting rule
Feb 4, 2018
e2137b7
mgr/dashboard_v2: add some eslint rules to tslint
Feb 4, 2018
d3d2651
mgr/dashboard_v2: add tslint no-consecutive-blank-lines rule
Feb 4, 2018
80d3af4
mgr/dashboard_v2: decrease max-line-length to 100
Feb 6, 2018
d161422
mgr/dashboard_v2: add style guide to the frontend README
Feb 5, 2018
598c01c
mgr/dashboard_v2: force whitespace in imports list
Feb 6, 2018
04c7b07
mgr/dashboard_v2: Migrate RGW daemon REST resource
p-se Feb 5, 2018
c1302bb
mgr/dashboard_v2: Added coverage tracking to module code
rjfd Feb 8, 2018
f61b662
mgr/dashboard_v2: add more debug message to tools.py
rjfd Feb 8, 2018
31a7261
mgr/dashboard_v2: removed mock classes, unit tests now run against re…
rjfd Feb 8, 2018
d7488a0
mgr/dashboard_v2: Fix copy-webpack-plugin version
rjfd Feb 8, 2018
97a4949
mgr/dashboard_v2: clean rados connection on shutdown
rjfd Feb 6, 2018
c08541d
mgr/dashboard_v2: adaptation of dashboard RemoteViewCache as a decorator
rjfd Feb 6, 2018
3835e76
mgr/dashboard_v2: add health page and its dependencies
Feb 1, 2018
fa0241e
mgr/dashboard_v2: Add block pools page
ricardoasmarques Jan 31, 2018
fdfb2ae
mgr/dashboard_v2: table component style improvements
ricardoasmarques Feb 6, 2018
b090220
mgr/dashboard_v2: Let the pagination input field look nicer
votdev Feb 7, 2018
0f1b2cb
mgr/dashboard_v2: Add cdPasswordButton directive
votdev Feb 6, 2018
7981434
mgr/dashboard_v2: Add support for nested controllers
p-se Feb 7, 2018
8e8b0dd
mgr/dashboard_v2: Fix linting errors
Feb 9, 2018
43d2473
mgr/dashboard_v2: Use datatable on Cluster/Hosts page.
votdev Feb 8, 2018
c566508
mgr/dashboard_v2: fix frontend bug in table.component.hml
rjfd Feb 13, 2018
75afa17
mgr/dashboard_v2: Easy table cell transformation
Feb 12, 2018
4d88ae2
mgr/dashboard_v2: Update documentation
Feb 10, 2018
edbffd6
mgr/dashboard_v2: Add RGW page.
votdev Feb 5, 2018
7d315ef
mgr/dashboard_v2: Highlight clickable datatable rows.
votdev Feb 14, 2018
bc2a5fd
mgr/dashboard_v2: add node as a local dependency
Feb 13, 2018
82971bb
mgr/dashboard_v2: fix visibility of frontend class properties
rjfd Feb 14, 2018
f10076b
mgr/dashboard_v2: add view cache component
Feb 9, 2018
7860b5a
mgr/dashboard_v2: adapt pool detail with cache view component
Feb 9, 2018
8edea05
mgr/dashboard_v2: Updated README.rst, added HACKING.rst
Feb 15, 2018
505486d
mgr/dashboard_v2: Migrate standby module
p-se Feb 14, 2018
1d18a0a
mgr/dashboard_v2: add performance counter page
Feb 14, 2018
891f0bd
mgr/dashboard_v2: move datatable module
Feb 14, 2018
c84395e
mgr/dashboard_v2: add sparkline component
Feb 14, 2018
0d7fcae
mgr/dashboard_v2: add router link table template
Feb 14, 2018
f0b39c9
mgr/dashboard_v2: add monitors page
Feb 14, 2018
8f56744
mgr/dashboard_v2: Renamed `block_pool` controller to `rbd`
sebastian-philipp Feb 15, 2018
d50cba3
mgr/dashboard_v2: add 404 page
Feb 9, 2018
1d7d0e2
mgr/dashboard_v2: Create links to perf counters
votdev Feb 15, 2018
7afaabf
mgr/dashboard_v2: Add bin dir to PATH
sebastian-philipp Feb 13, 2018
f547d14
mgr/dashboard_v2: Added tcmu iSCSI controller.
sebastian-philipp Feb 13, 2018
ddac3f6
mgr/dashboard_v2: Add port to `ControllerTestCase.__init__`
sebastian-philipp Feb 13, 2018
dc4e2e1
mgr/dashboard_v2: Datatable related code improvements
votdev Feb 15, 2018
b47f1c4
mgr/dashboard_v2: add filesystem page
Feb 15, 2018
45af960
mgr/dashboard_v2: Use monospace font on logs
ricardoasmarques Feb 19, 2018
8e2f008
mgr/dashboard_v2: Add iSCSI page
ricardoasmarques Feb 16, 2018
1e83325
mgr/dashboard_v2: Migrate cluster configuration
p-se Feb 19, 2018
66a1092
mgr/dashboard_v2: Prevent double click on table refresh
ricardoasmarques Feb 20, 2018
993063d
mgr/dashboard_v2: Auto refresh hosts
ricardoasmarques Feb 20, 2018
a9f9b26
mgr/dashboard_v2: Add footer and header to hosts table
ricardoasmarques Feb 20, 2018
8d2083c
mgr/dashboard_v2: Reorder menu entries
ricardoasmarques Feb 21, 2018
814e342
mgr/dashboard_v2: Improve empty row style
ricardoasmarques Feb 21, 2018
f8c5f6e
mgr/dashboard_v2: Fixed capitalization on login page
Feb 21, 2018
964d2cd
mgr/dashboard_v2: Also protect `/api`
sebastian-philipp Feb 21, 2018
5e15435
mgr/dashboard_v2: Data transform in k/v table
Feb 16, 2018
6c3d208
mgr/dashboard_v2: Service class base code
rjfd Feb 21, 2018
03b917e
mgr/dashboard_v2: added CephService service class
rjfd Feb 21, 2018
232709e
mgr/dashboard_v2: get rbd pool list using CephService
rjfd Feb 21, 2018
3ffe3b6
mgr/dashboard_v2: get tcmu_runner service list using CephService
rjfd Feb 21, 2018
733dcc9
mgr/dashboard_v2: get rgw service list using CephService
rjfd Feb 21, 2018
c128e74
mgr/dashboard_v2: Add missing i18n attributes
votdev Feb 21, 2018
1b41e6d
mgr/dashboard_v2: Add missing 'aria-current' attribute to active brea…
votdev Feb 22, 2018
8180d39
mgr/dashboard_v2: Fix hosts columns width
ricardoasmarques Feb 21, 2018
e3821f5
make-dist: Added dashboard_v2 frontend build files to dist tarball
rjfd Feb 13, 2018
79a8324
vstart: mgr/dashboard_v2 enabling and configuration
rjfd Feb 13, 2018
bbd348c
mgr/dashboard_v2: fix tox.ini to handle the vstart changes
rjfd Feb 13, 2018
b767b3d
ceph.spec: added dashboard_v2 development and runtime dependencies
rjfd Feb 14, 2018
b72ad9c
debian/control: add dashboard_v2 development dependencies
rjfd Mar 1, 2018
9848eb9
install-deps: install dashboard_v2 development dependencies
rjfd Feb 14, 2018
fe38d17
mgr/dashboard_v2: updated .gitignore
rjfd Feb 14, 2018
3b57db3
mgr/dashboard_v2: add ceph configuration documentation page
Feb 16, 2018
1b5e9ba
mgr/dashboard_v2: Add RBD mirroring functionality
Feb 19, 2018
cf9c9c1
mgr/dashboard_v2: Move `dashboard/toplevel` to a new controller
sebastian-philipp Feb 22, 2018
739e8f6
mgr/dashboard_v2: Fix datatable header layout in configuration doc
votdev Feb 23, 2018
104b7e4
mgr/dashboard_v2: OSD pages
Jan 26, 2018
15e6f00
mgr/dashboard_v2: Add rbd_mirroring to `/api/summary`
sebastian-philipp Feb 23, 2018
fb31447
mgr/dashboard_v2: add mirroring page
Feb 19, 2018
9f043f6
mgr/dashboard_v2: Adapt status datatable to default design of cd-table
votdev Feb 23, 2018
5ac09f9
mgr/dashboard_v2: Updated reference documentation
Feb 23, 2018
af79763
mgr/dashboard_v2: enable rbd-mirror perf counters
Feb 23, 2018
646a19e
mgr/dashboard_v2: Add links on dashboard
ricardoasmarques Feb 19, 2018
7cf97ab
mgr/dashboard_v2: Add support for $PREFIX config
ricardoasmarques Feb 23, 2018
392eccd
mgr/dashboard_v2: Enable table header and footer on perfcounters
Feb 23, 2018
05fd303
mgr/dashboard_v2: Fixed exception in rbd_mirroring
sebastian-philipp Feb 23, 2018
6155633
mgr/dashboard_v2: Auto reload cd-table
Feb 21, 2018
6e8ca1f
mgr/dashboard_v2: Fix OSD menu entry position
Feb 26, 2018
12cf89a
mgr/dashboard_v2: use global manager instance instead of injection
rjfd Feb 26, 2018
fea4d70
mgr/dashboard_v2: Remove `BaseControllerMeta` meta class
p-se Feb 22, 2018
c8323c9
mgr/dashboard_v2: Remove `Service` and `ServiceMeta` class
p-se Feb 27, 2018
c013aca
mgr/dashboard_v2: Integrate dashboard_v2 into `make check`
sebastian-philipp Feb 27, 2018
2ed6c8c
mgr/dashboard_v2: Add CMake target to build the frontend.
sebastian-philipp Feb 28, 2018
80da6e0
mgr/dashboard_v2: Add mgr-dashboard_v2 frontend unittests to `ctest`
sebastian-philipp Feb 28, 2018
5f57f33
mgr/dashboard_v2: Added smoke test.
sebastian-philipp Mar 1, 2018
61f2007
qa/tasks/mgr: move test initialization to setUpClass method
rjfd Feb 28, 2018
285857a
qa/tasks/mgr/dashboard_v2: implementation of backend API tests
rjfd Feb 28, 2018
d569058
qa/suites/mgr/dashboard_v2: added suite yaml for testing dashboard_v2
rjfd Feb 28, 2018
e0383bd
mgr/dashboard_v2: added script to run backend API tests locally
rjfd Mar 1, 2018
5bf0e89
mgr/dashboard_v2: Add RGW user and bucket lists (read-only)
votdev Mar 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions ceph.spec.in
Expand Up @@ -221,12 +221,23 @@ BuildRequires: python3-Cython
BuildRequires: python%{_python_buildid}-cherrypy
BuildRequires: python%{_python_buildid}-pecan
BuildRequires: python%{_python_buildid}-werkzeug
BuildRequires: python%{_python_buildid}-tox
BuildRequires: python%{_python_buildid}-coverage
%if 0%{?fedora}
BuildRequires: python%{_python_buildid}-bcrypt
%endif
%if 0%{?rhel}
BuildRequires: py-bcrypt
%endif
%endif
%if 0%{?suse_version}
BuildRequires: python%{_python_buildid}-CherryPy
BuildRequires: python%{_python_buildid}-Werkzeug
BuildRequires: python%{_python_buildid}-pecan
BuildRequires: python%{_python_buildid}-numpy-devel
BuildRequires: python%{_python_buildid}-bcrypt
BuildRequires: python%{_python_buildid}-tox
BuildRequires: python%{_python_buildid}-coverage
%endif
%endif
# lttng and babeltrace for rbd-replay-prep
Expand Down Expand Up @@ -358,13 +369,20 @@ Requires: python%{_python_buildid}-jinja2
Requires: python%{_python_buildid}-pecan
Requires: python%{_python_buildid}-werkzeug
Requires: pyOpenSSL%{_python_buildid}
%if 0%{?fedora}
Requires: python%{_python_buildid}-bcrypt
%endif
%if 0%{?rhel}
Requires: py-bcrypt
%endif
%endif
%if 0%{?suse_version}
Requires: python%{_python_buildid}-CherryPy
Requires: python%{_python_buildid}-Jinja2
Requires: python%{_python_buildid}-Werkzeug
Requires: python%{_python_buildid}-pecan
Requires: python%{_python_buildid}-pyOpenSSL
Requires: python%{_python_buildid}-bcrypt
Recommends: python%{_python_buildid}-influxdb
%endif
%description mgr
Expand Down Expand Up @@ -888,6 +906,7 @@ cmake .. \
-DWITH_EMBEDDED=OFF \
-DWITH_MANPAGE=ON \
-DWITH_PYTHON3=ON \
-DWITH_MGR_DASHBOARD_V2_FRONTEND=OFF \
%if %{with python2}
-DWITH_PYTHON2=ON \
%else
Expand Down
4 changes: 4 additions & 0 deletions debian/control
Expand Up @@ -54,6 +54,9 @@ Build-Depends: bc,
python-jinja2,
python-nose,
python-pecan,
python-bcrypt,
python-tox,
python-coverage,
python-prettytable,
python-setuptools,
python-sphinx,
Expand Down Expand Up @@ -173,6 +176,7 @@ Depends: ceph-base (= ${binary:Version}),
python-cherrypy3,
python-openssl,
python-pecan,
python-bcrypt,
python-werkzeug,
${misc:Depends},
${python:Depends},
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -5,7 +5,7 @@ export DESTDIR=$(CURDIR)/debian/tmp

export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

extraopts += -DUSE_CRYPTOPP=OFF -DWITH_OCF=ON -DWITH_LTTNG=ON -DWITH_PYTHON3=ON -DWITH_EMBEDDED=OFF
extraopts += -DUSE_CRYPTOPP=OFF -DWITH_OCF=ON -DWITH_LTTNG=ON -DWITH_PYTHON3=ON -DWITH_EMBEDDED=OFF -DWITH_MGR_DASHBOARD_V2_FRONTEND=OFF
extraopts += -DWITH_CEPHFS_JAVA=ON
extraopts += -DWITH_SYSTEMD=ON -DCEPH_SYSTEMD_ENV_DIR=/etc/default
# assumes that ceph is exmpt from multiarch support, so we override the libdir.
Expand Down
44 changes: 41 additions & 3 deletions doc/mgr/dashboard.rst
Expand Up @@ -2,7 +2,29 @@ dashboard plugin
================

Dashboard plugin visualizes the statistics of the cluster using a web server
hosted by ``ceph-mgr``.
hosted by ``ceph-mgr``. The dashboard currently provides insight into the
following aspects of your Ceph cluster:

* **Overall cluster health**: The overall cluster status, storage utilization
(e.g. number of objects, raw capacity, usage per pool), a list of pools and
their status and usage statistics, access to the cluster log file.
* **Hosts**: A list of all hosts associated to the cluster, which services
are running and which version of Ceph is installed.
* **Performance counters**: Display detailed statistics for each running service.
* **Monitors**: List of all MONs, their quorum status, open sessions.
* **Configuration Reference**: List all available configuration options, their
description and default values.
* **OSDs**: A list of all OSDs, their status and usage statistics as well as
detailed information like attributes (OSD map), metadata, performance counters
and usage histograms for read/write operations.
* **iSCSI**: List all hosts that run the TCMU runner service, list of all images
and their performance characteristics (read/write ops, traffic).
* **RBD**: List of all RBD images and their properties (size, objects, features)
in a given pool.
* **CephFS**: List all active filesystem clients and associated pools, including
their usage statistics.
* **Object Gateway**: List of all active object gateways and their performance
counters.

Enabling
--------
Expand Down Expand Up @@ -39,6 +61,23 @@ If the port is not configured, the web app will bind to port ``7000``.
If the address it not configured, the web app will bind to ``::``,
which corresponds to all available IPv4 and IPv6 addresses.

In order to be able to log in, you need to define a username and password, which
will be stored in the MON's configuration database::

ceph dashboard set-login-credentials <username> <password>

The password will be stored in the configuration database in encrypted form
using ``bcrypt``. This is a global setting that applies to all dashboard instances.

You can now access the dashboard using your (JavaScript-enabled) web browser, by
pointing it to the selected TCP port and any of the host names or IP addresses
where a manager instance runs on, e.g. ``http://<$IP>:<$PORT>/``.

You should then be greeted by the dashboard login page, requesting your
previously defined username and password. Select the **Keep me logged in**
checkbox if you want to skip the username/password request when accessing the
dashboard in the future.

Reverse proxies
---------------

Expand All @@ -51,5 +90,4 @@ to use hyperlinks that include your prefix, you can set the

ceph config-key set mgr/dashboard/url_prefix $PREFIX

so you can access the dashboard at ``http://$IP:$PORT/$PREFIX/``.

so you can access the dashboard at ``http://$IP:$PORT/$PREFIX/``.
71 changes: 71 additions & 0 deletions install-deps.sh
Expand Up @@ -105,6 +105,72 @@ EOF
fi
}

function ensure_min_npm_version {
local install_npm_pkg_cmd=$1

if ! type npm > /dev/null 2>&1; then
$SUDO $install_npm_pkg_cmd
fi

NODE_VER=`node -v`
NODE_VER_MAJOR=`node -v | sed 's/v\(\w\+\).*/\1/g'`
NODE_VER_MINOR=`node -v | sed 's/v\w\+\.\(\w\+\).*/\1/g'`

# The minimum node version required is 4.8.0 so that we can use yarn below
UPDATE_NODE=false
if [ $NODE_VER_MAJOR -lt 4 ]; then
UPDATE_NODE=true
elif [ $NODE_VER_MAJOR -eq 4 ] && [ $NODE_VER_MINOR -lt 8 ]; then
UPDATE_NODE=true
fi
if $UPDATE_NODE; then
ARCH=`uname -m`
if [ "$ARCH" = "x86_64" ]; then
ARCH="x64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
$SUDO npm install -g n
# installs nodejs version 4.8.0
# we need to explicitly pass the ARCH type because of a bug in the
# n package that fails to detect the system architecture in aarch64
# systems
$SUDO n --arch $ARCH 4.8.0
$SUDO npm uninstall -g n
hash -d node > /dev/null 2>&1 || true
fi

NPM_VER=`npm -v`
NPM_VER_MAJOR=`npm -v | sed 's/\(\w\+\).*/\1/g'`

# The minimum npm version required is 5.0.0 so that we can install and use
# a local nodejs installation (required by the dashboard angular2 frontend)
if [ $NPM_VER_MAJOR -lt 5 ]; then
$SUDO npm install -g yarn
$SUDO yarn global add npm@^5.0.0 # install npm version 5.0.0 or later
fi
hash -d npm > /dev/null 2>&1 || true

NEW_NODE_VER=`node -v`
NEW_NPM_VER=`npm -v`
if [ ! "$NODE_VER" = "$NEW_NODE_VER" ]; then
cat <<EOF
*****************************************************************************
YOUR NODE VERSION WAS UPDATED FROM $NODE_VER TO $NEW_NODE_VER
*****************************************************************************
EOF
fi
if [ ! "$NPM_VER" = "$NEW_NPM_VER" ]; then
cat <<EOF
*****************************************************************************
YOUR NPM VERSION WAS UPDATED FROM $NPM_VER TO $NEW_NPM_VER
TO RETURN TO VERSION $NPM_VER run the following command:
$ $SUDO yarn global remove npm && hash -d npm
*****************************************************************************
EOF
fi
}

if [ x`uname`x = xFreeBSDx ]; then
$SUDO pkg install -yq \
devel/babeltrace \
Expand Down Expand Up @@ -190,6 +256,9 @@ else
$SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool="apt-get -y --no-install-recommends $backports" $control || exit 1
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
if [ -n "$backports" ] ; then rm $control; fi
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs
[ ! -e /usr/bin/node ] && $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs-legacy
ensure_min_npm_version "env DEBIAN_FRONTEND=noninteractive apt-get -y install npm"
;;
centos|fedora|rhel|ol|virtuozzo)
yumdnf="yum"
Expand Down Expand Up @@ -250,13 +319,15 @@ else
ensure_decent_gcc_on_rh $dts_ver
fi
! grep -q -i error: $DIR/yum-builddep.out || exit 1
ensure_min_npm_version "$yumdnf install -y npm"
;;
opensuse|suse|sles)
echo "Using zypper to install dependencies"
zypp_install="zypper --gpg-auto-import-keys --non-interactive install --no-recommends"
$SUDO $zypp_install lsb-release systemd-rpm-macros
munge_ceph_spec_in $DIR/ceph.spec
$SUDO $zypp_install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
ensure_min_npm_version "zypper --non-interactive install npm"
;;
alpine)
# for now we need the testing repo for leveldb
Expand Down
11 changes: 11 additions & 0 deletions make-dist
Expand Up @@ -61,6 +61,15 @@ download_boost() {
rm -rf src/boost
}

build_dashboard_frontend() {
CURR_DIR=`pwd`
cd src/pybind/mgr/dashboard_v2/frontend
npm install
npm run build -- --prod
cd $CURR_DIR
tar cf dashboard_frontend.tar $outfile/src/pybind/mgr/dashboard_v2/frontend/dist
}

# clean out old cruft...
echo "cleanup..."
rm -f $outfile*
Expand Down Expand Up @@ -113,9 +122,11 @@ download_boost $boost_version b2dfbd6c717be4a7bb2d88018eaccf75 \
https://dl.bintray.com/boostorg/release/$boost_version/source \
https://downloads.sourceforge.net/project/boost/boost/$boost_version \
https://download.ceph.com/qa
build_dashboard_frontend
tar --concatenate -f $outfile.all.tar $outfile.version.tar
tar --concatenate -f $outfile.all.tar $outfile.boost.tar
tar --concatenate -f $outfile.all.tar $outfile.tar
tar --concatenate -f $outfile.all.tar dashboard_frontend.tar
mv $outfile.all.tar $outfile.tar
rm $outfile
rm -f $outfile.version.tar
Expand Down
33 changes: 33 additions & 0 deletions qa/suites/rados/mgr/tasks/dashboard_v2.yaml
@@ -0,0 +1,33 @@

tasks:
- install:
- ceph:
# tests may leave mgrs broken, so don't try and call into them
# to invoke e.g. pg dump during teardown.
wait-for-scrub: false
log-whitelist:
- overall HEALTH_
- \(MGR_DOWN\)
- \(PG_
- replacing it with standby
- No standby daemons available
- \(FS_DEGRADED\)
- \(MDS_FAILED\)
- \(MDS_DEGRADED\)
- \(FS_WITH_FAILED_MDS\)
- \(MDS_DAMAGE\)
- rgw: [client.0]
- cephfs_test_runner:
modules:
- tasks.mgr.test_dashboard_v2
- tasks.mgr.dashboard_v2.test_auth
- tasks.mgr.dashboard_v2.test_cephfs
- tasks.mgr.dashboard_v2.test_cluster_configuration
- tasks.mgr.dashboard_v2.test_dashboard
- tasks.mgr.dashboard_v2.test_host
- tasks.mgr.dashboard_v2.test_monitor
- tasks.mgr.dashboard_v2.test_osd
- tasks.mgr.dashboard_v2.test_perf_counters
- tasks.mgr.dashboard_v2.test_summary
- tasks.mgr.dashboard_v2.test_rgw
- tasks.mgr.dashboard_v2.test_rbd
3 changes: 2 additions & 1 deletion qa/tasks/ceph_test_case.py
Expand Up @@ -132,7 +132,8 @@ def wait_until_equal(self, get_fn, expect_val, timeout, reject_fn=None):

log.debug("wait_until_equal: success")

def wait_until_true(self, condition, timeout):
@classmethod
def wait_until_true(cls, condition, timeout):
period = 5
elapsed = 0
while True:
Expand Down
Empty file.