Skip to content

Commit

Permalink
mgr/dashboard: Add clay plugin support
Browse files Browse the repository at this point in the history
The erasure code plugin "clay" is now supported by the dashboard. Now a
clay based profile can be created in the ec profile creation modal
dialog which can be found in the pool form.

The defaults of the plugin are calculated or preselected and shown in the
dashboard, therefore things are made mandatory even if they are not on the
cli, but as they automatically set the user doesn't have to set them,
but sees the defaults instantly before creating the profile.
(This is the same behavior that is used for all other supported
plugins.)

Fixes: https://tracker.ceph.com/issues/44433
Signed-off-by: Stephan Müller <smueller@suse.com>
  • Loading branch information
Stephan Müller committed Sep 29, 2020
1 parent 5865352 commit b3fd05b
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 49 deletions.
2 changes: 1 addition & 1 deletion doc/rados/operations/erasure-code-clay.rst
Expand Up @@ -88,7 +88,7 @@ Where:

:Description: Number of OSDs requested to send data during recovery of
a single chunk. *d* needs to be chosen such that
k+1 <= d <= k+m-1. Larger the *d*, the better the savings.
k+1 <= d <= k+m-1. The larger the *d*, the better the savings.

:Type: Integer
:Required: No.
Expand Down
4 changes: 2 additions & 2 deletions src/pybind/mgr/dashboard/controllers/erasure_code_profile.py
Expand Up @@ -58,8 +58,8 @@ def info(self):
"""
config = mgr.get('config')
return {
# Because 'shec' is experimental it's not included
'plugins': config['osd_erasure_code_plugins'].split() + ['shec'],
# Because 'shec' and 'clay' are experimental they're not included
'plugins': config['osd_erasure_code_plugins'].split() + ['shec', 'clay'],
'directory': config['erasure_code_dir'],
'nodes': mgr.get('osd_map_tree')['nodes'],
'names': [name for name, _ in
Expand Down
Expand Up @@ -147,6 +147,56 @@
</div>
</div>

<div class="form-group row"
*ngIf="plugin === 'clay'">
<label for="d"
class="cd-col-form-label">
<span class="required"
i18n>Helper chunks (d)</span>
<cd-helper [html]="tooltips.plugins.clay.d">
</cd-helper>
</label>
<div class="cd-col-form-input">
<div class="input-group">
<input type="number"
id="d"
name="d"
class="form-control"
placeholder="Helper chunks..."
formControlName="d">
<span class="input-group-append">
<button class="btn btn-light"
id="d-calc-btn"
ngbTooltip="Set d manually or use the plugin's default calculation that maximizes d."
i18n-ngbTooltip
type="button"
(click)="toggleDCalc()">
<i [ngClass]="dCalc ? icons.unlock : icons.lock"
aria-hidden="true"></i>
</button>
</span>
</div>
<span class="form-text text-muted"
*ngIf="dCalc"
i18n>D is automatically updated on k and m changes</span>
<ng-container
*ngIf="!dCalc">
<span class="form-text text-muted"
*ngIf="getDMin() < getDMax()"
i18n>D can be set from {{getDMin()}} to {{getDMax()}}</span>
<span class="form-text text-muted"
*ngIf="getDMin() === getDMax()"
i18n>D can only be set to {{getDMax()}}</span>
</ng-container>
<span class="invalid-feedback"
*ngIf="form.showError('d', frm, 'dMin')"
i18n>D has to be greater than k ({{getDMin()}}).</span>
<span class="invalid-feedback"
*ngIf="form.showError('d', frm, 'dMax')"
i18n>D has to be lower than k + m ({{getDMax()}}).</span>
</div>
</div>

<div class="form-group row"
*ngIf="plugin === PLUGIN.LRC">
<label class="cd-col-form-label"
Expand Down Expand Up @@ -228,7 +278,28 @@
</div>

<div class="form-group row"
*ngIf="[PLUGIN.JERASURE, PLUGIN.ISA].includes(plugin)">
*ngIf="PLUGIN.CLAY === plugin">
<label for="scalar_mds"
class="cd-col-form-label">
<ng-container i18n>Scalar mds</ng-container>
<cd-helper [html]="tooltips.plugins.clay.scalar_mds">
</cd-helper>
</label>
<div class="cd-col-form-input">
<select class="form-control custom-select"
id="scalar_mds"
name="scalar_mds"
formControlName="scalar_mds">
<option *ngFor="let plugin of [PLUGIN.JERASURE, PLUGIN.ISA, PLUGIN.SHEC]"
[ngValue]="plugin">
{{ plugin }}
</option>
</select>
</div>
</div>

<div class="form-group row"
*ngIf="[PLUGIN.JERASURE, PLUGIN.ISA, PLUGIN.CLAY].includes(plugin)">
<label for="technique"
class="cd-col-form-label">
<ng-container i18n>Technique</ng-container>
Expand Down

0 comments on commit b3fd05b

Please sign in to comment.