Improve argument streaming for remote job execution (part 1)#1397
Open
Shrews wants to merge 20 commits intoansible:develfrom
Open
Improve argument streaming for remote job execution (part 1)#1397Shrews wants to merge 20 commits intoansible:develfrom
Shrews wants to merge 20 commits intoansible:develfrom
Conversation
1931b5f to
7f88c89
Compare
2eadf31 to
61cb018
Compare
5e28eea to
5fbae20
Compare
15fe5e5 to
9be5cd1
Compare
d599164 to
9ef249d
Compare
630fc50 to
728b9ff
Compare
nitzmahone
reviewed
Nov 27, 2024
Member
nitzmahone
left a comment
There was a problem hiding this comment.
Didn't get all the way through the fine-toothed comb review before I ran out of days, but looking great- I think this solves the most important parts of the internal arg-splatting problem well.
728b9ff to
bcd1036
Compare
Contributor
Author
|
Have to revamp this a bit. The config objects come into play for |
This comment was marked as outdated.
This comment was marked as outdated.
a0435b5 to
535f226
Compare
Akasurde
reviewed
Feb 27, 2025
| if ('logfile' in args) and vargs.get('logfile'): | ||
| output.set_logfile(vargs.get('logfile')) | ||
| logfile = vargs.get('logfile') | ||
| output.configure(debug, logfile) |
Member
There was a problem hiding this comment.
Since you are here, on line 841, can you please change code to use os.path.isdir instead?
Contributor
Author
There was a problem hiding this comment.
Not sure I understand... change os.makedirs() to os.path.isdir()???
| # wrap args for ssh-agent | ||
| if self.ssh_key_data: | ||
| if self.ssh_key: | ||
| debug('ssh-agent agrs added') |
Member
There was a problem hiding this comment.
Suggested change
| debug('ssh-agent agrs added') | |
| debug('ssh-agent arguments added') |
535f226 to
e546923
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes to Remote Job Execution Argument Streaming
Reason For Change
Remote job execution involves a
Transmitternode streaming the job keyword arguments as a JSON object to aWorkernode. Adding new keyword arguments to theinterface.run()orinterface.run_async()methods can cause errors within the remote job streaming interface when an olderWorkernode receives the new, unrecognized keyword argument from a newerTransmitternode (worker/transmitter version mismatch).For more background information on the streaming process, see this page of the documentation.
Fixes #1324
Solution
The total fix will require a multi-stage solution:
Transmitterprocess stream only keyword arguments that are actually specified and have a value different from their default value. This does not fix the case when a new keyword argument is introduced and used with a non-default value, but does fix olderWorkernodes from failing when the new keyword is not used since the new keyword will not be sent in the argument stream.Workerprocess gracefully fail on unrecognized keywords.Change Details
RunnerConfigobject will become the main source for supplying job parameters instead ofkwargs.BaseConfigandRunnerConfigclasses into dataclasses to allow us to properly define arguments, their data types, and their default values.__init__()method is now autogenerated, care is taken to keep the same name for a few class attributes that did not have the same name as their argument. This is done through the use of Python classpropertydecorators. Internally, the attribute is referenced by the non-alias version.RunnerConfigattributes are streamable to aWorker. Attributes that are NEVER streamable will have explicit dataclass metadata to mark it as such (example,field(metadata={MetaValues.TRANSMIT: False})).interface.run()andinterface.run_async()changed to accept aRunnerConfigobject.kwargsparameters; backwards compatibleRunnerConfigobject and a few select parameters.init_runner(),dump_artifacts(), etc) are modified to allow for receiving aRunnerConfigobject instead of keyword arguments.Transmittermodified to query theRunnerConfigobject to retrieve the keyword arguments to transmit.interface.run()method moved toBaseConfigandRunnerConfigdocs.TODO