From: Devika Babrekar Date: Thu, 4 Dec 2025 09:58:39 +0000 (+0530) Subject: mgr/dashboard: Adding QAT Compression dropdown on RGW Service form X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=853d132bbbb43f54c851cb3d041bab9f98d83a6a;p=ceph.git mgr/dashboard: Adding QAT Compression dropdown on RGW Service form Fixes:https://tracker.ceph.com/issues/74046 Signed-off-by: Devika Babrekar (cherry picked from commit 70c26cfb441cd46834a73995b3c6d98358e77b52) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts - Removed extra modules which were not the part of tentacle branch src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts - Removed USER interface import which is not a part of tentacle branch src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts - Removed ModelCdsService which is not a part of tentacle branch --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 8f92a8a9801..dda5430024b 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -215,6 +215,7 @@ address for the selected gateway. And a config can be unset by `ceph dashboard unset-rgw-hostname `. With this dashboard no longer relies on `rgw_dns_name`. +* Dashboard: Added support for QAT compression in RGW service form. Users can select 'Hardware' or 'Software' for QAT compression . If 'None' is selected, compression is removed altogether. >=19.2.1 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 14970328e11..3aa68c65bc1 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 @@ -16,7 +16,8 @@ import { ListModule, ToggletipModule, IconModule, - TagModule + TagModule, + SelectModule } from 'carbon-components-angular'; import { @@ -114,7 +115,8 @@ import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-deta ListModule, ToggletipModule, IconModule, - TagModule + TagModule, + 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 4625f285025..cdcb637551f 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 91552e31316..365fa2888e7 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 @@ -16,6 +16,7 @@ import { SharedModule } from '~/app/shared/shared.module'; import { configureTestBed, FormHelper, Mocks } from '~/testing/unit-test-helper'; import { ServiceFormComponent } from './service-form.component'; import { PoolService } from '~/app/shared/api/pool.service'; +import { SelectModule } from 'carbon-components-angular'; // for 'nvmeof' service const mockPools = [ @@ -45,6 +46,7 @@ describe('ServiceFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, + SelectModule, ToastrModule.forRoot() ] }); @@ -292,6 +294,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 3fc290130ce..2b6ddeee0e0 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 { ModalService } from '~/app/shared/services/modal.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { TimerService } from '~/app/shared/services/timer.service'; @@ -107,6 +107,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, @@ -284,6 +289,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 966774a05a2..c79a9cb4e74 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' +}