From 59ead8970fb1631a04dc2d222a8ff29be2a837f4 Mon Sep 17 00:00:00 2001 From: achmelo <37397715+achmelo@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:09:42 +0200 Subject: [PATCH] fix: heap configuration from zowe.yaml (#3087) * chore: move babel to dev, modify webpack config, spring security Signed-off-by: achmelo * allow heap configuration from zowe.yaml Signed-off-by: achmelo * improve setup of default value Signed-off-by: achmelo --------- Signed-off-by: achmelo --- .../src/main/resources/bin/start.sh | 4 +++- .../src/main/resources/bin/start.sh | 5 ++++- .../src/main/resources/bin/start.sh | 4 +++- .../src/main/resources/bin/start.sh | 6 +++++- .../src/main/resources/bin/start.sh | 4 +++- .../src/main/resources/bin/start.sh | 3 ++- schemas/caching-schema.json | 14 ++++++++++++++ schemas/catalog-schema.json | 14 ++++++++++++++ schemas/cloud-gateway-schema.json | 14 ++++++++++++++ schemas/discovery-schema.json | 14 ++++++++++++++ schemas/gateway-schema.json | 18 ++++++++++++++++++ schemas/metrics-schema.json | 14 ++++++++++++++ 12 files changed, 108 insertions(+), 6 deletions(-) diff --git a/api-catalog-package/src/main/resources/bin/start.sh b/api-catalog-package/src/main/resources/bin/start.sh index 7fcc21df47..ea35498a96 100755 --- a/api-catalog-package/src/main/resources/bin/start.sh +++ b/api-catalog-package/src/main/resources/bin/start.sh @@ -31,6 +31,8 @@ # - ZWE_components_gateway_apiml_security_authorization_resourceClass # - ZWE_components_gateway_port - the port the api gateway service will use # - ZWE_components_gateway_server_ssl_enabled +# - ZWE_configs_heap_max +# - ZWE_configs_heap_init # - ZWE_configs_certificate_keystore_alias - The alias of the key within the keystore # - ZWE_configs_certificate_keystore_file - The keystore to use for SSL certificates # - ZWE_configs_certificate_keystore_password - The password to access the keystore supplied by KEYSTORE @@ -138,7 +140,7 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi CATALOG_CODE=AC _BPX_JOBNAME=${ZWE_zowe_job_prefix}${CATALOG_CODE} java \ - -Xms16m -Xmx512m \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ diff --git a/caching-service-package/src/main/resources/bin/start.sh b/caching-service-package/src/main/resources/bin/start.sh index 5b6e48cc36..d45e41c0ca 100755 --- a/caching-service-package/src/main/resources/bin/start.sh +++ b/caching-service-package/src/main/resources/bin/start.sh @@ -25,6 +25,8 @@ # - ZWE_components_discovery_port - the port the discovery service will use # - ZWE_components_gateway_port - the port the api gateway service will use # - ZWE_components_gateway_server_ssl_enabled +# - ZWE_configs_heap_max +# - ZWE_configs_heap_init # - ZWE_configs_storage_evictionStrategy # - ZWE_configs_storage_mode # - ZWE_configs_storage_size @@ -125,7 +127,8 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi # -Dapiml.service.preferIpAddress=${APIML_PREFER_IP_ADDRESS:-false} \ CACHING_CODE=CS -_BPX_JOBNAME=${ZWE_zowe_job_prefix}${CACHING_CODE} java -Xms16m -Xmx512m \ +_BPX_JOBNAME=${ZWE_zowe_job_prefix}${CACHING_CODE} java \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ diff --git a/cloud-gateway-package/src/main/resources/bin/start.sh b/cloud-gateway-package/src/main/resources/bin/start.sh index d1c7ec25bf..44f05b5d41 100755 --- a/cloud-gateway-package/src/main/resources/bin/start.sh +++ b/cloud-gateway-package/src/main/resources/bin/start.sh @@ -27,6 +27,8 @@ # - LIBPATH # - LIBRARY_PATH # - ZWE_components_discovery_port - the port the discovery service will use +# - ZWE_configs_heap_max +# - ZWE_configs_heap_init # - ZWE_configs_apiml_service_forwardClientCertEnabled # - ZWE_configs_certificate_keystore_alias - The alias of the key within the keystore # - ZWE_configs_certificate_keystore_file - The keystore to use for SSL certificates @@ -86,7 +88,7 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi CLOUD_GATEWAY_CODE=CG _BPX_JOBNAME=${ZWE_zowe_job_prefix}${CLOUD_GATEWAY_CODE} java \ - -Xms32m -Xmx256m \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ diff --git a/discovery-package/src/main/resources/bin/start.sh b/discovery-package/src/main/resources/bin/start.sh index 60aa296c1a..b5cfe29137 100755 --- a/discovery-package/src/main/resources/bin/start.sh +++ b/discovery-package/src/main/resources/bin/start.sh @@ -25,6 +25,8 @@ # - LIBPATH # - LIBRARY_PATH # - ZWE_components_gateway_server_ssl_enabled +# - ZWE_configs_heap_max +# - ZWE_configs_heap_init # - ZWE_configs_certificate_keystore_alias - The alias of the key within the keystore # - ZWE_configs_certificate_keystore_file - The keystore to use for SSL certificates # - ZWE_configs_certificate_keystore_password - The password to access the keystore supplied by KEYSTORE @@ -134,7 +136,9 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi # -Dapiml.service.preferIpAddress=${APIML_PREFER_IP_ADDRESS:-false} \ DISCOVERY_CODE=AD -_BPX_JOBNAME=${ZWE_zowe_job_prefix}${DISCOVERY_CODE} java -Xms32m -Xmx256m ${QUICK_START} \ +_BPX_JOBNAME=${ZWE_zowe_job_prefix}${DISCOVERY_CODE} java \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ + ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ diff --git a/gateway-package/src/main/resources/bin/start.sh b/gateway-package/src/main/resources/bin/start.sh index 633a4ce34d..9e6cf90389 100755 --- a/gateway-package/src/main/resources/bin/start.sh +++ b/gateway-package/src/main/resources/bin/start.sh @@ -27,6 +27,8 @@ # - LIBPATH # - LIBRARY_PATH # - ZWE_components_discovery_port - the port the discovery service will use +# - ZWE_configs_heap_max +# - ZWE_configs_heap_init # - ZWE_configs_apiml_catalog_serviceId # - ZWE_configs_apiml_gateway_timeoutMillis # - ZWE_configs_apiml_security_auth_provider @@ -198,7 +200,7 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi GATEWAY_CODE=AG _BPX_JOBNAME=${ZWE_zowe_job_prefix}${GATEWAY_CODE} java \ - -Xms32m -Xmx256m \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ diff --git a/metrics-service-package/src/main/resources/bin/start.sh b/metrics-service-package/src/main/resources/bin/start.sh index a84f693ed2..788debb676 100755 --- a/metrics-service-package/src/main/resources/bin/start.sh +++ b/metrics-service-package/src/main/resources/bin/start.sh @@ -99,7 +99,8 @@ truststore_location="${ZWE_configs_certificate_truststore_file:-${ZWE_zowe_certi # -Dapiml.service.preferIpAddress=${APIML_PREFER_IP_ADDRESS:-false} \ METRICS_CODE=MS -_BPX_JOBNAME=${ZWE_zowe_job_prefix}${METRICS_CODE} java -Xms16m -Xmx512m \ +_BPX_JOBNAME=${ZWE_zowe_job_prefix}${METRICS_CODE} java \ + -Xms${ZWE_configs_heap_init:-32}m -Xmx${ZWE_configs_heap_max:-512}m \ ${QUICK_START} \ -Dibm.serversocket.recover=true \ -Dfile.encoding=UTF-8 \ diff --git a/schemas/caching-schema.json b/schemas/caching-schema.json index 8aca27bb8e..c6907f1628 100644 --- a/schemas/caching-schema.json +++ b/schemas/caching-schema.json @@ -24,6 +24,20 @@ "type": "boolean", "description": "Enable debug logs in discovery service" }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } + }, "storage": { "evictionStrategy": { "type": "string", diff --git a/schemas/catalog-schema.json b/schemas/catalog-schema.json index eca23126bf..c21001df95 100644 --- a/schemas/catalog-schema.json +++ b/schemas/catalog-schema.json @@ -69,6 +69,20 @@ "debug": { "type": "boolean", "description": "Enable debug logs in metrics service" + }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } } } } diff --git a/schemas/cloud-gateway-schema.json b/schemas/cloud-gateway-schema.json index 32b2162b97..96ce4653a9 100644 --- a/schemas/cloud-gateway-schema.json +++ b/schemas/cloud-gateway-schema.json @@ -39,6 +39,20 @@ "debug": { "type": "boolean", "description": "Enable debug logs in discovery service" + }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } } } } diff --git a/schemas/discovery-schema.json b/schemas/discovery-schema.json index 3a4618201e..999a054d9e 100644 --- a/schemas/discovery-schema.json +++ b/schemas/discovery-schema.json @@ -32,6 +32,20 @@ "debug": { "type": "boolean", "description": "Enable debug logs in discovery service" + }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } } } } diff --git a/schemas/gateway-schema.json b/schemas/gateway-schema.json index 8e35d7822a..8a9f6a65ce 100644 --- a/schemas/gateway-schema.json +++ b/schemas/gateway-schema.json @@ -20,6 +20,24 @@ "$ref": "#/$defs/port", "default": 7553 }, + "debug": { + "type": "boolean", + "description": "Enable debug logs in gateway service" + }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } + }, "apiml": { "type": "object", "description": "Zowe API ML specific properties.", diff --git a/schemas/metrics-schema.json b/schemas/metrics-schema.json index 5779e5c916..e463bc06ff 100644 --- a/schemas/metrics-schema.json +++ b/schemas/metrics-schema.json @@ -23,6 +23,20 @@ "debug": { "type": "boolean", "description": "Enable debug logs in metrics service" + }, + "heap": { + "type": "object", + "description": "Configure JVM parameters for heap size", + "properties": { + "init": { + "type": "integer", + "description": "Initial heap size in MB." + }, + "max": { + "type": "integer", + "description": "Maximum heap size in MB." + } + } } } }