From a54007d5a67f4194a9c6986b4e0f45f42587d26f Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:19:36 +1100 Subject: [PATCH 1/7] fix release and pr-for-updates workflows Signed-off-by: Nikita Skrynnik --- .github/workflows/pr-for-updates.yaml | 61 +++---------------- .github/workflows/release.yaml | 52 +++++++++++++--- .../update-dependent-repositories-gomod.yaml | 2 +- 3 files changed, 51 insertions(+), 64 deletions(-) diff --git a/.github/workflows/pr-for-updates.yaml b/.github/workflows/pr-for-updates.yaml index b53226ef..4561cf6a 100644 --- a/.github/workflows/pr-for-updates.yaml +++ b/.github/workflows/pr-for-updates.yaml @@ -1,58 +1,11 @@ --- -name: Release +name: Pull Request on update/* Branch Push on: - workflow_run: - types: - - completed - workflows: - - "ci" + push: + branches: + - update/** jobs: - print-debug-info: - name: Print debug info for Release workflow - runs-on: ubuntu-latest - steps: - - uses: hmarr/debug-action@v2 - - get-tag: - name: Get tag - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }} - outputs: - tag: ${{ steps.get-tag-step.outputs.tag }} - steps: - - name: Get tag - run: | - branch=${{github.event.workflow_run.head_branch}} - echo '::set-output name=tag::'${branch#release/} - id: get-tag-step - - create-release: - name: Create release - needs: get-tag - uses: networkservicemesh/.github/.github/workflows/release.yaml@main - with: - tag: ${{ needs.get-tag.outputs.tag }} + auto-pull-request: + uses: networkservicemesh/.github/.github/workflows/pr-for-updates.yaml@main secrets: - token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} - - release-dependent-repositories: - name: Release dependent repositories - needs: [get-tag, create-release] - uses: networkservicemesh/.github/.github/workflows/release-dependent-repositories.yaml@main - with: - tag: ${{ needs.get-tag.outputs.tag }} - dependent_repositories: | - ["sdk-k8s", - "sdk-kernel", - "cmd-nsmgr", - "cmd-nsmgr-proxy", - "cmd-registry-memory", - "cmd-registry-proxy-dns", - "cmd-nse-remote-vlan", - "cmd-nse-vfio", - "cmd-nsc-init", - "cmd-ipam-vl3", - "cmd-map-ip-k8s", - "cmd-admission-webhook-k8s"] - secrets: - token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2edcceb5..b53226ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,20 +5,54 @@ on: types: - completed workflows: - - 'ci' + - "ci" jobs: - release: + print-debug-info: + name: Print debug info for Release workflow + runs-on: ubuntu-latest + steps: + - uses: hmarr/debug-action@v2 + + get-tag: + name: Get tag + runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }} + outputs: + tag: ${{ steps.get-tag-step.outputs.tag }} + steps: + - name: Get tag + run: | + branch=${{github.event.workflow_run.head_branch}} + echo '::set-output name=tag::'${branch#release/} + id: get-tag-step + + create-release: + name: Create release + needs: get-tag uses: networkservicemesh/.github/.github/workflows/release.yaml@main with: + tag: ${{ needs.get-tag.outputs.tag }} + secrets: + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} + + release-dependent-repositories: + name: Release dependent repositories + needs: [get-tag, create-release] + uses: networkservicemesh/.github/.github/workflows/release-dependent-repositories.yaml@main + with: + tag: ${{ needs.get-tag.outputs.tag }} dependent_repositories: | - ["cmd-forwarder-sriov", - "cmd-nsc", + ["sdk-k8s", + "sdk-kernel", + "cmd-nsmgr", + "cmd-nsmgr-proxy", + "cmd-registry-memory", + "cmd-registry-proxy-dns", + "cmd-nse-remote-vlan", + "cmd-nse-vfio", "cmd-nsc-init", - "cmd-nse-icmp-responder", - "cmd-forwarder-vpp", - "cmd-nse-vlan-vpp", - "sdk-ovs"] - + "cmd-ipam-vl3", + "cmd-map-ip-k8s", + "cmd-admission-webhook-k8s"] secrets: token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/update-dependent-repositories-gomod.yaml b/.github/workflows/update-dependent-repositories-gomod.yaml index 1f98990c..17e9c5fa 100644 --- a/.github/workflows/update-dependent-repositories-gomod.yaml +++ b/.github/workflows/update-dependent-repositories-gomod.yaml @@ -10,7 +10,7 @@ on: workflows: - 'automerge' jobs: - release: + update-dependent-repos: if: ${{ github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' || github.event_name == 'push' }} uses: networkservicemesh/.github/.github/workflows/update-dependent-repositories-gomod.yaml@main with: From b58837369fa9e9d54e0d4686d13faf8b47b1bbc0 Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:25:38 +1100 Subject: [PATCH 2/7] fix linter Signed-off-by: Nikita Skrynnik --- .github/workflows/pr-for-updates.yaml | 2 +- pkg/networkservice/common/mechanisms/vfio/const_test.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-for-updates.yaml b/.github/workflows/pr-for-updates.yaml index 4561cf6a..86c9ea96 100644 --- a/.github/workflows/pr-for-updates.yaml +++ b/.github/workflows/pr-for-updates.yaml @@ -8,4 +8,4 @@ jobs: auto-pull-request: uses: networkservicemesh/.github/.github/workflows/pr-for-updates.yaml@main secrets: - token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} diff --git a/pkg/networkservice/common/mechanisms/vfio/const_test.go b/pkg/networkservice/common/mechanisms/vfio/const_test.go index 808210e3..36f1be96 100644 --- a/pkg/networkservice/common/mechanisms/vfio/const_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/const_test.go @@ -18,6 +18,5 @@ package vfio_test const ( vfioDevice = "vfio" - iommuGroup = 1 iommuGroupString = "1" ) From 934e2ab65f4bc52c0adc8865613b941d6e2feda4 Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:28:45 +1100 Subject: [PATCH 3/7] fix linter Signed-off-by: Nikita Skrynnik --- pkg/networkservice/common/mechanisms/vfio/const_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/networkservice/common/mechanisms/vfio/const_test.go b/pkg/networkservice/common/mechanisms/vfio/const_test.go index 36f1be96..08b819a7 100644 --- a/pkg/networkservice/common/mechanisms/vfio/const_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/const_test.go @@ -1,5 +1,7 @@ // Copyright (c) 2020-2021 Doc.ai and/or its affiliates. // +// Copyright (c) 2022 Cisco and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); From e569f25243ebf39a85c4b89d7ae90035078fdf2c Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:47:58 +1100 Subject: [PATCH 4/7] fix dependent-repos list Signed-off-by: Nikita Skrynnik --- .github/workflows/release.yaml | 17 ++++++----------- .../common/mechanisms/vfio/const_test.go | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b53226ef..8f35e826 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -42,17 +42,12 @@ jobs: with: tag: ${{ needs.get-tag.outputs.tag }} dependent_repositories: | - ["sdk-k8s", - "sdk-kernel", - "cmd-nsmgr", - "cmd-nsmgr-proxy", - "cmd-registry-memory", - "cmd-registry-proxy-dns", - "cmd-nse-remote-vlan", - "cmd-nse-vfio", + ["cmd-forwarder-sriov", + "cmd-nsc", "cmd-nsc-init", - "cmd-ipam-vl3", - "cmd-map-ip-k8s", - "cmd-admission-webhook-k8s"] + "cmd-nse-icmp-responder", + "cmd-forwarder-vpp", + "cmd-nse-vlan-vpp", + "sdk-ovs"] secrets: token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} diff --git a/pkg/networkservice/common/mechanisms/vfio/const_test.go b/pkg/networkservice/common/mechanisms/vfio/const_test.go index 08b819a7..86c10ff1 100644 --- a/pkg/networkservice/common/mechanisms/vfio/const_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/const_test.go @@ -20,5 +20,6 @@ package vfio_test const ( vfioDevice = "vfio" + iommuGroup = 1 iommuGroupString = "1" ) From 13aba390f72227332012888102aab748157e212a Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:48:42 +1100 Subject: [PATCH 5/7] cleanup Signed-off-by: Nikita Skrynnik --- pkg/networkservice/common/mechanisms/vfio/const_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/networkservice/common/mechanisms/vfio/const_test.go b/pkg/networkservice/common/mechanisms/vfio/const_test.go index 86c10ff1..808210e3 100644 --- a/pkg/networkservice/common/mechanisms/vfio/const_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/const_test.go @@ -1,7 +1,5 @@ // Copyright (c) 2020-2021 Doc.ai and/or its affiliates. // -// Copyright (c) 2022 Cisco and/or its affiliates. -// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); From 9c6b5e9bd7deb4214aafcf19ad8d270e149714a3 Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 21:51:33 +1100 Subject: [PATCH 6/7] fix linter Signed-off-by: Nikita Skrynnik --- pkg/networkservice/common/mechanisms/vfio/const_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/networkservice/common/mechanisms/vfio/const_test.go b/pkg/networkservice/common/mechanisms/vfio/const_test.go index 808210e3..08b819a7 100644 --- a/pkg/networkservice/common/mechanisms/vfio/const_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/const_test.go @@ -1,5 +1,7 @@ // Copyright (c) 2020-2021 Doc.ai and/or its affiliates. // +// Copyright (c) 2022 Cisco and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +20,5 @@ package vfio_test const ( vfioDevice = "vfio" - iommuGroup = 1 iommuGroupString = "1" ) From 9dd41cd173c1a19e262f6f61ca920d5b4e3a2c4f Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 30 Jun 2022 23:34:23 +1100 Subject: [PATCH 7/7] move constants to client_test.go file Signed-off-by: Nikita Skrynnik --- pkg/networkservice/common/mechanisms/vfio/client_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/networkservice/common/mechanisms/vfio/client_test.go b/pkg/networkservice/common/mechanisms/vfio/client_test.go index f2d89fe8..00731547 100644 --- a/pkg/networkservice/common/mechanisms/vfio/client_test.go +++ b/pkg/networkservice/common/mechanisms/vfio/client_test.go @@ -46,6 +46,7 @@ import ( const ( serverSocket = "server.socket" cgroupDir = "cgroup_dir" + iommuGroup = 1 ) func testServer(ctx context.Context, tmpDir string) (*grpc.ClientConn, error) {