Skip to content

Commit

Permalink
New govpp tagging.
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Guschin <vitaliy.guschin@spirent.com>
  • Loading branch information
Vitaliy Guschin committed Feb 28, 2024
1 parent 43babf5 commit 0617239
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,16 @@ jobs:
if: steps.docker_login.outcome == 'success'
run: |
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/${{github.repository}}/vpp:${TAG} . --target vpp --push
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/${{github.repository}}/vpp-dbg:${TAG} . --target vpp-dbg --push
echo docker_tag=${TAG} >> $GITHUB_OUTPUT
- name: Push tag ${TAG}
id: tag_commit
if: steps.docker_push.outcome == 'success'
run: |
git status
git tag ${TAG} ${{github.sha}}
git push origin ${TAG} -f
delete_github_runner:
name: Delete actions runner
if: ${{ always() }}
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Release

on:
workflow_run:
types:
- completed
workflows:
- "ci"
jobs:
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 tag=${branch#release/} >> $GITHUB_OUTPUT
id: get-tag-step

check-gomod-deps:
needs: get-tag
uses: networkservicemesh/.github/.github/workflows/check-gomod-deps.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}

create-release:
needs: [get-tag, check-gomod-deps]
uses: networkservicemesh/.github/.github/workflows/release.yaml@main
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

docker:
needs: [get-tag, check-gomod-deps]
uses: networkservicemesh/.github/.github/workflows/docker-release.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

check-branch:
name: Check release branch in deployments-k8s
needs: [get-tag, create-release]
uses: networkservicemesh/.github/.github/workflows/check-release-branch.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

update-deployments-k8s:
name: Update deployments-k8s
needs: [get-tag, check-branch]
if: ${{ github.repository != 'networkservicemesh/cmd-template' }}
uses: networkservicemesh/.github/.github/workflows/release-deployments.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,32 @@
This repo provides the go binding for a version of vpp.

```go
import "github.com/edwarnicke/govpp/binapi"
import "github.com/networkservicemesh/govpp/binapi"
```

This repo also provides minimal docker containers for running vpp:
This repo also provides minimal docker container for running vpp:

- [vpp](https://github.com/users/edwarnicke/packages/container/package/govpp%2Fvpp)
- [vpp-dbg](https://github.com/users/edwarnicke/packages/container/package/govpp%2Fvpp) - debug image
- [vpp](https://github.com/networkservicemesh/govpp/pkgs/container/govpp%2Fvpp)

## How to match the version of vpp you want to the go bindings.

Whenever a combination of [VPP_VERSION](https://github.com/edwarnicke/govpp/blob/e0e3b4843cf510bccc6e6a6eac43729a5e5fa42f/Dockerfile#L1)
and [cherrypicks/patches](https://github.com/edwarnicke/govpp/blob/e0e3b4843cf510bccc6e6a6eac43729a5e5fa42f/patch/patch.sh) is used to build vpp/vpp-dbg docker containers,
Whenever a combination of [VPP_VERSION](https://github.com/networkservicemesh/govpp/blob/main/Dockerfile#L1)
and [cherrypicks/patches](https://github.com/networkservicemesh/govpp/blob/main/patch/patch.sh) is used to build vpp docker container,
they will be tagged in the docker repo. The corresponding tag will be laid on the main branch containing the corresponding
binapi.

So simply run in the same directory as your go.mod file:

```bash
go get github.com/edwarnicke/govpp/binapi@${tag}
go get github.com/networkservicemesh/govpp/binapi@${tag}
```

Where `${tag}` is the tag of the vpp container you are consuming.

For example:

```bash
go get github.com/edwarnicke/govpp/binapi@v21.06.0-9-16f166164
go get github.com/networkservicemesh/govpp/binapi@v21.06.0-9-16f166164
```

To set your go dependency for govpp to match the docker container you are using.
Expand All @@ -39,21 +38,21 @@ To set your go dependency for govpp to match the docker container you are using.
If you want a version of VPP, you can fork *this* repo and add it yourself.
Because things are very heavily patterned and generated, its really quite easy:

1. Change default value for ARG VPP_VERSION in [Dockerfile](https://github.com/edwarnicke/govpp/blob/main/Dockerfile#L1) to the vpp tag or commit id you want to build.
1. Change default value for ARG VPP_VERSION in [Dockerfile](https://github.com/networkservicemesh/govpp/blob/main/Dockerfile#L1) to the vpp tag or commit id you want to build.
2. ```go generate ./...```
3. Push a PR to your fork and merge it. This will push the vpp and vpp-dbg images to your repo.
3. Push a PR to your fork and merge it. This will push the vpp image to your repo.

## What to do if you need to cherrypick into VPP

See [patch/patch.sh]. Simply add your cherrypicks to that file.

## What to do if you need to patch vpp:

If you want to add patches to vpp simply add them with the `.patch` suffix to the [patch/](https://github.com/edwarnicke/govpp/blob/main/patch/) directory.
If you want to add patches to vpp simply add them with the `.patch` suffix to the [patch/](https://github.com/networkservicemesh/govpp/blob/main/patch/) directory.

## What to do if you need a different version of govpp

Change the version of [govpp in the go.mod file](https://github.com/edwarnicke/govpp/blob/main/go.mod#L5)
Change the version of [govpp in the go.mod file](https://github.com/networkservicemesh/govpp/blob/main/go.mod#L5)

## How the magic works ##

Expand Down

0 comments on commit 0617239

Please sign in to comment.