Skip to content

Commit

Permalink
Zowe Suite v2.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Jul 11, 2023
2 parents efbfa28 + db08e23 commit 9845e0e
Show file tree
Hide file tree
Showing 18 changed files with 398 additions and 925 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to the Zlux App Server package will be documented in this file.

## v2.10.0

- Enhancement: Migrated app-server configuration options into a "defaults.yaml" file which adheres to the schema of the Zowe config. This allows users to see the default behaviors more clearly, and can serve as an example by which users can customize their Zowe config to override such defaults. (#247)
- Bugfix: Fixed the URLs app-server would print in the logs describing where it was accessible from. Messages were incorrectly pointing at the discovery server instead of the gateway server. (#247)

## v2.9.0

- Bugfix: Recognizers from multiple plugins could not be merged due to an error in the merge code execution at startup.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ app-server.bat

When the App Server has started, one of the messages you will see as bootstrapping completes is that the server is listening on the HTTP/s port. Now, the server is ready for use.

### Troubleshooting
If you encounter an error message saying `No config file found, initializing`, it means that the App Server could not find a configuration file in the expected location.

To fix this issue, you need to create a zowe.yaml file in the following directory: `%USERPROFILE%\.zowe\workspace\app-server\serverConfig`. You can use [this](https://github.com/zowe/zlux-app-server/blob/v2.x/staging/defaults/serverConfig/zowe.yaml) template as a starting point.

### Server Logs
When the server starts, it writes logs to a text file. On z/OS, Unix, and Linux, the server also logs to the terminal via stdout.
To view the entire logs, you can find the log file within the location specified by the zowe server configuration parameter `zowe.logDirectory`, but will default to `~/.zowe/logs` or `%USERPROFILE%/.zowe/logs` (Windows) if not specified. The log file starts with "appServer" and the filename may also include a timestamp.
Expand Down
117 changes: 1 addition & 116 deletions bin/app-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,119 +7,4 @@
#
# Copyright Contributors to the Zowe Project.


# Required variables on shell:
# - ZWE_zowe_runtimeDirectory
# - ZWE_zowe_workspaceDirectory
# - NODE_HOME
#
# Optional variables on shell:
# - APIML_ENABLE_SSO
# - GATEWAY_PORT
# - DISCOVERY_PORT
# - ZWED_SSH_PORT
# - ZWED_TN3270_PORT
# - ZWED_TN3270_SECURITY

if [ -z "${ZWE_zowe_runtimeDirectory}" ]
then
#this may be a dev environment, or backward compat, so stay in current dir and check node
. ./validate.sh
fi

if [ ! -e "${dir}/utils/convert-env.sh" ]
then
if [ -n "$CONDA_PREFIX" ]
then
dir="$CONDA_PREFIX/share/zowe/app-server/zlux-app-server/bin"
cd $dir
fi
fi

. ./utils/convert-env.sh
. ./init/node-init.sh

if [ -e "$ZLUX_CONFIG_FILE" ]
then
CONFIG_FILE=$ZLUX_CONFIG_FILE
elif [ -e "$ZWE_CLI_PARAMETER_CONFIG" ]
then
CONFIG_FILE="$ZWE_CLI_PARAMETER_CONFIG"
elif [ -z "${ZWE_zowe_runtimeDirectory}" ]
then
#dev env or backwards compat, do late configure
# should we also export ZWE_zowe_workspaceDirectory=~/.zowe/zowe.yaml?
# potentially zowe.yaml in there could point workspaceDirectory elsewhere to cause further confusion
. ./init/workspace-init.sh
CONFIG_FILE=~/.zowe/zowe.yaml
fi

# Will skip log trimming if ZWED_NODE_LOG_FILE already defined (such as by start.sh)
. ./utils/setup-logs.sh

#Determined log file. Run node appropriately.
cd ../lib

export ZOWE_LIB_DIR=$(pwd)
export ZLUX_ROOT_DIR=$(cd ../..; pwd)

export "_CEE_RUNOPTS=XPLINK(ON),HEAPPOOLS(ON)"

echo Show Environment
env

if [ -z "$ZOWE_WORKING_DIR" ]
then
export ZOWE_WORKING_DIR=$ZOWE_LIB_DIR
else
echo "Server is about to start with a non default working directory. Working dir=$ZOWE_WORKING_DIR"
fi

cd $ZOWE_WORKING_DIR

export ZWED_NODE_LOG_FILE=$ZWED_NODE_LOG_FILE

echo Starting node
if [ -z "$ZLUX_NO_CLUSTER" ]
then
ZLUX_SERVER_FILE=zluxCluster.js
if [ -z "$ZLUX_MIN_WORKERS" ]
then
export ZLUX_MIN_WORKERS=2
fi
else
ZLUX_SERVER_FILE=zluxServer.js
fi

# Tells node whether to prefer ipv4 or ipv6 results to DNS lookups
ZLUX_DNS_ORDER="--dns-result-order=ipv4first"
if [ "$ZWE_components_app_server_dns_lookupOrder" = "ipv6" ]; then
ZLUX_DNS_ORDER="--dns-result-order=verbatim"
fi

# not all versions of node support the above (14.18+ generally) so we can just try it to see what happens.
v4_check=$(${NODE_BIN} ${ZLUX_DNS_ORDER} -e "console.log('success');")
if [ "${v4_check}" != "success" ]; then
ZLUX_DNS_ORDER=
fi

if [ -z "$ZLUX_NO_LOGFILE" ]; then
__UNTAGGED_READ_MODE=V6 \
_BPX_JOBNAME=${ZOWE_PREFIX}DS \
${NODE_BIN} \
--harmony \
${ZLUX_DNS_ORDER} \
${ZOWE_LIB_DIR}/${ZLUX_SERVER_FILE} \
--config="${CONFIG_FILE}" "$@" 2>&1 | tee $ZWED_NODE_LOG_FILE
else
__UNTAGGED_READ_MODE=V6 \
_BPX_JOBNAME=${ZOWE_PREFIX}DS \
${NODE_BIN} \
--harmony \
${ZLUX_DNS_ORDER} \
${ZOWE_LIB_DIR}/${ZLUX_SERVER_FILE} \
--config="${CONFIG_FILE}" "$@"
echo "Ended with rc=$?"
fi


./start.sh
32 changes: 30 additions & 2 deletions bin/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,38 @@ if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then
fi

cd ${COMPONENT_HOME}/share/zlux-app-server/bin
. ./utils/convert-env.sh

if [ -n "$ZWE_components_app_server_node_mediationLayer_enabled" -a -z "$ZWE_components_app_server_agent_mediationLayer_enabled" ]; then
if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then
zss_def_template="zss.apiml_static_reg.yaml.template"
zss_configured=false
if [ -n "${ZWE_components_app_server_agent_https_port}" ]; then
export ZSS_PORT="${ZWE_components_app_server_agent_https_port}"
export ZSS_PROTOCOL=https
zss_configured=true
elif [ -n "${ZWED_components_app_server_agent_http_port}" ]; then
export ZSS_PORT="${ZWE_components_app_server_http_port}"
export ZSS_PROTOCOL=http
zss_configured=true
fi

if [ "${zss_configured}" = "true" ] && [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then
zss_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/zss.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml
zss_def="../${zss_def_template}"
zss_parsed_def=$( ( echo "cat <<EOF" ; cat "${zss_def}" ; echo ; echo EOF ) | sh 2>&1)
echo "${zss_parsed_def}" > "${zss_registration_yaml}"
chmod 770 "${zss_registration_yaml}"
fi

unset ZSS_PORT
unset ZSS_PROTOCOL
fi
fi


. ./init/node-init.sh
cd ../lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js
CONFIG_FILE=$ZWE_CLI_PARAMETER_CONFIG $NODE_BIN initInstance.js

cd ${COMPONENT_HOME}/share/zlux-app-server/bin/init
if [ "${ZWE_zowe_useConfigmgr}" = "true" ]; then
Expand Down
51 changes: 21 additions & 30 deletions bin/init/node-init.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
if [ -n "$NODE_HOME" ]
then
NODE_BIN=${NODE_HOME}/bin/node
#!/bin/sh
# This program and the accompanying materials are
# made available under the terms of the Eclipse Public License v2.0 which accompanies
# this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Copyright Contributors to the Zowe Project.

if [ -n "$NODE_HOME" ]; then
export NODE_BIN=${NODE_HOME}/bin/node
export PATH=${NODE_HOME}/bin:$PATH
elif [ -n "$ZOWE_NODE_HOME" ]
then
NODE_BIN=${ZOWE_NODE_HOME}/bin/node
export PATH=${ZOWE_NODE_HOME}/bin:$PATH
else
NODE_BIN=node
export NODE_BIN=node
fi

export NODE_BIN

if [ ! -e "${ZWE_zowe_runtimeDirectory}/bin/internal/zowe-set-env.sh" ]; then
RUN_ON_ZOS=$(test `uname` = "OS/390" && echo "true")
if [ "${RUN_ON_ZOS}" = "true" ]; then
export "_CEE_RUNOPTS=XPLINK(ON),HEAPPOOLS(ON)"
export _BPXK_AUTOCVT=ON
export __UNTAGGED_READ_MODE=V6

nodeVersion="$(${NODE_BIN} --version)"
nodeMajorVersion=$(echo ${nodeVersion} | cut -c2-3)
if [ $nodeMajorVersion -ge "12" ]
then
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
fi

fi
else
. ${ZWE_zowe_runtimeDirectory}/bin/internal/zowe-set-env.sh
fi
# These are used on z/OS and ignored elsewhere.
# Some are already applied by zwe, but in dev, we add them.
# They control text encoding primarily.
export "_CEE_RUNOPTS=XPLINK(ON),HEAPPOOLS(ON)"
export _BPXK_AUTOCVT=ON
export __UNTAGGED_READ_MODE=V6
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt

export NODE_PATH=../..:../../zlux-server-framework/node_modules:$NODE_PATH

30 changes: 1 addition & 29 deletions bin/init/workspace-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,4 @@
#ZLUX_CONFIG_FILE and ZWE_zowe_workspaceDirectory are for official Zowe environment use.
#If none found, will assume dev environment and consider ~/.zowe/workspace as ZWE_zowe_workspaceDirectory

if [ -n "${ZWE_zowe_workspaceDirectory}" ]
then
if [ -e "${ZWE_zowe_workspaceDirectory}/app-server/serverConfig/zowe.yaml" ]
then
export CONFIG_FILE="${ZWE_zowe_workspaceDirectory}/app-server/serverConfig/zowe.yaml"
else
cd ../../lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js
export CONFIG_FILE="${ZWE_zowe_workspaceDirectory}/app-server/serverConfig/zowe.yaml"
fi
elif [ -e "${HOME}/.zowe/workspace/app-server/serverConfig/zowe.yaml" ]
then
export CONFIG_FILE="${HOME}/.zowe/workspace/app-server/serverConfig/zowe.yaml"
if [ -z "${ZWE_zowe_logDirectory}" ]; then
export ZWE_zowe_logDirectory="${HOME}/.zowe/logs"
fi
mkdir -p ${ZWE_zowe_logDirectory}
export WORKSPACE_DIR="${HOME}/.zowe/workspace"
else
echo "No config file found, initializing..."
export WORKSPACE_DIR="${HOME}/.zowe/workspace"
if [ -z "${ZWE_zowe_logDirectory}" ]; then
export ZWE_zowe_logDirectory="${HOME}/.zowe/logs"
fi
mkdir -p ${ZWE_zowe_logDirectory}
cd ../../lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js
export CONFIG_FILE="${HOME}/.zowe/workspace/app-server/serverConfig/zowe.yaml"
fi

Loading

0 comments on commit 9845e0e

Please sign in to comment.