-
Notifications
You must be signed in to change notification settings - Fork 356
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
Improve argument streaming for remote job execution (part 1) #1397
Draft
Shrews
wants to merge
18
commits into
ansible:devel
Choose a base branch
from
Shrews:kwarg-protocol-3
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Shrews
force-pushed
the
kwarg-protocol-3
branch
3 times, most recently
from
September 24, 2024 19:32
1931b5f
to
7f88c89
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
2 times, most recently
from
October 14, 2024 16:45
2eadf31
to
61cb018
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
2 times, most recently
from
October 14, 2024 18:36
5e28eea
to
5fbae20
Compare
Shrews
changed the title
Keyword argument protocol - config dataclasses
Improve argument streaming for remote job execution (part 1)
Oct 14, 2024
Shrews
force-pushed
the
kwarg-protocol-3
branch
5 times, most recently
from
October 17, 2024 18:48
15fe5e5
to
9be5cd1
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
2 times, most recently
from
November 4, 2024 20:39
9964051
to
7e82b6a
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
from
November 5, 2024 15:19
7e82b6a
to
d599164
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
from
November 5, 2024 19:33
d599164
to
9ef249d
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
3 times, most recently
from
November 14, 2024 20:15
a5d2b2f
to
630fc50
Compare
Shrews
force-pushed
the
kwarg-protocol-3
branch
from
November 18, 2024 15:13
630fc50
to
728b9ff
Compare
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
Transmitter
node streaming the job keyword arguments as a JSON object to aWorker
node. Adding new keyword arguments to theinterface.run()
orinterface.run_async()
methods can cause errors within the remote job streaming interface when an olderWorker
node receives the new, unrecognized keyword argument from a newerTransmitter
node (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:
Transmitter
process 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 olderWorker
nodes from failing when the new keyword is not used since the new keyword will not be sent in the argument stream.Worker
process gracefully fail on unrecognized keywords.Change Details
RunnerConfig
object will become the main source for supplying job parameters instead ofkwargs
.BaseConfig
andRunnerConfig
classes 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 classproperty
decorators. Internally, the attribute is referenced by the non-alias version.RunnerConfig
attributes 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 aRunnerConfig
object.kwargs
parameters; backwards compatibleRunnerConfig
object and a few select parameters.init_runner()
,dump_artifacts()
, etc) are modified to allow for receiving aRunnerConfig
object instead of keyword arguments.Transmitter
modified to query theRunnerConfig
object to retrieve the keyword arguments to transmit.interface.run()
method moved toBaseConfig
andRunnerConfig
docs.TODO