Skip to content

Commit

Permalink
zwe ts edition, with configmgr (#2885)
Browse files Browse the repository at this point in the history
* Update schema files to match reality of code and also configmgr parsing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Checkpoint on configmgr-ts

Signed-off-by: 1000TurquoisePogs <[email protected]>

* WIP: getting to commands section

Signed-off-by: 1000TurquoisePogs <[email protected]>

* More wip, some unfinished files. Some left behind node code

Signed-off-by: 1000TurquoisePogs <[email protected]>

* More lib updates

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Added caching of env vars, optimized manifest reading

Signed-off-by: 1000TurquoisePogs <[email protected]>

* ObjUtils for merge, flatten, deepcopy, etc

Signed-off-by: Joe <[email protected]>

* Build files

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Temp changes

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fixes after getting pretty far in 'prepare' code. up to global validate area, stuck on java.

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Adding d.ts for all QJS stuff, introducing path library and fanout of all tsc compilation issues

Signed-off-by: Joe <[email protected]>

* WIP on prepare, up to component stage but disabled static def setup and app-server hangs

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Some fixes

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Commit where internal start prepare phase works almost 100%, just missing one or two env vars

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Multi-file is working

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Cleanup build system

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Adding integration into build

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Cleanup of console logs and adding license headers to some files

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fix mkdirp missing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Test configmgr extract

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fix typo

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fix fact that find is returning absolute path

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Cleanup configmgr pax after extract

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update index.sh

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update index.sh

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update example-zowe.yaml

The enum says this must be lowercase

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Attempt to build zwe ts

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Sync ts with latest sh changes

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Add build folder, use, the remove

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Tracing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Tracing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Tracing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Tracing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Tracing

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fix a typo making build fail

Signed-off-by: 1000TurquoisePogs <[email protected]>

* build file cleanup

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Revert template in example-zowe.yaml because it is not processable without configmgr

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Set runopts to get tagging

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Move tsc build step to prepare-workspace time to get ebcdic conversion right

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update manifest.json.template

Point at branches with schemas

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update manifest.json.template

Fix jobs/files api not found

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Fixed a bug where the shell command args were an array of strings rather than a string with spaces which caused validate.sh and preconfigure.sh not to run. now fixed and validate.sh of apiml components appear to work as expected

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Update manifest.json.template

Update versions to snapshots of mainline

Signed-off-by: 1000TurquoisePogs <[email protected]>

* Removed commented out lines

Removed commented out lines

Signed-off-by: 1000TurquoisePogs <[email protected]>

Co-authored-by: Joe <[email protected]>
Co-authored-by: Tom Zhang <[email protected]>
Co-authored-by: Joe Winchester <[email protected]>
  • Loading branch information
4 people authored Jul 6, 2022
1 parent a566771 commit ff1082d
Show file tree
Hide file tree
Showing 48 changed files with 5,713 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
with:
manifest-file-path: ${{ github.workspace }}/manifest.json
default-target-path: .pax/binaryDependencies/
expected-count: 26
expected-count: 27

# this step is not doing a publish, we are just utilizing this actions to get the PUBLISH_TARGET_PATH,
# and it will be used in the next step: [Download 3] Download SMPE build log
Expand Down
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@ tmp/
.pytest_cache/
*.pyc

# emacs save files
*~

# logs
*.log

# zip files
# archive files
# *.pax
*.zip
*.tar
*.gz
*.xz
*.bz2

# compile java binary
*.class

# nodejs
**/node_modules

# Compiled TS files
bin/libs/*.js
build/zwe/out

# Mac files
.DS_Store

Expand Down
16 changes: 15 additions & 1 deletion .pax/pre-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ BASE_DIR=$(cd $(dirname "$0"); pwd) # <something>/.pax
# use node v12 to build
export NODE_HOME=/ZOWE/node/node-v12.18.4-os390-s390x

cd "${BASE_DIR}"
ZOWE_ROOT_DIR="${BASE_DIR}/content"

cd "${BASE_DIR}"
# Done with build, remove build folder
rm -rf "${ZOWE_ROOT_DIR}/build"

ZOWE_VERSION=$(cat ${ZOWE_ROOT_DIR}/manifest.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
# add zwe command to PATH
export PATH=${ZOWE_ROOT_DIR}/bin:${PATH}
Expand Down Expand Up @@ -200,6 +204,16 @@ echo "[$SCRIPT_NAME] templates is not part of zowe.pax, moving it out ..."
mv ./content/templates .
chmod +x templates/*.rex


mkdir -p "${ZOWE_ROOT_DIR}/bin/utils"
configmgr=$(find "${ZOWE_ROOT_DIR}/files" -type f \( -name "configmgr*.pax" \) | head -n 1)
echo "[$SCRIPT_NAME] extract configmgr $configmgr"
cd "${ZOWE_ROOT_DIR}/bin/utils"
pax -ppx -rf "${configmgr}"
rm "${configmgr}"
cd "${BASE_DIR}"


echo "[$SCRIPT_NAME] create dummy zowe.yaml for install"
cat <<EOT >> "${BASE_DIR}/zowe.yaml"
zowe:
Expand Down
12 changes: 12 additions & 0 deletions .pax/prepare-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,17 @@ echo "[${SCRIPT_NAME}] preparing folders ..."
rm -fr "${ASCII_DIR}" && mkdir -p "${ASCII_DIR}"
rm -fr "${CONTENT_DIR}" && mkdir -p "${CONTENT_DIR}/bin"
mkdir -p "${CONTENT_DIR}/files"
mkdir -p "${CONTENT_DIR}/schemas"

# FIXME: remove these debug code
# rm -fr "${PAX_WORKSPACE_DIR}/binaryDependencies" && mkdir -p "${PAX_WORKSPACE_DIR}/binaryDependencies"
# cp -r "${PAX_WORKSPACE_DIR}/bak/binaryDependencies/" "${PAX_WORKSPACE_DIR}/binaryDependencies"

# Building TS files
cd "${ROOT_DIR}/build/zwe"
npm ci && npm run prod


# copy from current github source
echo "[${SCRIPT_NAME}] copying files ..."
cd "${ROOT_DIR}"
Expand All @@ -124,6 +131,11 @@ cp ZOWE.md "${CONTENT_DIR}/README.md"
cp DEVELOPERS.md "${CONTENT_DIR}/DEVELOPERS.md"
cp -R bin/* "${CONTENT_DIR}/bin"
cp -R files/* "${CONTENT_DIR}/files"
cp -R schemas/* "${CONTENT_DIR}/schemas"


# build dir should not end up in release, will be removed after build in pre-packaging phase
#cp -R build "${CONTENT_DIR}/"

# move licenses
mkdir -p "${CONTENT_DIR}/licenses"
Expand Down
1 change: 1 addition & 0 deletions bin/commands/internal/start/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright Contributors to the Zowe Project.
#######################################################################


###############################
# validation
require_zowe_yaml
Expand Down
42 changes: 42 additions & 0 deletions bin/commands/internal/start/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
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.
*/

// @ts-ignore
import * as std from 'std';
// @ts-ignore
import * as os from 'os';
// @ts-ignore
import * as zos from 'zos';
import * as common from '../../../libs/common';
//import * as stringlib from '../../../libs/string';
//import * as shell from '../../../libs/shell';
//import * as config from '../../../libs/config';
import * as internalStartPrepare from './prepare/index';
//import * as internalStartComponent from './component/index';

// Validation
common.requireZoweYaml();

// Read job name and validate
//const zoweConfig = config.getZoweConfig();

// prepare instance/.env and instance/workspace directories
internalStartPrepare.execute();

if (std.getenv('ZWE_PRIVATE_CONTAINER_COMPONENT_ID')) {
// internalStartComponent.execute(std.getenv("ZWE_PRIVATE_CONTAINER_COMPONENT_ID"), false);
//TODO ensure this waits
} else {
const launchComponents = std.getenv("ZWE_LAUNCH_COMPONENTS").split(',');
launchComponents.forEach(function(componentName:string) {
// internalStartComponent.execute(componentName, true);
});
}
13 changes: 13 additions & 0 deletions bin/commands/internal/start/prepare/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
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.
*/

import * as index from './index';
index.execute();
7 changes: 7 additions & 0 deletions bin/commands/internal/start/prepare/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# This command prepares everything needed to start Zowe.
################################################################################

if [ "${ZWE_CLI_CONFIGMGR}" = "true" ]; then
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/prepare/cli.js"
else


################################################################################
# FUNCTIONS

Expand Down Expand Up @@ -385,3 +390,5 @@ configure_components
###############################
# display instance prepared info
print_formatted_info "ZWELS" "zwe-internal-start-prepare:${LINENO}" "Zowe runtime environment prepared"

fi
Loading

0 comments on commit ff1082d

Please sign in to comment.