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

[Windows] Replace the private patch in the dependent hcsshim library #2931

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

wenyingd
Copy link
Contributor

@wenyingd wenyingd commented Oct 25, 2021

  1. Use OVS Port externalIDs to cache the externalIDS in containerd
    runtime instead of HNSEndpoint

  2. Create the OVS Interface with type "" if the host interface is
    not created (in containerd case), and update the type as "internal"
    after the host interface is created

  3. Connect the OVS port to the host interface in function "reconcile" if
    the OVS port's ofport number is -1, by updating the OVS Interface type
    as "internal".

Fixes #2913

Signed-off-by: wenyingd wenyingd@vmware.com

@wenyingd wenyingd force-pushed the issue_2913 branch 3 times, most recently from e1e8e29 to 808dd94 Compare October 25, 2021 13:14
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2021

Codecov Report

Merging #2931 (5f2929b) into main (1917bb5) will decrease coverage by 1.35%.
The diff coverage is 23.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2931      +/-   ##
==========================================
- Coverage   59.62%   58.26%   -1.36%     
==========================================
  Files         292      292              
  Lines       24724    24742      +18     
==========================================
- Hits        14741    14417     -324     
- Misses       8364     8752     +388     
+ Partials     1619     1573      -46     
Flag Coverage Δ
kind-e2e-tests 44.73% <20.58%> (-1.93%) ⬇️
unit-tests 40.13% <2.94%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/agent_linux.go 3.67% <0.00%> (ø)
...g/agent/cniserver/interface_configuration_linux.go 16.15% <ø> (ø)
pkg/agent/cniserver/pod_configuration_linux.go 66.66% <0.00%> (-33.34%) ⬇️
pkg/ovs/ovsconfig/ovs_client.go 47.35% <20.00%> (-1.60%) ⬇️
pkg/agent/cniserver/pod_configuration.go 53.33% <33.33%> (-1.79%) ⬇️
...gent/controller/noderoute/node_route_controller.go 54.91% <100.00%> (ø)
...g/agent/apiserver/handlers/featuregates/handler.go 0.00% <0.00%> (-82.36%) ⬇️
...kg/apiserver/registry/system/supportbundle/rest.go 19.54% <0.00%> (-55.18%) ⬇️
pkg/support/dump_others.go 0.00% <0.00%> (-51.73%) ⬇️
...ver/registry/controlplane/nodestatssummary/rest.go 50.00% <0.00%> (-50.00%) ⬇️
... and 23 more

@wenyingd wenyingd force-pushed the issue_2913 branch 2 times, most recently from c4b73b9 to d27ffdb Compare October 29, 2021 06:12
@wenyingd
Copy link
Contributor Author

/test-all
/test-windows-all
/test-ipv6-all
/test-ipv6-only-all

@wenyingd wenyingd changed the title [WIP] [Windows] Remove AddtionalParams in hcsshim.HNSEndpoint [Windows] Remove AddtionalParams in hcsshim.HNSEndpoint Oct 29, 2021
@wenyingd wenyingd changed the title [Windows] Remove AddtionalParams in hcsshim.HNSEndpoint [Windows] Replace the private patch in the dependent hcsshim library Oct 29, 2021
@wenyingd
Copy link
Contributor Author

/test-integration
/test-all
/test-windows-all
/test-ipv6-all
/test-ipv6-only-all
/test-windows-proxyall-e2e

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.

@tnqn : do you still have concerns on the proposed approach.

for _, containerConfig := range knownInterfaces {
// Find the OVS ports which are not connected to host interfaces, this is useful on Windows if the runtime is
Copy link
Contributor

Choose a reason for hiding this comment

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

, this -> . This

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add some comments somewhere (pod_configuration.go, or pod_configuration_windows.go) to briefly describe the process of interface creation on Windows with Docker and containerd? It can be very short, but at least for readers to understand the CNI call sequence and what happen at each call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I would update.

pkg/agent/cniserver/pod_configuration.go Outdated Show resolved Hide resolved
pkg/agent/cniserver/pod_configuration_windows.go Outdated Show resolved Hide resolved
pkg/ovs/ovsconfig/ovs_client.go Outdated Show resolved Hide resolved
return 0, NewTransactionError(err, temporary)
}

// Wait until OVS allocated the ofport to the Interface.
Copy link
Member

Choose a reason for hiding this comment

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

It seems the following code is duplicate with GetOFPort. Why don't we just call GetOFPort on caller side?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are different. The wait condition in function GetOFPort is field "ofport" is not empty, but here we wait until the "ofport" field is not "-1".

Copy link
Member

Choose a reason for hiding this comment

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

That's still one line difference, could we share the code? For example, make GetOFPort take one argument waitUntilValid, set it true for the new scenario on client side.

@tnqn
Copy link
Member

tnqn commented Nov 16, 2021

@tnqn : do you still have concerns on the proposed approach.

I'm fine with the approach. I have comments for the code itself.

@wenyingd
Copy link
Contributor Author

/test-all

@wenyingd wenyingd requested review from tnqn and jianjuns November 25, 2021 08:31
@wenyingd
Copy link
Contributor Author

@tnqn Could you help review it again?

pkg/agent/cniserver/pod_configuration.go Show resolved Hide resolved
return 0, NewTransactionError(err, temporary)
}

// Wait until OVS allocated the ofport to the Interface.
Copy link
Member

Choose a reason for hiding this comment

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

That's still one line difference, could we share the code? For example, make GetOFPort take one argument waitUntilValid, set it true for the new scenario on client side.

pkg/agent/cniserver/interface_configuration_windows.go Outdated Show resolved Hide resolved
@wenyingd wenyingd force-pushed the issue_2913 branch 2 times, most recently from b01ebbf to d79b11e Compare November 26, 2021 10:31
@wenyingd
Copy link
Contributor Author

/test-all
/test-windows-all
/test-ipv6-all
/test-ipv6-only-all
/test-windows-proxyall-e2e

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM overall, one comment left

pkg/ovs/ovsconfig/ovs_client.go Outdated Show resolved Hide resolved
1. Use OVS Port externalIDs to cache the externalIDS in containerd
   runtime instead of HNSEndpoint

2. Create the OVS Interface with type "" if the host interface is
   not created (in containerd case), and update the type as "internal"
   after the host interface is created

3. Connect the OVS port to the host interface in function "reconcile" if
   the OVS port's ofport number is -1, by updating the OVS Interface type
   as "internal".

Signed-off-by: wenyingd <wenyingd@vmware.com>
@wenyingd
Copy link
Contributor Author

/test-integration
/test-all
/test-windows-all
/test-ipv6-all
/test-ipv6-only-all
/test-windows-proxyall-e2e

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@wenyingd
Copy link
Contributor Author

/test-e2e
/test-flexible-ipam-e2e
/test-ipv6-conformance
/test-ipv6-e2e
/test-windows-all

@wenyingd
Copy link
Contributor Author

/test-windows-networkpolicy
/test-ipv6-conformance
/test-e2e
/test-windows-proxyall-e2e

@tnqn tnqn merged commit 9a52de9 into antrea-io:main Nov 30, 2021
@wenyingd wenyingd deleted the issue_2913 branch August 15, 2022 03:32
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.

Stop replacing github.com/Microsoft/hcsshim with private fork
4 participants