Skip to content

Commit 574d037

Browse files
Merge pull request #4 from rollandf/docker
chore: add Nvidia docker file and workflows
2 parents 61f9a09 + 93570ca commit 574d037

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/workflows/fork-ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: Fork Release CI
15+
16+
on:
17+
push:
18+
branches:
19+
- network-operator-*
20+
tags:
21+
- network-operator-*
22+
23+
jobs:
24+
call-reusable-ci-fork-workflow:
25+
uses: Mellanox/cloud-orchestration-reusable-workflows/.github/workflows/fork-ci-reusable.yml@main
26+
with:
27+
registry-internal: nvcr.io/nvstaging/mellanox
28+
service-account-username: nvidia-ci-cd
29+
service-account-email: [email protected]
30+
components: '[{"name": "SriovDevicePlugin", "imageName": "sriov-network-device-plugin", "Dockerfile": "images/Dockerfile.nvidia"}]'
31+
secrets:
32+
registry-username: ${{ secrets.NVCR_USERNAME }}
33+
registry-token: ${{ secrets.NVCR_TOKEN }}
34+
cicd-gh-token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }}

.github/workflows/fork-sync.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: Fork Sync
15+
16+
on:
17+
schedule:
18+
- cron: '0 0 * * *' # nightly
19+
workflow_dispatch: # enable manual trigger
20+
21+
jobs:
22+
call-reusable-sync-fork-workflow:
23+
uses: Mellanox/cloud-orchestration-reusable-workflows/.github/workflows/fork-sync-reusable.yml@main
24+
with:
25+
upstream-owner: k8snetworkplumbingwg
26+
default-branch: master
27+
secrets:
28+
gh_token: ${{ secrets.GITHUB_TOKEN }}

images/Dockerfile.nvidia

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2025 sriov-network-device-plugin Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM --platform=$BUILDPLATFORM golang:1.23.4 AS builder
16+
ARG TARGETPLATFORM
17+
ARG TARGETARCH
18+
ARG TARGETVARIANT
19+
ARG GCFLAGS
20+
21+
ADD . /usr/src/sriov-network-device-plugin
22+
23+
ENV HTTP_PROXY $http_proxy
24+
ENV HTTPS_PROXY $https_proxy
25+
RUN apt-get update && \
26+
apt-get install -y build-essential linux-headers-generic make && \
27+
cd /usr/src/sriov-network-device-plugin && \
28+
GOOS=linux GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT} make clean && \
29+
GOOS=linux GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT} make build
30+
31+
FROM nvcr.io/nvidia/doca/doca:3.0.0-base-rt-host
32+
33+
ARG TARGETPLATFORM
34+
ARG TARGETARCH
35+
ARG TARGETVARIANT
36+
37+
COPY --from=builder /usr/src/sriov-network-device-plugin/build/sriovdp /usr/bin/
38+
WORKDIR /
39+
40+
COPY --from=builder /usr/src/sriov-network-device-plugin ./src
41+
42+
LABEL io.k8s.display-name="SRIOV Network Device Plugin"
43+
44+
ADD ./images/entrypoint.sh /
45+
46+
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)