Skip to content

Commit 43622b6

Browse files
Add CI and build support for dpf-utils components
- Add build-dpf-utils job to build-images workflow for multi-arch container builds - Add test-dpf-utils workflow to run lint and test on dpf-utils code - Update Makefile with lint and test targets for dpf-utils - Update Makefile to build dpf-utils Docker image - Configure helm chart to use dpf-utils image for: - ovn-kubernetes-resource-injector webhook - dpuManifests ipallocator and cniprovisioner containers - Remove unused nodeWithoutDPUManifests.imagedpf from helm values
1 parent 54f41bc commit 43622b6

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

.github/workflows/build-images.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
REGISTRY: ghcr.io
1616
IMAGE_NAME_UBUNTU: ghcr.io/mellanox/ovn-kubernetes-dpf
1717
IMAGE_NAME_FEDORA: ghcr.io/mellanox/ovn-kubernetes-dpf-fedora
18+
IMAGE_NAME_DPF_UTILS: ghcr.io/mellanox/ovn-kubernetes-dpf-utils
1819

1920
jobs:
2021
build-ubuntu:
@@ -135,3 +136,61 @@ jobs:
135136
cache-to: type=gha,mode=max
136137
provenance: false
137138

139+
build-dpf-utils:
140+
runs-on: ubuntu-latest
141+
permissions:
142+
contents: read
143+
packages: write
144+
145+
steps:
146+
- name: Checkout repository
147+
uses: actions/checkout@v4
148+
with:
149+
submodules: recursive
150+
fetch-depth: 0
151+
152+
- name: Determine tag
153+
id: tag
154+
run: |
155+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
156+
TAG=${GITHUB_REF#refs/tags/}
157+
else
158+
TAG=v25.7.1-${GITHUB_SHA::7}
159+
fi
160+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
161+
162+
- name: Set up QEMU
163+
uses: docker/setup-qemu-action@v3
164+
165+
- name: Set up Docker Buildx
166+
uses: docker/setup-buildx-action@v3
167+
168+
- name: Log in to Container Registry
169+
if: github.event_name != 'pull_request'
170+
uses: docker/login-action@v3
171+
with:
172+
registry: ${{ env.REGISTRY }}
173+
username: ${{ github.actor }}
174+
password: ${{ secrets.GITHUB_TOKEN }}
175+
176+
- name: Extract metadata (labels only)
177+
id: meta
178+
uses: docker/metadata-action@v5
179+
with:
180+
images: ${{ env.IMAGE_NAME_DPF_UTILS }}
181+
182+
- name: Build and push DPF Utils image
183+
uses: docker/build-push-action@v5
184+
with:
185+
context: ./dpf-utils
186+
file: ./dpf-utils/Dockerfile
187+
platforms: linux/amd64,linux/arm64
188+
push: ${{ github.event_name != 'pull_request' }}
189+
tags: ${{ env.IMAGE_NAME_DPF_UTILS }}:${{ steps.tag.outputs.tag }}
190+
labels: ${{ steps.meta.outputs.labels }}
191+
build-args: |
192+
builder_image=quay.io/projectquay/golang:1.24
193+
cache-from: type=gha
194+
cache-to: type=gha,mode=max
195+
provenance: false
196+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test and Lint DPF Utils
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'dpf-utils/**'
9+
- '.github/workflows/test-dpf-utils.yaml'
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- 'dpf-utils/**'
15+
- '.github/workflows/test-dpf-utils.yaml'
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.24'
28+
29+
- name: Run tests
30+
run: make test
31+
32+
lint:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Go
39+
uses: actions/setup-go@v5
40+
with:
41+
go-version: '1.24'
42+
43+
- name: Run linter
44+
run: make lint
45+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test and Lint DPF Utils
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'dpf-utils/**'
9+
- '.github/workflows/test-dpf-utils.yaml'
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- 'dpf-utils/**'
15+
- '.github/workflows/test-dpf-utils.yaml'
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.24'
28+
29+
- name: Run tests
30+
run: make test
31+
32+
lint:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Go
39+
uses: actions/setup-go@v5
40+
with:
41+
go-version: '1.24'
42+
43+
- name: Run linter
44+
run: make lint
45+

0 commit comments

Comments
 (0)