- 
                Notifications
    You must be signed in to change notification settings 
- Fork 54
Add "zwe validate port bind" and "zwe validate config" #4447
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
base: v3.x/staging
Are you sure you want to change the base?
Conversation
…alidate bind on startup Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8418 FAILED. | 
| Two errors: 
 
  | 
| Great catch - I can't close a socket I didn't open, that must be the 0c4 cause. | 
| About hostname not being able to be resolved - I am guessing zss has this same issue but its not seen because the servers are being instructed to try "0.0.0.0" instead of "". Seems like an issue but not one unique to this and therefore should be able to have this checker be no worse than zss. | 
Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8434 SUCCEEDED. | 
| Test workflow 7181 is started. | 
Signed-off-by: MarkAckert <[email protected]>
| build 8435 SUCCEEDED. | 
Signed-off-by: MarkAckert <[email protected]>
| build 8436 SUCCEEDED. | 
| Test workflow 7182 is started. | 
| Test workflow 7183 is started. | 
Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8971 SUCCEEDED. | 
| Test workflow 7649 is started. | 
|  | ||
| let myJobname = std.getenv('_BPX_JOBNAME'); | ||
|  | ||
| common.printFormattedInfo(`ZWELS`, `zwe-validate-port-available`, `Checking ports of ${enabledComponents.length} enabled components`); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zwe validate port bind -c /zowe/zowe.yaml
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x2D601098, rc=0x0, rsn=0x0)
Bind succeeded (pointer=0x3D601098, rc=0x0, rsn=0x0)
INFO (zwe-validate-port-available) Checking ports of 9 enabled components
INFO (zwe-validate-port-available) Zowe port bind validation passed.
- Should we move the Bind succeeded (pointer=0x...., rc=0x0, rsn=0x0)to trace?
- Should we state what was check? For example: components.zaas: Bind succeeded (pointer=0x...., rc=0x0, rsn=0x0)
- Checking ports of 9 enabled componentswill check (for this instance) 6 components, because explorers are skipped (no port). Should we inform about this? For example:- components.explorer-jes: Bind skipped due to no port used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will put the skip message under debug because it's more likely a user says 'why are things skipped?' than 'why is the number wrong?' - people ask about what they think are scary looking messages all the time.
…e about skips. Cleanup log boilerplate Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8974 SUCCEEDED. | 
| Test workflow 7653 is started. | 
… action, dont, and do but only warn Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8995 FAILED. | 
Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8996 FAILED. | 
Signed-off-by: 1000TurquoisePogs <[email protected]>
| build 8997 FAILED. | 
| build 9043 FAILED. | 
…ck properties Signed-off-by: MarkAckert <[email protected]>
| build 9047 SUCCEEDED. | 
| Test workflow 7711 is started. | 
This re-uses some code from the prototype #4276 but submits just "zwe validate port bind" and "zwe validate config" for review to keep the PR smaller and easier to test, read, merge.
This PR adds a command, "zwe validate config" which is an alias of "zwe config validate".
It then adds a command "zwe validate port bind" which can either test if a single component can bind to its associated port, or if all enabled components can.
That command is then used every startup, unless opted out via
zowe.launchScript.startupChecks.bypassAll: trueorzwe.launchScript.startupChecks.ports: falseYou can also use "warn" as a value, which will do the check but not prevent startup.
When the check is done and not in warn-mode, it will print how to put into warn-mode, in case a user runs into a problem and needs to bypass the check.
This code is more robust than just the is_port_available code that apiml was using from the zwe codebase.
It attempts to make a tcp server to see if the permissions are correct, not just whether the port is free, and attempts to do so with the right jobname using _BPX_JOBNAME changing.
It is intended as a replacement of is_port_available and if merged, I would like apiml to stop using is_port_available since it is just then duplicate processing.
This PR also includes a manifest schema addition to have components/extensions tell us their likely jobname.
This could be helpful overall, but is used here to try to get the right jobname to check permissions of the bind operation.