From 4f30736a3b2d696c8faf7904ae2e2de12f3a1e9c Mon Sep 17 00:00:00 2001 From: Richard Salac Date: Wed, 22 Jan 2025 18:03:21 +0100 Subject: [PATCH 1/5] Fix debug for production Signed-off-by: Richard Salac --- .../src/main/resources/bin/start.sh | 15 ++++++++++----- .../src/main/resources/bin/start.sh | 9 +++++---- config/zowe-api-dev/alternative_start.sh | 4 ---- .../src/main/resources/bin/start.sh | 18 ++++++++++++------ .../src/main/resources/bin/start.sh | 10 +++++----- zaas-package/src/main/resources/bin/start.sh | 16 ++++++++++------ 6 files changed, 42 insertions(+), 30 deletions(-) diff --git a/api-catalog-package/src/main/resources/bin/start.sh b/api-catalog-package/src/main/resources/bin/start.sh index 54180eab6b..2bbfd05489 100755 --- a/api-catalog-package/src/main/resources/bin/start.sh +++ b/api-catalog-package/src/main/resources/bin/start.sh @@ -68,19 +68,25 @@ if [ -z "${LIBRARY_PATH}" ] then LIBRARY_PATH="../common-java-lib/bin/" fi -# API Mediation Layer Debug Mode -export LOG_LEVEL= if [ "${ZWE_configs_debug}" = "true" ] then - export LOG_LEVEL="debug" + if [ -n "${ZWE_configs_spring_profiles_active}" ]; + then + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," + fi + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" fi # FIXME: APIML_DIAG_MODE_ENABLED is not officially mentioned. We can still use it behind the scene, # or we can define configs.diagMode in manifest, then use "$ZWE_configs_diagMode". # if [[ ! -z "${APIML_DIAG_MODE_ENABLED}" ]] # then -# LOG_LEVEL=${APIML_DIAG_MODE_ENABLED} +# if [ -n "${ZWE_configs_spring_profiles_active}" ]; +# then +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," +# fi +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" # fi # NOTE: ZWEAD_EXTERNAL_STATIC_DEF_DIRECTORIES is not defined in Zowe level any more, never heard anyone use it. @@ -287,7 +293,6 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${CATALOG_CODE} ${JAVA_BIN_DIR}java \ -Dserver.ssl.ciphers=${server_ciphers} \ -Dserver.ssl.protocol=${server_protocol} \ -Dserver.ssl.enabled-protocols=${server_enabled_protocols} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dserver.address=${ZWE_configs_zowe_network_server_listenAddresses_0:-${ZWE_zowe_network_server_listenAddresses_0:-"0.0.0.0"}} \ -Dserver.ssl.enabled=${ZWE_configs_server_ssl_enabled:-true} \ -Dserver.ssl.keyStore="${keystore_location}" \ diff --git a/caching-service-package/src/main/resources/bin/start.sh b/caching-service-package/src/main/resources/bin/start.sh index 5d692cd266..e8f82c63b1 100755 --- a/caching-service-package/src/main/resources/bin/start.sh +++ b/caching-service-package/src/main/resources/bin/start.sh @@ -53,12 +53,14 @@ else fi echo "jar file: "${JAR_FILE} -# API Mediation Layer Debug Mode -export LOG_LEVEL= if [ "${ZWE_configs_debug}" = "true" ] then - export LOG_LEVEL="debug" + if [ -n "${ZWE_configs_spring_profiles_active}" ]; + then + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," + fi + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" fi if [ -z "${LIBRARY_PATH}" ] @@ -239,7 +241,6 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${CACHING_CODE} ${JAVA_BIN_DIR}java \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${ZWE_configs_spring_profiles_active:-} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dapiml.logs.location=${ZWE_zowe_logDirectory} \ -Dapiml.health.protected=${ZWE_configs_apiml_health_protected:-true} \ -Dapiml.service.port=${ZWE_configs_port:-7555} \ diff --git a/config/zowe-api-dev/alternative_start.sh b/config/zowe-api-dev/alternative_start.sh index 3814a86cc7..ec35225a95 100755 --- a/config/zowe-api-dev/alternative_start.sh +++ b/config/zowe-api-dev/alternative_start.sh @@ -54,7 +54,6 @@ _BPX_JOBNAME=${ZOWE_PREFIX}${GATEWAY_CODE} java \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${APIML_SPRING_PROFILES:-} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dapiml.service.hostname=${ZOWE_EXPLORER_HOST} \ -Dapiml.service.port=${GATEWAY_PORT} \ -Dapiml.service.discoveryServiceUrls=${ZWE_DISCOVERY_SERVICES_LIST} \ @@ -135,7 +134,6 @@ _BPX_JOBNAME=${ZOWE_PREFIX}${DISCOVERY_CODE} java -Xms32m -Xmx256m ${QUICK_START -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${APIML_SPRING_PROFILES:-https} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dserver.address=0.0.0.0 \ -Dapiml.discovery.userid=eureka \ -Dapiml.discovery.password=password \ @@ -181,7 +179,6 @@ _BPX_JOBNAME=${ZOWE_PREFIX}${CATALOG_CODE} java \ -Dapiml.logs.location=${WORKSPACE_DIR}/api-mediation/logs \ -Dapiml.security.ssl.verifySslCertificatesOfServices=${VERIFY_CERTIFICATES:-false} \ -Dapiml.security.ssl.nonStrictVerifySslCertificatesOfServices=${NONSTRICT_VERIFY_CERTIFICATES:-false} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dserver.address=0.0.0.0 \ -Dserver.ssl.enabled=${APIML_SSL_ENABLED:-true} \ -Dserver.ssl.keyStore="${KEYSTORE}" \ @@ -206,7 +203,6 @@ _BPX_JOBNAME=${ZOWE_PREFIX}${CACHING_CODE} java -Xms16m -Xmx512m \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${APIML_SPRING_PROFILES:-} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dapiml.service.port=${ZWE_CACHING_SERVICE_PORT} \ -Dapiml.service.hostname=${ZOWE_EXPLORER_HOST} \ -Dapiml.service.discoveryServiceUrls=${ZWE_DISCOVERY_SERVICES_LIST} \ diff --git a/discovery-package/src/main/resources/bin/start.sh b/discovery-package/src/main/resources/bin/start.sh index 81b1d2d4cb..4fdcdf3947 100755 --- a/discovery-package/src/main/resources/bin/start.sh +++ b/discovery-package/src/main/resources/bin/start.sh @@ -59,18 +59,25 @@ fi if [ -z "${LIBRARY_PATH}" ]; then LIBRARY_PATH="../common-java-lib/bin/" fi -# API Mediation Layer Debug Mode -unset LOG_LEVEL -if [ "${ZWE_configs_debug}" = "true" ]; then - export LOG_LEVEL="debug" +if [ "${ZWE_configs_debug}" = "true" ] +then + if [ -n "${ZWE_configs_spring_profiles_active}" ]; + then + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," + fi + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" fi # FIXME: APIML_DIAG_MODE_ENABLED is not officially mentioned. We can still use it behind the scene, # or we can define configs.diagMode in manifest, then use "$ZWE_configs_diagMode". # if [[ ! -z "${APIML_DIAG_MODE_ENABLED}" ]] # then -# LOG_LEVEL=${APIML_DIAG_MODE_ENABLED} +# if [ -n "${ZWE_configs_spring_profiles_active}" ]; +# then +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," +# fi +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" # fi # NOTE: ZWEAD_EXTERNAL_STATIC_DEF_DIRECTORIES is not defined in Zowe level any more, never heard anyone use it. @@ -246,7 +253,6 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${DISCOVERY_CODE} ${JAVA_BIN_DIR}java \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${ZWE_configs_spring_profiles_active:-https} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dserver.address=${ZWE_configs_zowe_network_server_listenAddresses_0:-${ZWE_zowe_network_server_listenAddresses_0:-"0.0.0.0"}} \ -Dapiml.discovery.userid=eureka \ -Dapiml.discovery.password=password \ diff --git a/gateway-package/src/main/resources/bin/start.sh b/gateway-package/src/main/resources/bin/start.sh index f723f3c467..af2636e9e9 100755 --- a/gateway-package/src/main/resources/bin/start.sh +++ b/gateway-package/src/main/resources/bin/start.sh @@ -103,12 +103,13 @@ then LIBRARY_PATH="../common-java-lib/bin/" fi -# API Mediation Layer Debug Mode -export LOG_LEVEL= - if [ "${ZWE_configs_debug}" = "true" ] then - export LOG_LEVEL="debug" + if [ -n "${ZWE_configs_spring_profiles_active}" ]; + then + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," + fi + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" fi if [ "${ZWE_configs_apiml_security_auth_uniqueCookie}" = "true" ]; then @@ -288,7 +289,6 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${GATEWAY_CODE} ${JAVA_BIN_DIR}java \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${ZWE_configs_spring_profiles_active:-} \ - -Dspring.profiles.include=${LOG_LEVEL} \ -Dapiml.service.apimlId=${ZWE_configs_apimlId:-} \ -Dapiml.service.hostname=${ZWE_haInstance_hostname:-localhost} \ -Dapiml.service.port=${ZWE_configs_port:-7554} \ diff --git a/zaas-package/src/main/resources/bin/start.sh b/zaas-package/src/main/resources/bin/start.sh index 88b0e42e59..eae2e27468 100755 --- a/zaas-package/src/main/resources/bin/start.sh +++ b/zaas-package/src/main/resources/bin/start.sh @@ -95,12 +95,13 @@ then LIBRARY_PATH="../common-java-lib/bin/" fi -# API Mediation Layer Debug Mode -export LOG_LEVEL= - if [ "${ZWE_configs_debug}" = "true" ] then - export LOG_LEVEL="debug" + if [ -n "${ZWE_configs_spring_profiles_active}" ]; + then + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," + fi + ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" fi # setting the cookieName based on the instances @@ -114,7 +115,11 @@ fi # DIAG_MODE=${APIML_DIAG_MODE_ENABLED} # if [ ! -z "$DIAG_MODE" ] # then -# LOG_LEVEL=$DIAG_MODE +# if [ -n "${ZWE_configs_spring_profiles_active}" ]; +# then +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," +# fi +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" # fi # how to verifyCertificates @@ -298,7 +303,6 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${ZAAS_CODE} ${JAVA_BIN_DIR}java \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir=${TMPDIR:-/tmp} \ -Dspring.profiles.active=${ZWE_configs_spring_profiles_active:-} \ - -Dspring.profiles.include=$LOG_LEVEL \ -Dapiml.service.hostname=${ZWE_haInstance_hostname:-localhost} \ -Dapiml.service.port=${ZWE_configs_port:-7558} \ -Dapiml.service.discoveryServiceUrls=${ZWE_DISCOVERY_SERVICES_LIST} \ From 64a8fd17dbf3f6c0620fbb317e3e86855394ad76 Mon Sep 17 00:00:00 2001 From: Richard Salac Date: Wed, 22 Jan 2025 18:13:44 +0100 Subject: [PATCH 2/5] diag profile Signed-off-by: Richard Salac --- api-catalog-package/src/main/resources/bin/start.sh | 2 +- discovery-package/src/main/resources/bin/start.sh | 2 +- zaas-package/src/main/resources/bin/start.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api-catalog-package/src/main/resources/bin/start.sh b/api-catalog-package/src/main/resources/bin/start.sh index 2bbfd05489..a3c050a04f 100755 --- a/api-catalog-package/src/main/resources/bin/start.sh +++ b/api-catalog-package/src/main/resources/bin/start.sh @@ -86,7 +86,7 @@ fi # then # ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," # fi -# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}diag" # fi # NOTE: ZWEAD_EXTERNAL_STATIC_DEF_DIRECTORIES is not defined in Zowe level any more, never heard anyone use it. diff --git a/discovery-package/src/main/resources/bin/start.sh b/discovery-package/src/main/resources/bin/start.sh index 4fdcdf3947..0115088d73 100755 --- a/discovery-package/src/main/resources/bin/start.sh +++ b/discovery-package/src/main/resources/bin/start.sh @@ -77,7 +77,7 @@ fi # then # ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," # fi -# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}diag" # fi # NOTE: ZWEAD_EXTERNAL_STATIC_DEF_DIRECTORIES is not defined in Zowe level any more, never heard anyone use it. diff --git a/zaas-package/src/main/resources/bin/start.sh b/zaas-package/src/main/resources/bin/start.sh index eae2e27468..53c024beaa 100755 --- a/zaas-package/src/main/resources/bin/start.sh +++ b/zaas-package/src/main/resources/bin/start.sh @@ -119,7 +119,7 @@ fi # then # ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}," # fi -# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}debug" +# ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}diag" # fi # how to verifyCertificates From 3ec249335de989d614a1830941e5658920721d6f Mon Sep 17 00:00:00 2001 From: Richard Salac Date: Wed, 22 Jan 2025 19:09:13 +0100 Subject: [PATCH 3/5] update onboarding enabled node sample-app Signed-off-by: Richard Salac --- onboarding-enabler-nodejs-sample-app/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onboarding-enabler-nodejs-sample-app/package-lock.json b/onboarding-enabler-nodejs-sample-app/package-lock.json index 159e535da7..f7ad9804c6 100644 --- a/onboarding-enabler-nodejs-sample-app/package-lock.json +++ b/onboarding-enabler-nodejs-sample-app/package-lock.json @@ -19,7 +19,7 @@ }, "../onboarding-enabler-nodejs": { "name": "@zowe/apiml-onboarding-enabler-nodejs", - "version": "3.0.51", + "version": "3.1.4", "license": "EPL-2.0", "dependencies": { "async": "3.2.6", From 4c11b0cfb6ff992e894a21a44e0dc30fe767217e Mon Sep 17 00:00:00 2001 From: ac892247 Date: Thu, 23 Jan 2025 09:35:21 +0100 Subject: [PATCH 4/5] build dependant gradle project Signed-off-by: ac892247 --- .../build.gradle | 2 ++ onboarding-enabler-nodejs/build.gradle | 17 ++++++++++++++++- .../license-checker-config.json | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/onboarding-enabler-nodejs-sample-app/build.gradle b/onboarding-enabler-nodejs-sample-app/build.gradle index 78a9675caa..b3fcba4b8c 100644 --- a/onboarding-enabler-nodejs-sample-app/build.gradle +++ b/onboarding-enabler-nodejs-sample-app/build.gradle @@ -26,6 +26,8 @@ node { build.dependsOn npmInstall +npmInstall.dependsOn ":onboarding-enabler-nodejs:build" + task nodeClean(type: Delete) { group = 'node' if (rootProject.cleanNodeModules == 'true') { diff --git a/onboarding-enabler-nodejs/build.gradle b/onboarding-enabler-nodejs/build.gradle index ae84bcee2e..957840e7d5 100644 --- a/onboarding-enabler-nodejs/build.gradle +++ b/onboarding-enabler-nodejs/build.gradle @@ -8,12 +8,27 @@ * Copyright Contributors to the Zowe Project. */ +plugins { + alias(libs.plugins.gradle.node) +} + +node { + download = true + version = libs.versions.projectNode.get() + npmVersion = libs.versions.projectNpm.get() + distBaseUrl = "https://nodejs.org/dist" + npmInstallCommand = "ci" + workDir = file("${project.projectDir}/tools/nodejs") + npmWorkDir = file("${project.projectDir}/tools/npm") + nodeProjectDir = file("${project.projectDir}") +} + task nodeClean(type: Delete) { group = 'node' delete 'node_modules' } clean.dependsOn nodeClean - +build.dependsOn npmInstall jar { enabled false } diff --git a/onboarding-enabler-nodejs/license-checker-config.json b/onboarding-enabler-nodejs/license-checker-config.json index ede2e40b04..9d471a83e6 100644 --- a/onboarding-enabler-nodejs/license-checker-config.json +++ b/onboarding-enabler-nodejs/license-checker-config.json @@ -11,6 +11,6 @@ }, "ignore": [ "bin", "lib", "coverage", - ".*", "*.md", "*.gradle", "**/*.yml" + ".*", "*.md", "*.gradle", "**/*.yml", "tools" ] } From f3f50e57af605484f6e384456a356e21fdcaa1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Sala=C4=8D?= Date: Thu, 23 Jan 2025 10:47:48 +0100 Subject: [PATCH 5/5] disable debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Richard Salač --- .../src/test/resources/environment-configuration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/src/test/resources/environment-configuration.yml b/integration-tests/src/test/resources/environment-configuration.yml index 1dc85c0374..58a03a2b0c 100644 --- a/integration-tests/src/test/resources/environment-configuration.yml +++ b/integration-tests/src/test/resources/environment-configuration.yml @@ -97,7 +97,7 @@ instanceEnv: ZWE_configs_apiml_security_auth_zosmf_jwtAutoconfiguration: JWT ZWE_STATIC_DEFINITIONS_DIR: config/local/api-defs ZWE_configs_server_internal_enabled: true - ZWE_configs_debug: true + ZWE_configs_debug: false ZWE_configs_apiml_catalog_serviceId: apicatalog ZWE_configs_storage_size: 100 ZWE_zowe_verifyCertificates: true