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

Merged
merged 28 commits into from
Feb 6, 2025
Merged

zwe support in typescript #4147

merged 28 commits into from
Feb 6, 2025

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]>
@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()
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a problem of zwe support verify-fingerprints. This command ignores the config at all. We need to differ between zwe support and zwe support verify-fingerprints.

If the verify-fingerprints is

  • Called from support, we can check the config.
  • Standalone command, we have to rely on JAVA_HOME.

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

github-actions bot commented Jan 31, 2025

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

Copy link

github-actions bot commented Jan 31, 2025

Test workflow 6055 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-6895-20250131100337.pax
Running on machine: zzow09
Result: FAILURE
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13070521000

Copy link

github-actions bot commented Feb 4, 2025

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

Copy link

github-actions bot commented Feb 4, 2025

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

Copy link

github-actions bot commented Feb 5, 2025

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

Copy link

github-actions bot commented Feb 5, 2025

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

Copy link

github-actions bot commented Feb 5, 2025

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

Copy link

github-actions bot commented Feb 5, 2025

Test workflow 6079 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.2.0-PR-4147/zowe-3.2.0-pr-4147-6937-20250205203937.pax
Running on machine: zzow09
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13166185279

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

github-actions bot commented Feb 5, 2025

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

@MarkAckert
Copy link
Member

MarkAckert commented Feb 5, 2025

I tried to lazily load the java module within verify-fingerprints depending on the caller's parameter and JAVA_HOME settings, but couldn't make it work in quickjs. Newer versions of quicks might work. Either way, the test suite now provides JAVA_HOME so it won't get caught on the system default, problem solved.

I also added a note to the CHANGELOG indicating zowe.yaml isn't required for verify-fingerprints.

This is ready to merge.

Copy link

github-actions bot commented Feb 5, 2025

Test workflow 6080 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.2.0-PR-4147/zowe-3.2.0-pr-4147-6938-20250205213657.pax
Running on machine: zzow09
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13167050248

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

github-actions bot commented Feb 6, 2025

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

Copy link

github-actions bot commented Feb 6, 2025

Test workflow 6083 is started.
Running install test: Convenience Pax
The zowe artifact being used by this test workflow: libs-snapshot-local/org/zowe/3.2.0-PR-4147/zowe-3.2.0-pr-4147-6941-20250206083525.pax
Running on machine: zzow10
Result: SUCCESS
Link to workflow run: https://github.com/zowe/zowe-install-packaging/actions/runs/13174852210

@MarkAckert MarkAckert merged commit 2d18f6c into v3.x/staging Feb 6, 2025
14 checks passed
@MarkAckert MarkAckert deleted the v3.x/feature/supportTS branch February 6, 2025 14:25
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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants