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

[Enhancement] [zos_job_submit] Async support for zos_job_submit #1786

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

rexemin
Copy link
Collaborator

@rexemin rexemin commented Nov 4, 2024

SUMMARY

Fixes #1249 and #1748.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • zos_job_submit
ADDITIONAL INFORMATION

In the end, zos_copy was not needed to be changed, zos_job_submit's action plugin can run zos_copy and block the rest of the execution flow until the local JCL file is uploaded to the remote host.

@rexemin rexemin marked this pull request as ready for review November 15, 2024 16:18
@rexemin
Copy link
Collaborator Author

rexemin commented Nov 15, 2024

Results for Jenkins. First, zos_job_submit by itself, then the rest of the modules affected by the change.

Screenshot 2024-11-15 at 13 26 32
Screenshot 2024-11-15 at 13 26 41
Screenshot 2024-11-15 at 13 26 53
Screenshot 2024-11-15 at 13 27 05
Screenshot 2024-11-15 at 13 27 18

Copy link
Collaborator

@richp405 richp405 left a comment

Choose a reason for hiding this comment

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

Nice Upgrade!

Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

Code is great. Is mostly questions I have

plugins/action/zos_job_submit.py Show resolved Hide resolved

if remote_path:
self._fixup_perms2((tmp, remote_path))
# remote_path = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

These can be removed rather than commented


tmp_src = self._connection._shell.join_path(tmp, "source")
# tmp_src = self._connection._shell.join_path(tmp, "source")
Copy link
Collaborator

Choose a reason for hiding this comment

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

these can be removed too

assert result.stderr == ""

finally:
os.remove("inventory.yml")
Copy link
Collaborator

Choose a reason for hiding this comment

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

wondering if these two could have been NamedTemporaryFiles ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, they can be, and here's the Jenkins pipeline testing that change
Screenshot 2024-11-19 at 10 01 47


- name: Query async task.
async_status:
jid: "{{{{ job_task.ansible_job_id }}}}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you share how a non async status would fail in this case?

Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] [Epic] [zos_job_submit, zos_job_query, zos_job_output] support Ansible async controls
4 participants