Skip to content

Commit

Permalink
Zowe Suite v1.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Oct 13, 2021
2 parents 8cdfd41 + cb4c742 commit 0ea9fcc
Show file tree
Hide file tree
Showing 15 changed files with 275 additions and 65 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

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

## v1.25.0

- Enhancement: Changed how app-server scripts locate app-server directories so that they work in container mode, where the folder layout is different. This unifies container and non-container location behavior.
- Enhancement: Use GATEWAY_HOST env var over ZOWE_EXPLORER_HOST to find mediation layer gateway if hostname not explicitly specified elsewhere

## v1.24.0

- Bugfix: IP Explorer was not installed upon upgrade, only on new installs.


## v1.23.0

- Bugfix: Sync state of certificate verification of zlux with keystore configuration, so that certificate verification can be turned on or off centrally
Expand Down
4 changes: 2 additions & 2 deletions bin/app-install-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# This script is placholder from server-bundle install apps, based on apps mountpoint
if [ -d "${apps_dir}" ]; then
export ZLUX_SHARE=/home/zowe/install/components/app-server/share
export ZLUX_SHARE=/component/share
cd ${apps_dir}
for D in */;
do
Expand All @@ -31,4 +31,4 @@ if [ -d "${apps_dir}" ]; then
$ROOT_DIR/bin/zowe-install-component.sh -o ${apps_dir}/$D -i $INSTANCE_DIR
fi
done
fi
fi
1 change: 1 addition & 0 deletions bin/app-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ fi
cd ../lib

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

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

Expand Down
4 changes: 2 additions & 2 deletions bin/configure-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ mkdir -p ${LOG_DIR}
chmod 777 ${LOG_DIR}
export LOG_FILE=${LOG_DIR}/"configure-app-server`date +%Y-%m-%d-%H-%M-%S`.log"

# cd ${ZOWE_ROOT_DIR}/components/app-server/share/zlux-app-server/bin
./internal-install.sh
# cd /component/bin
./internal-install.sh
13 changes: 11 additions & 2 deletions bin/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@
# - ROOT_DIR
# - WORKSPACE_DIR
# - NODE_HOME
cd ${ROOT_DIR}/components/app-server/share/zlux-app-server/bin
COMPONENT_HOME=${ROOT_DIR}/components/app-server

# containers only
if [ ! -f "${COMPONENT_HOME}/manifest.yaml" ]; then
if [ -f "/component/manifest.yaml" ]; then
COMPONENT_HOME=/component
fi
fi

cd ${COMPONENT_HOME}/share/zlux-app-server/bin
. ./convert-env.sh
. ./internal-node-init.sh
cd ${ROOT_DIR}/components/app-server/share/zlux-app-server/lib
cd ${COMPONENT_HOME}/share/zlux-app-server/lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js
42 changes: 28 additions & 14 deletions bin/convert-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,23 @@ then
fi
fi

if [ -z "$ZWED_node_mediationLayer_server_hostname" ]
then
if [ -n "$ZOWE_EXPLORER_HOST" ]
then
if [ -z "$ZWED_node_mediationLayer_server_hostname" ]; then
if [ -n "$GATEWAY_HOST" ]; then
export ZWED_node_mediationLayer_server_hostname=$GATEWAY_HOST
elif [ -n "$ZOWE_EXPLORER_HOST" ]; then
export ZWED_node_mediationLayer_server_hostname=$ZOWE_EXPLORER_HOST
if [ -n "$ZWED_node_mediationLayer_server_port" ]
then
case "$LAUNCH_COMPONENT_GROUPS" in
*GATEWAY*)
#All conditions met for app-server behind gateway: hostname, port, and component
export ZWED_node_mediationLayer_enabled="true"
;;
esac
fi
fi
fi

if [ -n "$ZWED_node_mediationLayer_server_port" -a -n "$ZWED_node_mediationLayer_server_hostname" ]; then
case "$LAUNCH_COMPONENT_GROUPS" in
*GATEWAY*)
#All conditions met for app-server behind gateway: hostname, port, and component
export ZWED_node_mediationLayer_enabled="true"
;;
esac
fi

if [ -z "$ZWED_node_mediationLayer_enabled" ]; then
export ZWED_node_mediationLayer_enabled="false"
elif [ -z "$ZWED_agent_mediationLayer_enabled" ]; then
Expand Down Expand Up @@ -119,6 +120,7 @@ fi
# certificates
if [ "$VERIFY_CERTIFICATES" = "false" ]; then
export ZWED_node_allowInvalidTLSProxy=true
export NODE_TLS_REJECT_UNAUTHORIZED=0
fi
if [ -z "$ZWED_node_https_certificates" ]
then
Expand Down Expand Up @@ -206,7 +208,19 @@ if [ -z "$ZWED_productDir" ]
then
if [ -n "$ROOT_DIR" ]
then
export ZWED_productDir=$ROOT_DIR/components/app-server/share/zlux-app-server/defaults
COMPONENT_HOME=${ROOT_DIR}/components/app-server

# containers only
if [ ! -f "${COMPONENT_HOME}/manifest.yaml" ]; then
if [ -f "/component/manifest.yaml" ]; then
COMPONENT_HOME=/component
if [ -z "$ZWED_node_pluginScanIntervalSec" ]; then
# container needs plugin scanning logic on
export ZWED_node_pluginScanIntervalSec=60
fi
fi
fi
export ZWED_productDir=$COMPONENT_HOME/share/zlux-app-server/defaults
fi
fi

Expand Down
43 changes: 34 additions & 9 deletions bin/install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,27 @@ then
then
. "${dir}/../instance.env"
fi
zlux_path="$ROOT_DIR/components/app-server/share"
setVars
if [ ! -e "${INSTANCE_DIR}/workspace/app-server/serverConfig/server.json" ]
then
cd ${zlux_path}/zlux-app-server/lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js

COMPONENT_HOME=${ROOT_DIR}/components/app-server

# containers only
if [ ! -f "${COMPONENT_HOME}/manifest.yaml" ]; then
# these files may exist in other containers where this script is run from, rather than just zlux
if [ -f "/component/manifest.yaml" -o -f "/component/manifest.json" -o -f "/component/manifest.yml" ]; then
COMPONENT_HOME=/component
ZLUX_CONTAINER_MODE=1
INSTALL_NO_NODE=1
fi
fi

if [ -z "$INSTALL_NO_NODE" ]; then
zlux_path="$COMPONENT_HOME/share"
setVars
if [ ! -e "${INSTANCE_DIR}/workspace/app-server/serverConfig/server.json" ]
then
cd ${zlux_path}/zlux-app-server/lib
__UNTAGGED_READ_MODE=V6 $NODE_BIN initInstance.js
fi
fi
elif [ -d "${dir}/../../zlux-server-framework" ]
then
Expand All @@ -64,7 +79,11 @@ shift

if [ -z "$plugin_dir" ]
then
if [ -e "${INSTANCE_DIR}/workspace/app-server/serverConfig/server.json" ]
if [ "$ZLUX_CONTAINER_MODE" = "1" ]
then
#container, plugins folder in fixed location
fallback_inst=${INSTANCE_DIR}
elif [ -e "${INSTANCE_DIR}/workspace/app-server/serverConfig/server.json" ]
then
json_path=${INSTANCE_DIR}/workspace/app-server/serverConfig/server.json
fallback_inst=${INSTANCE_DIR}
Expand All @@ -83,8 +102,6 @@ This configuration should be migrated for use with future versions. See document
fi


cd $zlux_path/zlux-app-server/bin

installNojs() {
echo "NodeJS not found or not requested, attempting fallback plugin install behavior"
# Installs a zowe plugin by finding its ID and writing the locator json WITHOUT using install-app.js
Expand All @@ -104,6 +121,12 @@ installNojs() {
then
echo "Found plugin=${id}"

if [ "$ZLUX_CONTAINER_MODE" = "1" ]
then
# install script expected to copy the plugin into this location. could be done manually too.
app_path=$INSTANCE_DIR/workspace/app-server/pluginDirs/${id}
fi

cat <<EOF >${fallback_inst}/workspace/app-server/plugins/${id}.json
{
"identifier": "${id}",
Expand All @@ -121,6 +144,8 @@ if [ -n "$INSTALL_NO_NODE" ]
then
installNojs
else
cd $zlux_path/zlux-app-server/bin

echo "Testing if node exists"
type ${NODE_BIN}
rc=$?
Expand Down
15 changes: 7 additions & 8 deletions bin/install-container.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#RUNTIME PATHS
ZLUX_RUNTIME=${ROOT_DIR}/components/app-server
ZLUX_APP_SERVER=${ZLUX_RUNTIME}/share/zlux-app-server
ZLUX_APP_SERVER=${ZWED_INSTALL_DIR}/share/zlux-app-server

# create runtime bin
mkdir -p ${ZLUX_RUNTIME}/bin
cp ${ZLUX_APP_SERVER}/manifest.yaml ${ZLUX_RUNTIME}
cp ${ZLUX_APP_SERVER}/bin/start.sh ${ZLUX_RUNTIME}/bin
cp ${ZLUX_APP_SERVER}/bin/configure.sh ${ZLUX_RUNTIME}/bin
cp ${ZLUX_APP_SERVER}/bin/start-container.sh ${ZLUX_RUNTIME}/bin
mkdir -p ${ZWED_INSTALL_DIR}/bin
cp ${ZLUX_APP_SERVER}/manifest.yaml ${ZWED_INSTALL_DIR}
cp ${ZLUX_APP_SERVER}/bin/start.sh ${ZWED_INSTALL_DIR}/bin
cp ${ZLUX_APP_SERVER}/bin/configure.sh ${ZWED_INSTALL_DIR}/bin
cp ${ZLUX_APP_SERVER}/bin/start-container.sh ${ZWED_INSTALL_DIR}/bin

#INSTANCE PATHS
ZLUX_WORKSPACE=${WORKSPACE_DIR}/app-server
Expand All @@ -20,4 +19,4 @@ cd ${ZLUX_APP_SERVER}/bin
./configure-container.sh

#cleanup
rm -rf ${INSTALL_DIR}/files
rm -rf ${ZWED_INSTALL_DIR}/files
36 changes: 24 additions & 12 deletions bin/internal-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ then
fi

umask 0002
APP_SERVER_COMPONENT_DIR=${ZOWE_ROOT_DIR}/components/app-server
COMPONENT_HOME=${ZOWE_ROOT_DIR}/components/app-server

cd ${APP_SERVER_COMPONENT_DIR}/share
for paxfile in ${INSTALL_DIR}/files/zlux/*.pax
if [ -z $ZWED_INSTALL_DIR ]; then
ZWED_INSTALL_DIR=${INSTALL_DIR}
fi

# containers only
if [ ! -f "${COMPONENT_HOME}/manifest.yaml" ]; then
if [ -f "/component/manifest.yaml" ]; then
COMPONENT_HOME=/component
fi
fi


cd ${COMPONENT_HOME}/share
for paxfile in ${ZWED_INSTALL_DIR}/files/zlux/*.pax
do
if [ ! -f $paxfile ]; then
echo "No Pax Files"
Expand All @@ -43,8 +55,8 @@ do
cd ..
done

cd ${APP_SERVER_COMPONENT_DIR}/share
tar_path=${INSTALL_DIR}/files/zlux
cd ${COMPONENT_HOME}/share
tar_path=${ZWED_INSTALL_DIR}/files/zlux
for tarfile in ${tar_path}/*.tar ; do
if [ ! -f $tarfile ]; then
echo "No Tar Files"
Expand All @@ -57,15 +69,15 @@ for tarfile in ${tar_path}/*.tar ; do
mv ${tar_path}/${pluginName} .
done

cd ${APP_SERVER_COMPONENT_DIR}/share/
cd ${COMPONENT_HOME}/share/

chtag -tc 1047 ${INSTALL_DIR}/files/zlux/config/*.json
chtag -tc 1047 ${INSTALL_DIR}/files/zlux/config/plugins/*.json
chtag -tc 1047 ${ZWED_INSTALL_DIR}/files/zlux/config/*.json
chtag -tc 1047 ${ZWED_INSTALL_DIR}/files/zlux/config/plugins/*.json
chmod -R u+w zlux-app-server 2>/dev/null

mkdir -p zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.ng2desktop/ui/launchbar/plugins
cp -f ${INSTALL_DIR}/files/zlux/config/pinnedPlugins.json zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.ng2desktop/ui/launchbar/plugins/
cp -f ${ZWED_INSTALL_DIR}/files/zlux/config/pinnedPlugins.json zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.ng2desktop/ui/launchbar/plugins/
mkdir -p zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.bootstrap/plugins
cp -f ${INSTALL_DIR}/files/zlux/config/allowedPlugins.json zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.bootstrap/plugins/
cp -f ${INSTALL_DIR}/files/zlux/config/zluxserver.json zlux-app-server/defaults/serverConfig/server.json
cp -f ${INSTALL_DIR}/files/zlux/config/plugins/* zlux-app-server/defaults/plugins
cp -f ${ZWED_INSTALL_DIR}/files/zlux/config/allowedPlugins.json zlux-app-server/defaults/ZLUX/pluginStorage/org.zowe.zlux.bootstrap/plugins/
cp -f ${ZWED_INSTALL_DIR}/files/zlux/config/zluxserver.json zlux-app-server/defaults/serverConfig/server.json
cp -f ${ZWED_INSTALL_DIR}/files/zlux/config/plugins/* zlux-app-server/defaults/plugins
5 changes: 4 additions & 1 deletion bin/start-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# Copyright IBM Corporation 2021 #
# #
#########################################################################################

export ZWED_node_container=true
export ZLUX_ROOT_DIR=/component/share
# kubernetes clusters provide their own clustering
export ZLUX_NO_CLUSTER=1
./configure.sh # create instance directory
./start.sh #
14 changes: 12 additions & 2 deletions bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@

if [ -n "${ROOT_DIR}" ]
then
#not a dev env
cd ${ROOT_DIR}/components/app-server/share/zlux-app-server/bin
#not a dev env

COMPONENT_HOME=${ROOT_DIR}/components/app-server

# containers only
if [ ! -f "${COMPONENT_HOME}/manifest.yaml" ]; then
if [ -f "/component/manifest.yaml" ]; then
COMPONENT_HOME=/component
fi
fi

cd ${COMPONENT_HOME}/share/zlux-app-server/bin
fi
./app-server.sh
Loading

0 comments on commit 0ea9fcc

Please sign in to comment.