From 20cb35100c837b6cb20a5236328ca3ff97f5db9c Mon Sep 17 00:00:00 2001 From: desmax74 Date: Mon, 14 Mar 2022 10:51:16 +0100 Subject: [PATCH] [RHPAM-3528] Increase KieExecutorMDB threads in RHPAM image Signed-off-by: desmax74 --- deploy/crds/kieapp.crd.yaml | 22 +++++++++++----- .../dev/7.12.1-1/manifests/kieapp.crd.yaml | 22 +++++++++++----- .../prod/7.12.1-1/manifests/kieapp.crd.yaml | 22 +++++++++++----- .../test/7.12.1-1/manifests/kieapp.crd.yaml | 22 +++++++++++----- deploy/ui/form.json | 6 ++--- pkg/apis/app/v2/kieapp_types.go | 8 +++--- pkg/apis/app/v2/zz_generated.deepcopy.go | 8 +++--- pkg/controller/kieapp/defaults/defaults.go | 26 +++++++++---------- .../kieapp/defaults/defaults_test.go | 16 +++--------- rhpam-config/7.12.1/common.yaml | 6 ++--- 10 files changed, 95 insertions(+), 63 deletions(-) diff --git a/deploy/crds/kieapp.crd.yaml b/deploy/crds/kieapp.crd.yaml index c364d941f..b50415b16 100644 --- a/deploy/crds/kieapp.crd.yaml +++ b/deploy/crds/kieapp.crd.yaml @@ -1628,9 +1628,6 @@ spec: description: KieServerSet KIE Server configuration for a single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -2488,6 +2485,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it must + be lower than the value of max-pool-size, by default is + max-pool-size set to 60. Max pool size can be set by system + property jboss.mdb.strict.max.pool.size (using javaOptsAppend: + "-Djboss.mdb.strict.max.pool.size=40"), for more information + see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string @@ -4501,9 +4506,6 @@ spec: single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -5390,6 +5392,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it + must be lower than the value of max-pool-size, by + default is max-pool-size set to 60. Max pool size + can be set by system property jboss.mdb.strict.max.pool.size + (using javaOptsAppend: "-Djboss.mdb.strict.max.pool.size=40"), + for more information see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string diff --git a/deploy/olm-catalog/dev/7.12.1-1/manifests/kieapp.crd.yaml b/deploy/olm-catalog/dev/7.12.1-1/manifests/kieapp.crd.yaml index c364d941f..b50415b16 100644 --- a/deploy/olm-catalog/dev/7.12.1-1/manifests/kieapp.crd.yaml +++ b/deploy/olm-catalog/dev/7.12.1-1/manifests/kieapp.crd.yaml @@ -1628,9 +1628,6 @@ spec: description: KieServerSet KIE Server configuration for a single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -2488,6 +2485,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it must + be lower than the value of max-pool-size, by default is + max-pool-size set to 60. Max pool size can be set by system + property jboss.mdb.strict.max.pool.size (using javaOptsAppend: + "-Djboss.mdb.strict.max.pool.size=40"), for more information + see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string @@ -4501,9 +4506,6 @@ spec: single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -5390,6 +5392,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it + must be lower than the value of max-pool-size, by + default is max-pool-size set to 60. Max pool size + can be set by system property jboss.mdb.strict.max.pool.size + (using javaOptsAppend: "-Djboss.mdb.strict.max.pool.size=40"), + for more information see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string diff --git a/deploy/olm-catalog/prod/7.12.1-1/manifests/kieapp.crd.yaml b/deploy/olm-catalog/prod/7.12.1-1/manifests/kieapp.crd.yaml index c364d941f..b50415b16 100644 --- a/deploy/olm-catalog/prod/7.12.1-1/manifests/kieapp.crd.yaml +++ b/deploy/olm-catalog/prod/7.12.1-1/manifests/kieapp.crd.yaml @@ -1628,9 +1628,6 @@ spec: description: KieServerSet KIE Server configuration for a single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -2488,6 +2485,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it must + be lower than the value of max-pool-size, by default is + max-pool-size set to 60. Max pool size can be set by system + property jboss.mdb.strict.max.pool.size (using javaOptsAppend: + "-Djboss.mdb.strict.max.pool.size=40"), for more information + see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string @@ -4501,9 +4506,6 @@ spec: single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -5390,6 +5392,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it + must be lower than the value of max-pool-size, by + default is max-pool-size set to 60. Max pool size + can be set by system property jboss.mdb.strict.max.pool.size + (using javaOptsAppend: "-Djboss.mdb.strict.max.pool.size=40"), + for more information see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string diff --git a/deploy/olm-catalog/test/7.12.1-1/manifests/kieapp.crd.yaml b/deploy/olm-catalog/test/7.12.1-1/manifests/kieapp.crd.yaml index c364d941f..b50415b16 100644 --- a/deploy/olm-catalog/test/7.12.1-1/manifests/kieapp.crd.yaml +++ b/deploy/olm-catalog/test/7.12.1-1/manifests/kieapp.crd.yaml @@ -1628,9 +1628,6 @@ spec: description: KieServerSet KIE Server configuration for a single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -2488,6 +2485,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it must + be lower than the value of max-pool-size, by default is + max-pool-size set to 60. Max pool size can be set by system + property jboss.mdb.strict.max.pool.size (using javaOptsAppend: + "-Djboss.mdb.strict.max.pool.size=40"), for more information + see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string @@ -4501,9 +4506,6 @@ spec: single set, or for multiple sets if deployments is set to >1 properties: - MDBMaxSession: - description: MDBMaxSession number of KIE Executor sessions - type: integer build: description: KieAppBuildObject Data to define how to build an application from source @@ -5390,6 +5392,14 @@ spec: keystoreSecret: description: KeystoreSecret secret name type: string + kieExecutorMDBMaxSession: + description: 'Number of max KIE Executor sessions, it + must be lower than the value of max-pool-size, by + default is max-pool-size set to 60. Max pool size + can be set by system property jboss.mdb.strict.max.pool.size + (using javaOptsAppend: "-Djboss.mdb.strict.max.pool.size=40"), + for more information see https://access.redhat.com/solutions/2955481.' + type: integer name: description: Server name type: string diff --git a/deploy/ui/form.json b/deploy/ui/form.json index a9d318baa..1e37ab951 100644 --- a/deploy/ui/form.json +++ b/deploy/ui/form.json @@ -1724,7 +1724,7 @@ "label": "Configure KieExecutorMDB threads", "type": "object", "max": 1, - "jsonPath": "$.spec.objects.servers[*].MDBMaxSession", + "jsonPath": "$.spec.objects.servers[*].KieExecutorMDBMaxSession", "visible": true, "fields": [ { @@ -1732,8 +1732,8 @@ "type": "integer", "required": false, "jsonPath": "$.spec.objects.servers[*].MDBMaxSession", - "originalJsonPath": "$.spec.objects.servers[*].MDBMaxSession", - "description": "Number of max session used by the JMS Executor." + "originalJsonPath": "$.spec.objects.servers[*].KieExecutorMDBMaxSession", + "description": "Number of max session used by the JMS Executor, it must be lower than the value of max-pool-size passed as jboss.mdb.strict.max.pool.size, if leaved empty the max.pool.size will be set to 60." } ] }, diff --git a/pkg/apis/app/v2/kieapp_types.go b/pkg/apis/app/v2/kieapp_types.go index d0fa80730..aae5e870b 100644 --- a/pkg/apis/app/v2/kieapp_types.go +++ b/pkg/apis/app/v2/kieapp_types.go @@ -151,8 +151,8 @@ type KieServerSet struct { Kafka *KafkaExtObject `json:"kafka,omitempty"` KafkaJbpmEventEmitters *KafkaJBPMEventEmittersObject `json:"kafkaJbpmEventEmitters,omitempty"` Cors *CORSFiltersObject `json:"cors,omitempty"` - // MDBMaxSession number of KIE Executor sessions - MDBMaxSession *int `json:"MDBMaxSession,omitempty"` + // Number of max KIE Executor sessions, it must be lower than the value of max-pool-size, by default is max-pool-size set to 60. Max pool size can be set by system property jboss.mdb.strict.max.pool.size (using javaOptsAppend: "-Djboss.mdb.strict.max.pool.size=40"), for more information see https://access.redhat.com/solutions/2955481. + KieExecutorMDBMaxSession *int `json:"kieExecutorMDBMaxSession,omitempty"` } // ConsoleObject configuration of the RHPAM workbench @@ -768,8 +768,8 @@ type ServerTemplate struct { KafkaJbpmEventEmitters *KafkaJBPMEventEmittersObject `json:"kafkaJbpmEventEmitters,omitempty"` Cors *CORSFiltersObject `json:"cors,omitempty"` StartupStrategy *StartupStrategy `json:"startupStrategy,omitempty"` - // MDBMaxSession number of KIE Executor sessions - MDBMaxSession *int `json:"MDBMaxSession,omitempty"` + // KieExecutorMDBMaxSession number of KIE Executor sessions + KieExecutorMDBMaxSession *int `json:"KieExecutorMDBMaxSession,omitempty"` } // DashbuilderTemplate contains all the variables used in the yaml templates diff --git a/pkg/apis/app/v2/zz_generated.deepcopy.go b/pkg/apis/app/v2/zz_generated.deepcopy.go index 9e77697a9..9816705b4 100644 --- a/pkg/apis/app/v2/zz_generated.deepcopy.go +++ b/pkg/apis/app/v2/zz_generated.deepcopy.go @@ -1279,8 +1279,8 @@ func (in *KieServerSet) DeepCopyInto(out *KieServerSet) { *out = new(CORSFiltersObject) (*in).DeepCopyInto(*out) } - if in.MDBMaxSession != nil { - in, out := &in.MDBMaxSession, &out.MDBMaxSession + if in.KieExecutorMDBMaxSession != nil { + in, out := &in.KieExecutorMDBMaxSession, &out.KieExecutorMDBMaxSession *out = new(int) **out = **in } @@ -1551,8 +1551,8 @@ func (in *ServerTemplate) DeepCopyInto(out *ServerTemplate) { *out = new(StartupStrategy) (*in).DeepCopyInto(*out) } - if in.MDBMaxSession != nil { - in, out := &in.MDBMaxSession, &out.MDBMaxSession + if in.KieExecutorMDBMaxSession != nil { + in, out := &in.KieExecutorMDBMaxSession, &out.KieExecutorMDBMaxSession *out = new(int) **out = **in } diff --git a/pkg/controller/kieapp/defaults/defaults.go b/pkg/controller/kieapp/defaults/defaults.go index b8705569f..b313d307c 100644 --- a/pkg/controller/kieapp/defaults/defaults.go +++ b/pkg/controller/kieapp/defaults/defaults.go @@ -761,17 +761,17 @@ func getServersConfig(cr *api.KieApp) ([]api.ServerTemplate, error) { } usedNames[name] = true template := api.ServerTemplate{ - KieName: name, - KieServerID: name, - Build: getBuildConfig(product, cr, serverSet), - KeystoreSecret: serverSet.KeystoreSecret, - StorageClassName: serverSet.StorageClassName, - JbpmCluster: serverSet.JbpmCluster, - PersistRepos: serverSet.PersistRepos, - ServersM2PvSize: serverSet.ServersM2PvSize, - ServersKiePvSize: serverSet.ServersKiePvSize, - StartupStrategy: cr.Status.Applied.CommonConfig.StartupStrategy, - MDBMaxSession: serverSet.MDBMaxSession, + KieName: name, + KieServerID: name, + Build: getBuildConfig(product, cr, serverSet), + KeystoreSecret: serverSet.KeystoreSecret, + StorageClassName: serverSet.StorageClassName, + JbpmCluster: serverSet.JbpmCluster, + PersistRepos: serverSet.PersistRepos, + ServersM2PvSize: serverSet.ServersM2PvSize, + ServersKiePvSize: serverSet.ServersKiePvSize, + StartupStrategy: cr.Status.Applied.CommonConfig.StartupStrategy, + KieExecutorMDBMaxSession: serverSet.KieExecutorMDBMaxSession, } if cr.Status.Applied.Objects.Console == nil || cr.Status.Applied.Environment == api.RhdmProductionImmutable { @@ -864,8 +864,8 @@ func getServersConfig(cr *api.KieApp) ([]api.ServerTemplate, error) { } // KieExecutorMDB - if serverSet.MDBMaxSession != nil { - template.MDBMaxSession = serverSet.MDBMaxSession + if serverSet.KieExecutorMDBMaxSession != nil { + template.KieExecutorMDBMaxSession = serverSet.KieExecutorMDBMaxSession } if cr.Status.Applied.CommonConfig.StartupStrategy.StrategyName != "" { diff --git a/pkg/controller/kieapp/defaults/defaults_test.go b/pkg/controller/kieapp/defaults/defaults_test.go index f27a9eafd..3907af604 100644 --- a/pkg/controller/kieapp/defaults/defaults_test.go +++ b/pkg/controller/kieapp/defaults/defaults_test.go @@ -7267,7 +7267,7 @@ func TestKieExecutorMDB(t *testing.T) { Environment: api.RhpamProductionImmutable, Objects: api.KieAppObjects{ Servers: []api.KieServerSet{ - {MDBMaxSession: Pint(40)}, + {KieExecutorMDBMaxSession: Pint(40)}, }, }, }, @@ -7276,16 +7276,8 @@ func TestKieExecutorMDB(t *testing.T) { env, err := GetEnvironment(cr, test.MockService()) assert.Nil(t, err, "Error getting TestKieExecutorMDB environment") - assert.NotNil(t, cr.Status.Applied.Objects.Servers[0].MDBMaxSession) - mdbMaxSessionPassed := false - for _, env := range env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0].Env { - if strings.HasPrefix(env.Name, "JBOSS_MDB") { - if env.Name != "JBOSS_MDB_MAX_SESSION" && env.Value == "40" { - mdbMaxSessionPassed = true - } - } - } - assert.True(t, mdbMaxSessionPassed) + assert.NotNil(t, cr.Status.Applied.Objects.Servers[0].KieExecutorMDBMaxSession) + assert.Equal(t, "40", getEnvVariable(env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0], "KIE_EXECUTOR_MDB_MAX_SESSIONS")) } func TestKieExecutorMDBEmpty(t *testing.T) { @@ -7302,7 +7294,7 @@ func TestKieExecutorMDBEmpty(t *testing.T) { env, err := GetEnvironment(cr, test.MockService()) assert.Nil(t, err, "Error getting TestKieExecutorMDBEmpty environment") - assert.Nil(t, cr.Status.Applied.Objects.Servers[0].MDBMaxSession) + assert.Nil(t, cr.Status.Applied.Objects.Servers[0].KieExecutorMDBMaxSession) mdbMaxSessionNotPassed := true for _, env := range env.Servers[0].DeploymentConfigs[0].Spec.Template.Spec.Containers[0].Env { if strings.HasPrefix(env.Name, "JBOSS_MDB") { diff --git a/rhpam-config/7.12.1/common.yaml b/rhpam-config/7.12.1/common.yaml index 0d72ff8c8..ac00578b0 100644 --- a/rhpam-config/7.12.1/common.yaml +++ b/rhpam-config/7.12.1/common.yaml @@ -1099,9 +1099,9 @@ servers: #[[end]] #[[end]] ## CORS END - #[[if .MDBMaxSession]] - - name: JBOSS_MDB_MAX_SESSIONS - value: "[[.MDBMaxSession]]" + #[[if .KieExecutorMDBMaxSession]] + - name: KIE_EXECUTOR_MDB_MAX_SESSIONS + value: "[[.KieExecutorMDBMaxSession]]" #[[end]] livenessProbe: httpGet: