GCU: Add path tracing support#4317
Open
bhouse-nexthop wants to merge 1 commit intosonic-net:masterfrom
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
5135025 to
3ea4bfe
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
unit tests are failing due to the spelling fix PRs that merged before this. I'll rebase once someone fixes the failures. |
3ea4bfe to
a10d2b8
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@qiluo-msft @lguohan I have a bunch of GCU fixes coming, but they're gated by this PR due to code conflicts. Can you please review and hopefully merge. This has been crucial in diagnosing GCU-related issues. There should be zero additional overhead (whether CPU or memory) with the tracing support if tracing hasn't been enabled. |
a10d2b8 to
842a356
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
842a356 to
605497d
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
605497d to
9b5d082
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
GCU uses a very complex set of generators and validators. When a suboptimal plan is created, it can be hard to determine why the path was generated the way it was and how best to optimize the generators. This patch adds the ability to pass an IO object to all attempted paths with annotations such as `valid`, `invalid`, `recurse_reject` (source and target were already attempted), and `path_issue` (patch was good, but a generator further down the hierarchy failed). It will also list the generator used for each patch, and if `invalid` it will list the validator which failed it with a possibly extended error message. For callers to `config replace` or `config apply-patch` a new command line option of `--path-trace` which takes a filename to dump the json output. This patch also increases the diff output shown during test run failures to make it easier to debug issues based on logging generated via CI/CD. Signed-off-by: Brad House <bhouse@nexthop.ai>
9b5d082 to
6da6210
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 I did
GCU uses a very complex set of generators and validators. When a suboptimal plan is created, it can be hard to determine why the path was generated the way it was and how best to optimize the generators.
This patch adds the ability to pass an IO object to all attempted paths with annotations such as
valid,invalid,recurse_reject(source and target were already attempted), andpath_issue(patch was good, but a generator further down the hierarchy failed). It will also list the generator used for each patch, and ifinvalidit will list the validator which failed it with a possibly extended error message.For callers to
config replaceorconfig apply-patcha new command line option of--path-tracewhich takes a filename to dump the json output.This patch also increases the diff output shown during test run failures to make it easier to debug issues based on logging generated via CI/CD.
Fixes sonic-net/sonic-buildimage#25748
How I did it
Modified various classes and functions to pass around objects and metadata needed to generate the trace.
How to verify it
Run
config replaceorconfig apply-patchwith the--path-traceargument.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Example output showing a suboptimal plan:
trace.json