From 70c26cfb441cd46834a73995b3c6d98358e77b52 Mon Sep 17 00:00:00 2001 From: Devika Babrekar Date: Thu, 4 Dec 2025 15:28:39 +0530 Subject: [PATCH] mgr/dashboard: Adding QAT Compression dropdown on RGW Service form Fixes:https://tracker.ceph.com/issues/74046 Signed-off-by: Devika Babrekar --- PendingReleaseNotes | 2 ++ .../src/app/ceph/cluster/cluster.module.ts | 6 +++-- .../service-form/service-form.component.html | 18 +++++++++++++++ .../service-form.component.spec.ts | 17 ++++++++++++++ .../service-form/service-form.component.ts | 23 ++++++++++++++++--- .../app/shared/models/service.interface.ts | 11 +++++++++ 6 files changed, 72 insertions(+), 5 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index f056f8e8c61c..7648457d3d3c 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -8,6 +8,8 @@ * DASHBOARD: Removed the older landing page which was deprecated in Quincy. Admins can no longer enable the older, deprecated landing page layout by adjusting FEATURE_TOGGLE_DASHBOARD. +* DASHBOARD: RGW Service form updated to take input regarding QAT compression. + - QAT compression is an optional field which can be set to 'Hardware' or 'Software' by selecting options from provided dropdwon. If 'None' is selected, compression is removed altogether. * CephFS: The `peer_add` command is deprecated in favor of the `peer_bootstrap` command. >=20.0.0 diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts index 75d1fa15155e..d5c73717eba2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts @@ -17,7 +17,8 @@ import { ToggletipModule, IconModule, IconService, - TagModule + TagModule, + SelectModule } from 'carbon-components-angular'; import Analytics from '@carbon/icons/es/analytics/16'; import CloseFilled from '@carbon/icons/es/close--filled/16'; @@ -119,7 +120,8 @@ import { TextLabelListComponent } from '~/app/shared/components/text-label-list/ ToggletipModule, IconModule, TagModule, - TextLabelListComponent + TextLabelListComponent, + SelectModule ], declarations: [ MonitorComponent, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html index 4625f2850259..cdcb637551f7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html @@ -1203,6 +1203,24 @@ + + + @if(serviceForm.controls.service_type.value === 'rgw') { +
+ + + +
+ } +
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts index b7aaea30aca2..33fdca70b6d1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts @@ -17,6 +17,7 @@ import { configureTestBed, FormHelper, Mocks } from '~/testing/unit-test-helper' import { ServiceFormComponent } from './service-form.component'; import { PoolService } from '~/app/shared/api/pool.service'; import { USER } from '~/app/shared/constants/app.constants'; +import { SelectModule } from 'carbon-components-angular'; // for 'nvmeof' service const mockPools = [ @@ -46,6 +47,7 @@ describe('ServiceFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, + SelectModule, ToastrModule.forRoot() ] }); @@ -293,6 +295,21 @@ describe('ServiceFormComponent', () => { expect(ssl_key).toBeNull(); }); + it('should submit rgw with QAT Compression (None)', () => { + formHelper.setValue('service_type', 'rgw'); + formHelper.setValue(component.serviceForm.get('qat').get('compression'), 'none'); + }); + + it('should submit rgw with QAT Compression (Hardware)', () => { + formHelper.setValue('service_type', 'rgw'); + formHelper.setValue(component.serviceForm.get('qat')?.get('compression'), 'hw'); + }); + + it('should submit rgw with QAT Compression (Software)', () => { + formHelper.setValue('service_type', 'rgw'); + formHelper.setValue(component.serviceForm.get('qat')?.get('compression'), 'sw'); + }); + it('should test .pem file', () => { const pemCert = ` -----BEGIN CERTIFICATE----- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts index ceca70914dc3..181101538d2b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts @@ -35,7 +35,7 @@ import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { CdValidators } from '~/app/shared/forms/cd-validators'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { Host } from '~/app/shared/models/host.interface'; -import { CephServiceSpec } from '~/app/shared/models/service.interface'; +import { CephServiceSpec, QatOptions, QatSepcs } from '~/app/shared/models/service.interface'; import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { TimerService } from '~/app/shared/services/timer.service'; @@ -106,6 +106,11 @@ export class ServiceFormComponent extends CdForm implements OnInit { selected: false })); showMgmtGatewayMessage: boolean = false; + qatCompressionOptions = [ + { value: QatOptions.hw, label: 'Hardware' }, + { value: QatOptions.sw, label: 'Software' }, + { value: QatOptions.none, label: 'None' } + ]; constructor( public actionLabels: ActionLabelsI18n, @@ -283,6 +288,9 @@ export class ServiceFormComponent extends CdForm implements OnInit { realm_name: [null], zonegroup_name: [null], zone_name: [null], + qat: new CdFormGroup({ + compression: new UntypedFormControl(QatOptions.none) + }), // iSCSI trusted_ip_list: [null], api_port: [null, [CdValidators.number(false)]], @@ -709,7 +717,8 @@ export class ServiceFormComponent extends CdForm implements OnInit { this.setRgwFields( response[0].spec?.rgw_realm, response[0].spec?.rgw_zonegroup, - response[0].spec?.rgw_zone + response[0].spec?.rgw_zone, + response[0].spec?.qat ); this.serviceForm.get('ssl').setValue(response[0].spec?.ssl); if (response[0].spec?.ssl) { @@ -944,7 +953,7 @@ export class ServiceFormComponent extends CdForm implements OnInit { } } - setRgwFields(realm_name?: string, zonegroup_name?: string, zone_name?: string) { + setRgwFields(realm_name?: string, zonegroup_name?: string, zone_name?: string, qat?: QatSepcs) { const observables = [ this.rgwRealmService.getAllRealmsInfo(), this.rgwZonegroupService.getAllZonegroupsInfo(), @@ -1012,6 +1021,9 @@ export class ServiceFormComponent extends CdForm implements OnInit { this.serviceForm.get('zonegroup_name').setValue(zonegroup_name); this.serviceForm.get('zone_name').setValue(zone_name); } + if (qat) { + this.serviceForm.get(`qat.compression`)?.setValue(qat['compression']); + } if (this.realmList.length === 0) { this.showRealmCreationForm = true; } else { @@ -1162,6 +1174,11 @@ export class ServiceFormComponent extends CdForm implements OnInit { serviceSpec['rgw_zonegroup'] = values['zonegroup_name'] !== 'default' ? values['zonegroup_name'] : null; serviceSpec['rgw_zone'] = values['zone_name'] !== 'default' ? values['zone_name'] : null; + if (values['qat']['compression'] && values['qat']['compression'] != QatOptions.none) { + serviceSpec['qat'] = values['qat']; + } else if (values['qat']['compression'] == QatOptions.none) { + delete serviceSpec['qat']; + } } const serviceId: string = values['service_id']; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts index 966774a05a2c..c79a9cb4e74a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts @@ -62,6 +62,7 @@ export interface CephServiceAdditionalSpec { client_secret: string; oidc_issuer_url: string; enable_auth: boolean; + qat: QatSepcs; } export interface CephServicePlacement { @@ -70,3 +71,13 @@ export interface CephServicePlacement { hosts?: string[]; label?: string | string[]; } + +export interface QatSepcs { + [key: string]: string; +} + +export enum QatOptions { + hw = 'hw', + sw = 'sw', + none = 'none' +} -- 2.47.3