Basic and super-experimental support for distributed execution#3205
Draft
Basic and super-experimental support for distributed execution#3205
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## local-execution-controller #3205 +/- ##
=============================================================
Coverage ? 71.32%
=============================================================
Files ? 275
Lines ? 20720
Branches ? 0
=============================================================
Hits ? 14778
Misses ? 5016
Partials ? 926
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9a913cd to
74dda8c
Compare
4bc44d2 to
1506bfd
Compare
This was referenced Jul 19, 2023
fd81209 to
19a30e2
Compare
This adds the `k6 agent` and `k6 coordinator` sub-commands and adds a very simple way to do distributed execution, including packaging and sending the script to agents, and setup() and teardown() handling. However, it doesn't include automatic metric handling (e.g. thresholds and the end-of-test summary).
1506bfd to
2443ac6
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.
What?
This PR adds very basic and very experimental support for distributed execution, including packaging and sending the script to agents, and
setup()andteardown()handling. It is another sliver of the newly refactored #2816 and built on top of #3191 and #3204.This is done via the new
k6 agentandk6 coordinatorsub-commands and in a completely backwards-compatible manner. They have been marked asHiddenbecause the feature is definitely not ready for any kind of serious use and is very experimental. It currently doesn't have any tests or a lot of the required error handling...This PR also doesn't add support distributed metric handling (i.e. centralized thresholds or the end-of-test summary). That part of the original proof-of-concept PR was refactored and moved in a separate commit and can be added as a separate pull request later, to make reviewing and potentially merging each PR easier 🎉
Another big missing element in this PR is any sort of mutual authentication and authorization of the gRPC connection between
k6 agentandk6 coordinator. Given that the communication between these components could potentially happen over the internet, that feature is a must before the feature could be considered anywhere near ready for general use.Finally, the
--instance-countCLI flag ofk6 coordinatoris probably somewhat basic and insufficient for a lot of complex use cases. A more flexible configuration should probably should probably also be supported. For example,k6 coordinatorcan rely on the--execution-segment-sequenceoption to know the number of desired instances and their respective segments. If we add some new option to allow users to specify instance tags (e.g.key=valuemetadata pair everyk6 agentinstance is started with),k6 coordinatorwill be able to match individual instances to individual segments.And now, after I've described all of the shortcomings and missing features of this PR above, it's a reasonable question to ask why it should be merged without them:
Why?
In short, because all of the missing features of this PR (including end-to-end tests) can be added later! Even though this is far from a polished and ready-to-use implementation of distributed execution, it is completely backwards compatible and makes no breaking k6 changes! Notice how no existing k6 tests have been disabled or even changed in any way! 🎉
I'd argue that it will be easier to actually get all of these things done in small increments once this PR is merged in
master🤞 And even if nothing from the missing things is prioritized, it will still be better to have this merged, to reduce the required upkeep of these PoCs (i.e. reduce merge conflicts when rebasing) over time. Having this inmasteralso helps to avoid logical conflicts of other big features and refactorigns with it (e.g. #3112 had some issues).Finally, even in its current super-basic form, this might actually be useful to some people for some use cases. For example, grafana/k6-operator#223 might be better implemented on top of this feature instead of from scratch 🤔
Checklist
make ci-like-lint) and all checks pass.make tests) and all tests pass.Related PR(s)/Issue(s)
setup/teardownk6-operator#223