Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zwe support in typescript #4147

Open
wants to merge 22 commits into
base: v3.x/staging
Choose a base branch
from

Conversation

Martin-Zeithaml
Copy link
Contributor

@Martin-Zeithaml Martin-Zeithaml commented Jan 22, 2025

Part of the NodeJS removal: the command zwe support is depending on NodeJS via popular function read_yaml.

This PR is using typescript/javascript and configmgr features to eliminate the NodeJS dependency.

Following is updated:

  • zwe support
  • zwe support verify-fingerprints

Changes comparing to current state:

  • requireNode is accepting a parameter to do a node check, but without error if node it not found => node is optional
  • Environment result in JSON format
  • CEE RUNTIME without messages FSUM2051I | FSUM2052I
  • ps output without me (see comments in the code)
  • Additional information:
    • keytool showinfo -tls
    • If node and discovery, check zOSMF
    • Filesystem (where zowe.runtimeDirectory is) flags
    • zssServer | zssServer64 PC extended attribute

Example of environment output (ciphers and cee shortened, otherwise there is usually more):

{
  "zos-version": "3.1",
  "node": "18.1.2.3",
  "zosmf_check": "'https://example.com:1234/zosmf/info' => true",
  "java": "java version 17.0.10 2024-01-16",
  "keytool_showinfo_tls": [
    "Enabled Protocols",
    "-----------------",
    "TLSv1.3",
    "TLSv1.2",
    "",
    "Enabled Cipher Suites",
    "---------------------",
    "TLS_AES_1024_GCM_SHA384",
    "TLS_FULL_RENEGOTIATION_INFO_SCSV"
  ],
  "esm": "TSS",
  "cee_runtime": [
    "OMVS RUNOPTS('RPTOPTS(ON)')",
    "Options Report for Enclave main 01/22/25 7:51:19 AM",
    "Language Environment V03 R01.00",
    "LAST WHERE SET                 OPTION",
    "-------------------------------------------------------------------------------",
    "PARMLIB(CEEPRM00)                ABPERC(NONE)",
    "PARMLIB(CEEPRM00)                XUFLOW(AUTO)"
  ],
  "fs_flags": {
    "exported": true,
    "rdonly": true,
    "nosuid": false,
    "nosecurity": false
  },
  "zss_program_controlled": {
    "31bit": "Missing file: /zowe/components/zss/bin/zssServer",
    "64bit": "/zowe/components/zss/bin/zssServer64 = true"
  }
}

Test results

Simple testing framework was used (using QuickJS via configmgr), output omitted (a lot of CEE & TLS lines).

[Time elapsed]: 00:04:11

    ..::|[ T E S T     O V E R V I E W ]|::..
    -----------------------------------------

[ 1/12][expected rc=100, result rc=100  ]: /zowe/bin/zwe support --help

[ 2/12][expected rc=  1, result rc=  1  ]: /zowe/bin/zwe support
[     ][Description                     ]: configmgr fails with rc=1

[ 3/12][expected rc=  1, result rc=  1  ]: /zowe/bin/zwe support --config /dev/null
[     ][Description                     ]: configmgr fails with rc=1

[ 4/12][expected rc=  1, result rc=  1  ]: /zowe/bin/zwe support --target-dir ./pax [ZWE_CLI_PARAMETER_CONFIG=FILE(./yaml/zowe.nothing.yaml)]
[     ][Description                     ]: Missing workspace directory
[     ]['Could not write .zowe-merged.yaml' found]

[ 5/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support -c ./yaml/zowe.basic.yaml --target-dir ./pax
[     ][Description                     ]: Output in pax dir
[     ]['"java": "java version' found   ]
[     ]['"zos-version": "3.1",' found   ]

[ 6/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support -c 'FILE(./yaml/zowe.node.yaml):PARMLIB(ZOWE.YAML(#4147\$1))' --target-dir ./pax --log-dir ./cmdLog
[     ][Description                     ]: File and PARMLIB

[ 7/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support -c ./yaml/zowe.node.yaml --target-dir ./pax --log-dir ./cmdLog
[     ][Description                     ]: Node set
[     ]['"node": "v18' found            ]

[ 8/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support -c ./yaml/zowe.zosmf.yaml --target-dir ./pax
[     ][Description                     ]: zOSMF check
[     ]['"zosmf_check": "'https://' found]

[ 9/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support -c ./yaml/zowe.basic.yaml --target-dir ./pax
[     ][Description                     ]: Change program controlled attribute: extattr -p zssServer
[     ]['zssServer = false' found       ]

[10/12][expected rc=100, result rc=100  ]: /zowe/bin/zwe support verify-fingerprints --help

[11/12][expected rc=  0, result rc=  0  ]: /zowe/bin/zwe support verify-fingerprints
[     ][Description                     ]: Standalone verify fingerprints

[12/12][expected rc=181, result rc=181  ]: /zowe/bin/zwe support verify-fingerprints --trace
[     ][Description                     ]: Copy file to runtime and verify fingerprints with trace

Signed-off-by: Martin Zeithaml <[email protected]>
@Martin-Zeithaml Martin-Zeithaml added zwe Config Manager Related to the config manager component v3 labels Jan 22, 2025
Copy link

github-actions bot commented Jan 22, 2025

build 6798 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12909415593

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6799 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12909453430

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6800 FAILED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12909582166

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6801 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12909737459

Copy link

github-actions bot commented Jan 22, 2025

Test workflow 5989 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6801-20250122140009.pax
Running on machine: zzow10
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12909821364

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6802 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12910399565

Copy link

github-actions bot commented Jan 22, 2025

Test workflow 5990 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6802-20250122143450.pax
Running on machine: zzow11
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12910490689

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6803 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12911100210

Copy link

github-actions bot commented Jan 22, 2025

Test workflow 5991 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6803-20250122151234.pax
Running on machine: zzow10
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12911217979

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 22, 2025

build 6805 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12912226532

Copy link

github-actions bot commented Jan 22, 2025

Test workflow 5993 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6805-20250122160914.pax
Running on machine: zzow11
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12912315137

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 23, 2025

build 6810 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12928276250

Copy link

github-actions bot commented Jan 23, 2025

Test workflow 5998 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6810-20250123113556.pax
Running on machine: zzow11
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12928352866

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 27, 2025

Test workflow 6023 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6857-20250127152413.pax
Running on machine: zzow11
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12992340863

@Martin-Zeithaml Martin-Zeithaml changed the title zwe support in typescript [DO NOT MERGE] zwe support in typescript Jan 27, 2025
Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 27, 2025

build 6858 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12992945886

Copy link

github-actions bot commented Jan 27, 2025

Test workflow 6025 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6858-20250127160744.pax
Running on machine: zzow10
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/12993191528

@Martin-Zeithaml Martin-Zeithaml changed the title [DO NOT MERGE] zwe support in typescript zwe support in typescript Jan 28, 2025
CHANGELOG.md Outdated Show resolved Hide resolved
}
}
} else {
environment["node"] = `not found`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add environment["zosmf_check"] = <url> => not checked ? Capturing the URL could still be useful when node is not available. Second question: is it useful to capture this when discovery is disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following code was made based on internal start prepare:

  • If discovery, check zOSMF -> when we really need zOSMF
  • Other possible cases not supported
  • URL can be always recreated from zowe.yaml config

I am OK to change this to try to do a check in more cases.

bin/commands/support/index.ts Show resolved Hide resolved
bin/commands/support/verify-fingerprints/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@MarkAckert MarkAckert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 29, 2025

build 6870 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13027363215

Copy link

github-actions bot commented Jan 29, 2025

Test workflow 6036 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6870-20250129083643.pax
Running on machine: zzow11
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13027461388

Copy link

github-actions bot commented Jan 29, 2025

build 6876 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13036458443

Copy link

github-actions bot commented Jan 29, 2025

Test workflow 6041 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6876-20250129170757.pax
Running on machine: zzow09
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13036600624

Copy link

github-actions bot commented Jan 30, 2025

build 6889 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13048392976

Copy link

github-actions bot commented Jan 30, 2025

Test workflow 6048 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6889-20250130083549.pax
Running on machine: zzow10
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13048496017

Signed-off-by: Martin Zeithaml <[email protected]>
Copy link

github-actions bot commented Jan 30, 2025

build 6890 SUCCEEDED.
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13048895691

Copy link

github-actions bot commented Jan 30, 2025

Test workflow 6049 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.1.0-PR-4147/zowe-3.1.0-pr-4147-6890-20250130090707.pax
Running on machine: zzow09
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13048981956

@Martin-Zeithaml
Copy link
Contributor Author

Testing of zwe support verify-fingerprints with Java 8, 11 and 17. Test for Java 17 is failing on finding extra file, which was added before the execution.

! [misc.unExportEnv]: ZWE_CLI_PARAMETER_CONFIG=
  [1/3]: /zowe/bin/zwe support verify-fingerprints -vv
! [misc.exportEnv]: JAVA_HOME=/sys/java64bt/v8r0m0/usr/lpp/java/current_64
! [Output]:
===============================================================================
>> VERIFY ZOWE FILE FINGERPRINTS

ERROR: Java 1.8.0_411 is less than the minimum level required of Java 17.
ERROR: Error ZWEL0122E Cannot find java. Please define JAVA_HOME environment variable.
+ [1/3][expected rc=122, result rc=122  ]: /zowe/bin/zwe support verify-fingerprints -vv
  [   ][Description                     ]: Java 8 -> not supported for v3
+ [   ]['is less than the minimum level required of Java' found]
! [misc.unExportEnv]: JAVA_HOME=
  [1/3]: --------------------------------

  [2/3]: /zowe/bin/zwe support verify-fingerprints -vv
! [misc.exportEnv]: JAVA_HOME=/sys/java64bt/v11r0m0/usr/lpp/java/current_64
! [Output]:
===============================================================================
>> VERIFY ZOWE FILE FINGERPRINTS

ERROR: Java 11.0.22 2024-01-16 is less than the minimum level required of Java 17.
ERROR: Error ZWEL0122E Cannot find java. Please define JAVA_HOME environment variable.
+ [2/3][expected rc=122, result rc=122  ]: /zowe/bin/zwe support verify-fingerprints -vv
  [   ][Description                     ]: Java 11 -> not supported for v3
+ [   ]['is less than the minimum level required of Java' found]
! [misc.unExportEnv]: JAVA_HOME=
  [2/3]: --------------------------------

  [3/3]: /zowe/bin/zwe support verify-fingerprints --trace
! [misc.exportEnv]: JAVA_HOME=/sys/java64bt/v17r0m0/usr/lpp/java/current_64
! [misc.shellCmd]: cp ./run_test.sh /zowe/
! [misc.shellCmd]: 0

! [misc.shellCmd]: ----------------------------------------------------------------
! [Output]:
===============================================================================
>> VERIFY ZOWE FILE FINGERPRINTS

Java 17.0.10 2024-01-16 is supported.
Java check is successful.
- Create Zowe directory file list
  > Check if either TMPDIR or TMP points to writable directory, else try '/tmp' directory
  > create_tmp_file on /tmp
    - test /tmp/zwe-support-verify-fingerprints-5277
    - good
  * File list created as /tmp/zwe-support-verify-fingerprints-5277
- Calculate hashes of Zowe files
  > Check if either TMPDIR or TMP points to writable directory, else try '/tmp' directory
  > create_tmp_file on /tmp
    - test /tmp/zwe-support-verify-fingerprints-6228
    - good
fs.fileSize path="/tmp/zwe-support-verify-fingerprints-6228"
fs.fileSize result="[{"dev":594,"ino":61318,"mode":50332068,"nlink":1,"uid":110000020,"gid":1,"rdev":0,"size":1377881,"blocks":1360,"atime":1738236753000,"mtime":1738236760000,"ctime":1738236760000,"extattrs":0,"isText":true,"ccsid":1047},0]"
  * Zowe file hashes created as /tmp/zwe-support-verify-fingerprints-6228
- Find different files
  * Number of different files: 1
  * All different files:
        ./run_test.sh

- Find extra files
  * Number of extra files: 1
  * All extra files:
./run_test.sh

- Find missing files

ERROR: Error ZWEL0181E: Failed to verify Zowe file fingerprints.
+ [3/3][expected rc=181, result rc=181  ]: /zowe/bin/zwe support verify-fingerprints --trace
  [   ][Description                     ]: Copy file to runtime and verify fingerprints with trace
! [misc.unExportEnv]: JAVA_HOME=
! [misc.shellCmd]: rm /zowe/run_test.sh
! [misc.shellCmd]: 0

! [misc.shellCmd]: ----------------------------------------------------------------
  [3/3]: --------------------------------

! [Time elapsed]: 00:00:57

    ..::|[ T E S T     O V E R V I E W ]|::..
    -----------------------------------------

+ [1/3][expected rc=122, result rc=122  ]: /zowe/bin/zwe support verify-fingerprints -vv
  [   ][Description                     ]: Java 8 -> not supported for v3
+ [   ]['is less than the minimum level required of Java' found]
+ [2/3][expected rc=122, result rc=122  ]: /zowe/bin/zwe support verify-fingerprints -vv
  [   ][Description                     ]: Java 11 -> not supported for v3
+ [   ]['is less than the minimum level required of Java' found]
+ [3/3][expected rc=181, result rc=181  ]: /zowe/bin/zwe support verify-fingerprints --trace
  [   ][Description                     ]: Copy file to runtime and verify fingerprints with trace

export function execute(doNotExit: Boolean): void {

common.printLevel0Message('Verify Zowe file fingerprints');

Copy link
Member

@MarkAckert MarkAckert Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got to the bottom of the build failures. The require_java from the shell script was removed so the dependency on a Zowe config file could be removed. Our tests used the Zowe config file and pulled JAVA_HOME from there...can we optionally re-implement that behavior when config exists?

i.e.

  if (std.getEnv('ZWE_CLI_PARAMETER_CONFIG')) {
    requireJava()
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Config Manager Related to the config manager component v3 zwe
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants