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

Add Traceflow Octant-Plugin #841

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Conversation

ZhangYW18
Copy link
Contributor

@ZhangYW18 ZhangYW18 commented Jun 16, 2020

Add a Traceflow octant-plugin for Antrea.

Collaborate with @mengdie-song .

Some sample Traceflow graphs:
success
netpol
nonetpoll
nonetpolr
discon
snsuc
snfail

Some screenshots of the plugin:

plugin

plugin

Note:
This PR depends on below PR, the commit is included. If reviewers have any comments on Traceflow CRD, please go to below link:
#660 Traceflow CRD

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-all: to trigger all tests.
  • /skip-all: to skip all tests.

These commands can only be run by members of the vmware-tanzu organization.

@mengdie-song
Copy link
Contributor

mengdie-song commented Jun 17, 2020

Actually, this patch only relies on traceflow CRD definition patch and has no dependency with the other two traceflow implementation patches. I will update this part.

}

switch actionName {
case addTfAction:
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to update this part of logic.

  1. Add the field name and so that we can trace several times without deleting the previous CRD.
  2. Support more protocol and our previous hard code is just for function verification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to update this part of logic.

  1. Add the field name and so that we can trace several times without deleting the previous CRD.
  2. Support more protocol and our previous hard code is just for function verification.

For the first point, what if the user inputs duplicate traceflow name? As I have not found a good way to inform users like pop-ups, now I just replace the old traceflow with the new one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yiwei's point makes sense to me. @gran-vmv Do you think we need this extra field? Or maybe we could keep the previous logic by constructing the name by source and destination, then if a duplicate one already exists, we can always delete and recreate a new one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yiwei's point makes sense to me. @gran-vmv Do you think we need this extra field? Or maybe we could keep the previous logic by constructing the name by source and destination, then if a duplicate one already exists, we can always delete and recreate a new one?

I think we can use hash code. Add a random string at the end of each traceflow name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use timestamp for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ZhangYW18 Please also check when Pod name contains dot "."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated traceflow name to "srcPod-dstPod-YYYYMMDD-HHMMSS".
Regex check for strings is also added.

Copy link
Contributor

@mengdie-song mengdie-song left a comment

Choose a reason for hiding this comment

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

I have added some comments, please take a look.
We can check in this one after #838.
In this way, we will use the latest octant which has fixed graphviz performance issues. And since we can also fix the position of source graph and destination graph now, traceflow-plugin can be changed to auto refresh graphviz.

@ZhangYW18
Copy link
Contributor Author

Actually, this patch only relies on traceflow CRD definition patch and has no dependency with the other two traceflow implementation patches. I will update this part.

Have updated the description.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

These commands can only be run by members of the vmware-tanzu organization.

Copy link
Contributor

@gran-vmv gran-vmv left a comment

Choose a reason for hiding this comment

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

Please remove commit "Implemented Antrea traceflow controller and agent" from this PR since there is no dependency.
And fix the failed checks except starting with "jenkins-".

pkg/graphviz/traceflow.go Outdated Show resolved Hide resolved
@ZhangYW18 ZhangYW18 force-pushed the traceflow-0616 branch 2 times, most recently from f204e91 to 833e4fd Compare June 23, 2020 07:37
@mengdie-song
Copy link
Contributor

The change to move octant-plugins to separate folder has been checked in. Please move traceflow octant-plugin to the same folder. This patch should have no dependencies with other commit now.

@ZhangYW18 ZhangYW18 force-pushed the traceflow-0616 branch 11 times, most recently from 0d518f0 to 968a6d5 Compare June 29, 2020 04:42
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

I still prefer a single plugin, but if that means too big a design change, we can make the change later.

Besides this, the PR looks good to me. Just have some minor comments.

plugins/octant/Makefile Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
plugins/octant/cmd/traceflow-plugin/main.go Outdated Show resolved Hide resolved
pkg/graphviz/traceflow.go Show resolved Hide resolved
@ZhangYW18 ZhangYW18 force-pushed the traceflow-0616 branch 3 times, most recently from 34ff6c0 to 3277bca Compare July 1, 2020 03:14
}

// This is antrea-traceflow-plugin.
// The plugin needs to run with octant version v0.10.2 or later.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this line since we will run it with 0.13.1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

component.NewFormFieldHidden("action", showGraphAction),
}}
genGraph := component.Action{
Name: "Generate Trace Graph",
Copy link
Contributor

@mengdie-song mengdie-song Jul 1, 2020

Choose a reason for hiding this comment

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

Since we can support automatically refreshment for the latest traceflow, do you think it is better that we change this to " Generate Historical Trace Graph"?

Copy link
Contributor

Choose a reason for hiding this comment

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

historical?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we can support automatically refreshment for the latest traceflow, do you think it is better that we change this to " Generate Historical Trace Graph"?

“LatestTfName” will change to not only the name of the most recently created traceflow, but also the name of the most recently shown traceflow. If so, we have to modify this part of logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean "past"/"previous" instead of "historical"?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to change this part of logic. It is just that "Start New Trace" will actually create a CRD and generate its trace graph. "Generate Historical Trace Graph" will generate the trace graph for any traceflow CRD given its name whether it is the latest one or not. BTW, do yo think maybe "lastTfName" can represent better than "latestTfName"? And we will always show graphviz for "lastTfName".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to change this part of logic. It is just that "Start New Trace" will actually create a CRD and generate its trace graph. "Generate Historical Trace Graph" will generate the trace graph for any traceflow CRD given its name whether it is the latest one or not. BTW, do yo think maybe "lastTfName" can represent better than "latestTfName"? And we will always show graphviz for "lastTfName".

"Latest" implies the most recently created one. As far as I'm concerned, we do need to change the name.

@ZhangYW18 ZhangYW18 force-pushed the traceflow-0616 branch 3 times, most recently from 3f4fa46 to 5a4b477 Compare July 1, 2020 07:24
@@ -0,0 +1,404 @@
package main
Copy link
Contributor

Choose a reason for hiding this comment

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

Copyright.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Header added.

@tnqn
Copy link
Member

tnqn commented Jul 2, 2020

Could we not use the pink color, and perhaps less colors overall, then it would look more serious..
But I'm definitely not good at this, just personal feeling.

@mengdie-song
Copy link
Contributor

mengdie-song commented Jul 2, 2020

@ZhangYW18 Minor comments for copyright. The change looks good to me overall.
I agree with folks that single plugin would be better, but you can change this later considering the schedule and effort.

@tnqn
Copy link
Member

tnqn commented Jul 2, 2020

@ZhangYW18 Minor comments for copyright. The change looks good to me overall.
I agree with folks that single plugin would be better, but you can change this later considering the schedule and effort.
We can merge the current traceflow UI implementation after traceflow implementation patch.

Will both of them be released in release package? I'm a little concerned about the number of bits given each one will have multiple platform versions

@mengdie-song
Copy link
Contributor

@tnqn I am thinking only include antrea-octant-plugin for now. Since we plan to merge this antrea-traceflow-plugin to antrea-octant-plugin later and traceflow is disabled by default right now, we can provide the antrea-octant-plugin with both features later, maybe 0.9? What do you think?

@tnqn
Copy link
Member

tnqn commented Jul 2, 2020

@tnqn I am thinking only include antrea-octant-plugin for now. Since we plan to merge this antrea-traceflow-plugin to antrea-octant-plugin later and traceflow is disabled by default right now, we can provide the antrea-octant-plugin with both features later, maybe 0.9? What do you think?

Sounds good to me, thanks

@ZhangYW18
Copy link
Contributor Author

ZhangYW18 commented Jul 2, 2020

Could we not use the pink color, and perhaps less colors overall, then it would look more serious..
But I'm definitely not good at this, just personal feeling.

Maybe switch some light colors to dark colors can make things better. What do you think of this color theme?

success
netpol
discon

@antoninbas
Copy link
Contributor

/skip-all

@jianjuns
Copy link
Contributor

jianjuns commented Jul 2, 2020

Per discussions offline with @tnqn @antoninbas @McCodeman, merge this PR to be included in 0.8.0. We should continue to add some user documentation (and maybe some demo recording/screenshots in the documents).

@jianjuns jianjuns merged commit 0448530 into antrea-io:master Jul 2, 2020
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 23, 2020
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.

7 participants