Skip to content

Commit

Permalink
…ugin:master into master
  • Loading branch information
SchSeba committed Mar 24, 2024
2 parents a134282 + e6ead1e commit 49a1267
Show file tree
Hide file tree
Showing 814 changed files with 21,858 additions and 20,221 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: docker
directory: /images
schedule:
interval: weekly
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
groups:
gomod-dependencies:
patterns:
- '*'
43 changes: 37 additions & 6 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
name: build
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.21.x]
goarch: [amd64]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

- uses: actions/checkout@v3

Expand All @@ -74,13 +74,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.52.2
version: v1.55.2

shellcheck:
name: Shellcheck
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

# if this fails, run go mod tidy
- name: Check if module files are consistent with code
Expand All @@ -122,3 +122,34 @@ jobs:
# if this fails, run go mod vendor
- name: Check if vendor directory is consistent with go modules
run: go mod vendor && git diff --exit-code

sriov-operator-e2e-test:
name: SR-IOV operator e2e tests
needs: [ build,test ]
runs-on: [ sriov ]
env:
TEST_REPORT_PATH: k8s-artifacts
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: build sriov-network-device-plugin image
run: podman build -f images/Dockerfile -t ghaction-sriov-network-device-plugin:pr-${{github.event.pull_request.number}} .

- name: Check out sriov operator's code
uses: actions/checkout@v2
with:
repository: k8snetworkplumbingwg/sriov-network-operator
path: sriov-network-operator-wc

- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci
working-directory: sriov-network-operator-wc
env:
LOCAL_SRIOV_DEVICE_PLUGIN_IMAGE: ghaction-sriov-network-device-plugin:pr-${{github.event.pull_request.number}}

- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ env.TEST_REPORT_PATH }}
path: ./sriov-network-operator-wc/${{ env.TEST_REPORT_PATH }}
18 changes: 14 additions & 4 deletions .github/workflows/image-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
Expand Down Expand Up @@ -68,6 +70,8 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
Expand Down Expand Up @@ -109,6 +113,8 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
Expand All @@ -124,6 +130,8 @@ jobs:

push-manifest:
runs-on: ubuntu-20.04
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
needs: [build-and-push-amd64-device-plugin,build-and-push-arm64-device-plugin,build-and-push-ppc64le-device-plugin]
steps:
- name: Set up Docker Buildx
Expand All @@ -134,6 +142,8 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
Expand All @@ -146,7 +156,7 @@ jobs:

- name: Create manifest for multi-arch images
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }} \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-amd64 \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-arm64 \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-ppc64le
docker buildx imagetools create -t ${{ steps.docker_meta.outputs.tags }} \
${{ steps.docker_meta.outputs.tags }}-amd64 \
${{ steps.docker_meta.outputs.tags }}-arm64 \
${{ steps.docker_meta.outputs.tags }}-ppc64le
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
# depguard has a bug in go 1.21 that will be fixed in future versions: https://github.com/kedacore/keda/pull/5285
#- depguard
- dogsled
- dupl
- errcheck
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The following NICs were tested with this implementation. However, other SR-IOV
- Mellanox ConnectX-6®
- Mellanox ConnectX-6® Dx
- Mellanox BlueField-2®
- Broadcom NetXtreme-E Series Adapters

## Quick Start

Expand Down Expand Up @@ -256,6 +257,15 @@ This plugin creates device plugin endpoints based on the configurations given in
}
}
},
{
"resourceName": "brcm_sriov_bnxt",
"resourcePrefix": "broadcom.com",
"selectors": [{
"vendors": ["14e4"],
"devices": ["1750"],
"drivers": ["bnxt_en"]
}],
},
{
"resourceName": "old_selectors_syntax_example",
"selectors": {
Expand Down Expand Up @@ -316,7 +326,7 @@ These selectors are applicable when "deviceType" is "accelerator".
These selectors are applicable when "deviceType" is "netDevice" (note: this is default)


| Field | Required | Description | Type/Defaults | Example/Accepted values |
| Field | Required | Description | Type/Defaults | Example/Accepted values |
|----------------|----------|--------------------------------------------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------|
| "vendors" | N | Target device's vendor Hex code as string | `string` list Default: `null` | "vendors": ["8086", "15b3"] |
| "devices" | N | Target Devices' device Hex code as string | `string` list Default: `null` | "devices": ["154c", "1889", "1018"] |
Expand All @@ -327,6 +337,7 @@ These selectors are applicable when "deviceType" is "netDevice" (note: this is d
| "rootDevices" | N | functions from PF matches list of PF PCI addresses | `string` list Default: `null` | "rootDevices": ["0000:86:00.0"] (See follow-up sections for some advance usage of "rootDevices") |
| "linkTypes" | N | The link type of the net device associated with the PCI device | `string` list Default: `null` | "linkTypes": ["ether"] |
| "ddpProfiles" | N | A map of device selectors | `string` list Default: `null` | "ddpProfiles": ["GTPv1-C/U IPv4/IPv6 payload"] |
| "pKeys" | N | Infiniband Partition Keys. Will match only to the devices' default (index0) PKeys. Compatible only with linkTypes = infiniband | `string` list Default: `null` | "pKeys": ["0x1", "0xABCD", "0x50"] |
| "isRdma" | N | Mount RDMA resources. Incompatible with vdpaType | `bool` values `true` or `false` Default: `false` | "isRdma": `true` |
| "needVhostNet" | N | Share /dev/vhost-net and /dev/net/tun | `bool` values `true` or `false` Default: `false` | "needVhostNet": `true` |
| "vdpaType" | N | The type of vDPA device (virtio, vhost). Incompatible with isRdma = true | `string` values `vhost` or `virtio` Default: `null` | "vdpaType": "vhost" |
Expand Down
8 changes: 8 additions & 0 deletions deployments/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ data:
"drivers": ["mlx5_ib"],
"isRdma": true
}
},
{
"resourceName": "brcm_sriov_bnxt",
"selectors": {
"vendors": ["14e4"],
"devices": ["1750"],
"drivers": ["bnxt_en"]
}
}
]
}
Loading

0 comments on commit 49a1267

Please sign in to comment.