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

Support GUID CNI runtime config #70

Merged
merged 5 commits into from
Jul 29, 2020

Conversation

adrianchiris
Copy link
Collaborator

@adrianchiris adrianchiris commented Apr 26, 2020

we should first:

  1. Merge infiniband-guid as runtime config in multi-net-spec
  2. Update k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/types.go with the new infiniband-guid runtime config. PR 25
  3. update PR go.mod to use a newer version of net-attach-def client from 2

@coveralls
Copy link

coveralls commented Apr 26, 2020

Pull Request Test Coverage Report for Build 241

  • 22 of 25 (88.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage remained the same at 86.667%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/utils/utils.go 22 25 88.0%
Files with Coverage Reduction New Missed Lines %
pkg/utils/utils.go 1 71.43%
Totals Coverage Status
Change from base Build 244: 0.0%
Covered Lines: 442
Relevant Lines: 510

💛 - Coveralls

Add `DAEMON_SM_PLUGIN_PATH` environment variable to allow
loading plugins from a custom directory.
Default value is set to the original path (root dir)

This eases Development by allowing to specify the plugins dir
in a custom location.
- Retrieve guid value by runtime config or cni-args
- Set GUID in pod annotation in either runtime config or cni-args
  according to provided parameters
- Determine wether or on a POD has guid request according to
  either the existance of infinibandGUID runtime config or guid
  attribute in cni args
@adrianchiris
Copy link
Collaborator Author

All Prereq have been met.

This PR should ideally be split into 2:

  • first 2 commits as general improvements
  • last 2 commits for ib guid support

Update the package to a newer version that contains
infiniband-guid runtime config

This required to bump up k8s related dependent packages
from verison 1.17 to version that support k8s 1.18.3 as
its required by the newer network-attach-def-client package
@adrianchiris adrianchiris changed the title [WIP] Support GUID CNI runtime config Support GUID CNI runtime config Jul 27, 2020
@adrianchiris
Copy link
Collaborator Author

The change was validated and confirmed to be working.

README.md Show resolved Hide resolved
@@ -246,7 +248,9 @@ func (d *daemon) AddPeriodicUpdate() {
d.guidPodNetworkMap[allocatedGUID] = podNetworkID
}

if err = utils.SetPodNetworkGUID(network, allocatedGUID); err != nil {
// TODO(adrianc): should we just set GUID both in CNI ARGS and runtime config ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

why it should be both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i was thinking at the time of a cluster with different versions of ib-sriov cni where some might support infinibandGUID runtime config and some might not, however we should not hide configuration issues here so ill remove this TODO.

@@ -263,11 +267,12 @@ func (d *daemon) AddPeriodicUpdate() {
pod.Annotations[v1.NetworkAttachmentAnnot] = string(netAnnotations)
}

// used GUID as net.HardwareAddress to use it in sm plugin which receive n[]et.HardwareAddress as parameter
// Create a GUID list as net.HardwareAddress to be used it in sm plugin
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can remove the "it"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will remove sure

guidList = append(guidList, guidAddr.HardWareAddress())
passedPods = append(passedPods, pod)
}

// Get configured PKEY for network and Add the relevand POD GUIDs as members of the PKey via Subnet Manager
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/Add/add
s/relevand/relevant

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@moshe010 moshe010 self-assigned this Jul 29, 2020
@adrianchiris
Copy link
Collaborator Author

I will also open an issue to deprecate the GUID attribute in ib-sriov-cni so we use only one form

- Typos and comment changes
@moshe010 moshe010 merged commit 2cc899d into Mellanox:master Jul 29, 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.

3 participants