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

feat: initial implementation of evpn gw cni #14

Merged
merged 5 commits into from
Jun 6, 2024

Conversation

mardim91
Copy link
Contributor

Initial implementation of EVPN GW CNI. Currently only Intel Mt.Evans IPUs are supported by this CNI. Target is to support more IPUs/DPUs in the future. It has an integration with the EVPN GW API .

@mardim91 mardim91 requested a review from a team as a code owner February 22, 2024 12:32
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 1103 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (7020632) to head (12625ed).

❗ Current head 12625ed differs from pull request most recent head 5c47616. Consider uploading reports for the commit 5c47616 to get more accurate results

Files Patch % Lines
pkg/utils/utils.go 0.00% 277 Missing ⚠️
cmd/main.go 0.00% 204 Missing ⚠️
pkg/sriov/sriov.go 0.00% 153 Missing ⚠️
pkg/utils/packet.go 0.00% 153 Missing ⚠️
pkg/config/config.go 0.00% 130 Missing ⚠️
pkg/xpu/xpu.go 0.00% 113 Missing ⚠️
pkg/utils/pci_allocator.go 0.00% 45 Missing ⚠️
pkg/utils/netlink_manager.go 0.00% 22 Missing ⚠️
pkg/types/types.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           main     #14     +/-   ##
======================================
  Coverage      0   0.00%             
======================================
  Files         0       9      +9     
  Lines         0    1104   +1104     
======================================
- Misses        0    1104   +1104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


FROM docker.io/library/golang:1.21.6-alpine as builder
Copy link
Member

Choose a reason for hiding this comment

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

please do not remove docker.io

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Added back in the line below.

// Copyright (C) 2023 Nordix Foundation.

package utils

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@glimchb in your netlink wrapper library that you want me to use each function there takes as parameter a context.

In this case here should I use an empty context right ? Like context.Background() ? Is this enough ?

Copy link
Member

@glimchb glimchb Feb 27, 2024

Choose a reason for hiding this comment

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

yes, context.Background() is perfectly valid
or context.WithTimeout(context.Background(), 3) if you care about timeouts of the operation...

Copy link
Contributor Author

@mardim91 mardim91 Feb 27, 2024

Choose a reason for hiding this comment

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

@glimchb I think is not so trivial to just import that library and use it. The reason is that this library expects that there is some otel server that runs somewhere. If not then I get errors back related to the tracer.start(ctx) function
https://github.com/opiproject/opi-evpn-bridge/blob/main/pkg/utils/netlink.go#L50

We need to make the tracer.start code section optional in order to skip it if there is no otel service

WDYT ?

Copy link
Member

@glimchb glimchb Feb 27, 2024

Choose a reason for hiding this comment

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

errors should not be fatal, service just trying to send traces to otel collector should not fail...

I also suggest to spin a jaeger like I do in all other OPI repos, example: https://github.com/opiproject/opi-evpn-bridge/blob/5440fb9f85ed80d74658412a0cf3ff352b8d29dd/docker-compose.yml#L221-L235

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@glimchb Even if that doesn't cause a fatal fail due to the fact that it waits until it timeouts (because there is no otel collector) make the calls extremely long and delayed.

Also a CNI is just a binary that you throw in a K8s system and just works. Is highly unlikely to have CNI depend on an OTEL collector like jaeger. In most of the systems there is no Jaegger.

I think the implementation that we have today in the netlink wrapper is not good enough to just import it from a CNI. I believe we should make some changes to at least make the trace part optional.

WDYT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @glimchb can you please respond to my comment above ?

Copy link
Member

@glimchb glimchb Mar 7, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2023 Nordix Foundation.
// Copyright (c) 2024 Ericsson AB.

Copy link
Member

Choose a reason for hiding this comment

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

this code should just import and use https://github.com/opiproject/godpu library

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

library imported in line 15 below


[![Linters](https://github.com/opiproject/opi-gateway-evpn-cni/actions/workflows/linters.yml/badge.svg)](https://github.com/opiproject/opi-gateway-evpn-cni/actions/workflows/linters.yml)
Copy link
Member

Choose a reason for hiding this comment

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

why badges removed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Badges included again in latest.


## I Want To Contribute
Copy link
Member

Choose a reason for hiding this comment

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

this section must stay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Now in line 205 below

Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

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

  • code dup
  • ci failed
  • no tests
  • no godpu usage
  • readme removed badges
  • readme : i want to contribute section must stay

@mardim91
Copy link
Contributor Author

@glimchb Thank you for the review.

I will take a look

@sandersms
Copy link
Contributor

@mardim91 Any update on the resolution of the comments?

@mardim91
Copy link
Contributor Author

mardim91 commented Mar 28, 2024

@mardim91 Any update on the resolution of the comments?

Hello @sandersms,

No I haven't found the time to work on that yet. I will do it beginning of Q2. I was working on this PR: opiproject/opi-evpn-bridge#377
please take a look when you find some time.

Signed-off-by: Dimitrios Markou <[email protected]>

FROM docker.io/library/golang:1.21.6-alpine as builder
FROM docker.io/library/golang:1.20-alpine3.19 as builder

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: containerImage not pinned by hash
Click Remediation section below to solve this issue
@mardim91
Copy link
Contributor Author

mardim91 commented May 3, 2024

Hello @sandersms I have resolved all the above comments.

@mardim91 mardim91 marked this pull request as draft May 13, 2024 17:13
@mardim91
Copy link
Contributor Author

I have converted this to draft as the dependent PR in opi-evpn-bridge is still unmerged

opiproject/opi-evpn-bridge#380

Signed-off-by: Dimitrios Markou <[email protected]>
@mardim91 mardim91 marked this pull request as ready for review May 14, 2024 13:47
@mardim91
Copy link
Contributor Author

I have converted this to draft as the dependent PR in opi-evpn-bridge is still unmerged

opiproject/opi-evpn-bridge#380

The dependent PRs 0, 1 has been merged so this PR is ready

sandersms
sandersms previously approved these changes May 14, 2024
Copy link
Contributor

@sandersms sandersms left a comment

Choose a reason for hiding this comment

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

Changes and updates from comments look to be resolved.

@mardim91
Copy link
Contributor Author

Hello @glimchb,

I have resolved all the comments that you have left. I will propose that maybe we can merge this one as the first PR to the project and then if we need to fix or add anything more we can create new PRs on top.

This PR is a working one and is quite some time open so I am thinking that we can merge it as the comments are resolved and all the dependent PRs in the OPI-EVPN-BR project are merged.

@sandersms sandersms requested review from glimchb and sandersms May 21, 2024 16:15
@sandersms
Copy link
Contributor

sandersms commented May 21, 2024

  • code dup
  • ci failed
  • no tests
  • no godpu usage
  • readme removed badges
  • readme : i want to contribute section must stay

code dup fixed
ci checks completed
godpu inclusion resolved
readme updated to include badges and contribution section

Tests for the feature are missing and should be included for validation. Issue #16 opened to cover the missing aspect that needs to be added.

Copy link
Contributor

@sandersms sandersms left a comment

Choose a reason for hiding this comment

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

Re-review of changes look good.

Tests still missing. Added an issue for the functionality to be addressed in subsequent PR

@sandersms sandersms requested review from glimchb and removed request for glimchb May 28, 2024 16:05
@sandersms sandersms dismissed glimchb’s stale review June 6, 2024 16:18

Reported items are fixed and one issue opened for the test routines. No response on approval and needs to move forward.

@sandersms sandersms merged commit a2207f8 into opiproject:main Jun 6, 2024
15 checks passed
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