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

mgr/dashboard: add Feature Toggles #26102

Merged
merged 11 commits into from Feb 11, 2019
Merged

Conversation

epuertat
Copy link
Member

@epuertat epuertat commented Jan 23, 2019

This PR brings to Ceph Dashboard back-end support for Feature Toggles (aka Feature Flags, Switches, etc.), which will allow an Admin to disable specific features (e.g.: RBD iSCSI, CephFS, etc). Features may be enabled/disabled live, with no need of reloading Ceph Dashboard.

An alternative implementation has been proposed in #25665

For implementing this feature a new Plugin based architecture has been introduced into Ceph-Dashboard back-end.

Command-line usage:

# ceph dashboard feature status
Feature 'cephfs': 'enabled'
Feature 'images': 'enabled'
Feature 'iscsi': 'enabled'
Feature 'mirroring': 'enabled'
Feature 'rgw': 'disabled'

# ceph dashboard feature disable mirroring iscsi
Feature 'mirroring': disabled
Feature 'iscsi': disabled

This PR also bring minor fixes related to module options.

Fixes: http://tracker.ceph.com/issues/37530

Signed-off-by: Ernesto Puerta epuertat@redhat.com

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@epuertat epuertat added this to the nautilus milestone Jan 23, 2019
@epuertat epuertat self-assigned this Jan 23, 2019
@epuertat epuertat force-pushed the wip-featuretoggles branch 6 times, most recently from 4cda79a to d7c9bc9 Compare January 25, 2019 12:39
@epuertat epuertat force-pushed the wip-featuretoggles branch 5 times, most recently from 28cc8af to db19bcc Compare February 4, 2019 09:34
@epuertat epuertat force-pushed the wip-featuretoggles branch 4 times, most recently from 212d5d9 to b810521 Compare February 4, 2019 17:26
@epuertat epuertat added needs-review and removed DNM labels Feb 4, 2019
@epuertat epuertat changed the title [DNM] mgr/dashboard: add Feature Toggles [plugin-based implementation] mgr/dashboard: add Feature Toggles [plugin-based implementation] Feb 4, 2019
@epuertat epuertat changed the title mgr/dashboard: add Feature Toggles [plugin-based implementation] mgr/dashboard: add Feature Toggles Feb 4, 2019
A new helper class `Options` has been added to ease adding new
MODULE_OPTIONS.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Provide plugin infrastructure and a minimal set of hooks. As
python-pluggy library is not yet available for all the distros that Ceph
is targeted at, a minimal implementation has been provided.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Add feature-toggles plugin. It allows to enable, disable and check
status of a feature. Features are disabled by making their
corresponding enpoints return HTTP 501 error (Not Implemented).

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Provide a hook for creating REST controllers and endpoints. Provide also
a REST controller for Feature Toggles plugin.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Add front-end behaviours to feature toggles:
- In navigation pane, drop-down menu items are displayed/hidden accordingly.
- In main dashboard page, info cards are displayed/hidded.
- Routes are also enabled/disabled. When disabled, they redirect to 404.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
@epuertat epuertat force-pushed the wip-featuretoggles branch 2 times, most recently from ef71af1 to 5be299e Compare February 7, 2019 10:47
@epuertat
Copy link
Member Author

epuertat commented Feb 8, 2019

Teuthology run: 3/4 passed

failure: Test failure: setUpClass (tasks.mgr.dashboard.test_erasure_code_profile.ECPTest)

Copy link
Contributor

@p-se p-se left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jenkins render docs please

src/pybind/mgr/dashboard/HACKING.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@p-se p-se left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

src/pybind/mgr/dashboard/plugins/feature_toggles.py Outdated Show resolved Hide resolved
Add python unit test for feature toggles plugin, and refactor other
files, and add a new type of function cache decorator based on LRU but
with a TTL.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Fix front-end formatting as suggested by tspmelo

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Add '*.inc.rst' to the list of excluded patterns from sphinx-build. This
allows for using '*.inc.rst' as includes, and avoids duplicates. The
benefit of keeping the trailing '.rst' extension is that most IDEs use
that to render reStructured Text files.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
@epuertat
Copy link
Member Author

Teuthology run: 100% Passed [4/4]

Copy link
Member

@s0nea s0nea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I tested it locally

@tspmelo tspmelo dismissed their stale review February 11, 2019 14:33

Requested changes have been resolved.

@LenzGr LenzGr merged commit 4431d6d into ceph:master Feb 11, 2019
@epuertat epuertat deleted the wip-featuretoggles branch February 11, 2019 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants