Skip to content

Commit 785d519

Browse files
dpf-releaseadrianchiriskvadrageaserdeanalonegrin
committed
DPF Release v25.4.0
Co-authored-by: Adrian Chiris <[email protected]> Co-authored-by: Alexander Petrovskiy <[email protected]> Co-authored-by: Alin Serdean <[email protected]> Co-authored-by: Alon Negrin <[email protected]> Co-authored-by: Amit Zala <[email protected]> Co-authored-by: Asaf Sonis <[email protected]> Co-authored-by: Fred Rolland <[email protected]> Co-authored-by: Freddy Rolland <[email protected]> Co-authored-by: Guy Zilberman <[email protected]> Co-authored-by: Hareesh Puthalath <[email protected]> Co-authored-by: He Jie Xu <[email protected]> Co-authored-by: Ian Lang <[email protected]> Co-authored-by: Igor Ivanov <[email protected]> Co-authored-by: Itai Levy <[email protected]> Co-authored-by: Jonathan Sofri <[email protected]> Co-authored-by: Karam Ghanayem <[email protected]> Co-authored-by: Killian Muldoon <[email protected]> Co-authored-by: Linoy Halfon <[email protected]> Co-authored-by: Mael Kimmerlin <[email protected]> Co-authored-by: Michael Filanov <[email protected]> Co-authored-by: Noam Hofshi <[email protected]> Co-authored-by: Or Shahar <[email protected]> Co-authored-by: Peng Wang (Networking SW) <[email protected]> Co-authored-by: Peng Wang <[email protected]> Co-authored-by: Peter Rudenko <[email protected]> Co-authored-by: Rody Fhaily <[email protected]> Co-authored-by: Roman Pryamonosov <[email protected]> Co-authored-by: Shachar Dor <[email protected]> Co-authored-by: Soule Ba <[email protected]> Co-authored-by: Tarek Abu-Hariri <[email protected]> Co-authored-by: Tetiana Dvorianchenko <[email protected]> Co-authored-by: Tobias Giese <[email protected]> Co-authored-by: Vasilis Remmas <[email protected]> Co-authored-by: Yury Kulazhenkov <[email protected]> Co-authored-by: gzaidman <[email protected]> Co-authored-by: ilang <[email protected]> Co-authored-by: killianmuldoon <[email protected]> Co-authored-by: killianmuldoon <[email protected]> Co-authored-by: rodyf <[email protected]> Signed-off-by: DPF Release bot <[email protected]>
0 parents  commit 785d519

File tree

1,167 files changed

+222449
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,167 files changed

+222449
-0
lines changed

.conform.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
policies:
2+
- type: commit
3+
spec:
4+
header:
5+
# Length is the maximum length of the commit subject.
6+
length: 72
7+
# Imperative enforces the use of imperative verbs as the first word of a
8+
# commit message.
9+
imperative: true
10+
# HeaderCase is the case that the first word of the header must have ("upper" or "lower").
11+
case: lower
12+
body:
13+
# Required enforces that the current commit has a body.
14+
required: true
15+
# DCO enables the Developer Certificate of Origin check.
16+
dco: true
17+
conventional:
18+
types:
19+
- chore
20+
- ci
21+
- docs
22+
- feat
23+
- fix
24+
- refactor
25+
- test
26+
- release
27+
scopes:
28+
- .*

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore build and test binaries.
3+
bin/
4+
testbin/

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
*.tar
9+
*.tgz
10+
*.tar.gz
11+
bin/*
12+
testbin/*
13+
Dockerfile.cross
14+
hack/tools/bin
15+
hack/charts
16+
hack/repos
17+
18+
# Repos created by e2e tests.
19+
scans
20+
artifacts
21+
.gocache
22+
.golangci-cache
23+
24+
# Test binary, built with `go test -c`
25+
*.test
26+
27+
# junit files
28+
*junit.*
29+
# Output of the go coverage tool, specifically when used with LiteIDE
30+
*.out
31+
32+
# Go workspace file
33+
go.work
34+
35+
# All files with a `.tmp` extension
36+
*.tmp
37+
38+
# Kubernetes Generated files - skip generated files, except for vendored files
39+
!vendor/**/zz_generated.*
40+
41+
# editor and IDE paraphernalia
42+
.idea
43+
.vscode
44+
*.swp
45+
*.swo
46+
*~
47+
.devcontainer/
48+
49+
50+
# Ignore version file for third_party components
51+
third_party/forked/ovs-cni/.version
52+

.golangci.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
run:
2+
deadline: 5m
3+
allow-parallel-runners: true
4+
5+
linters:
6+
disable-all: true
7+
enable:
8+
- dupl
9+
- errcheck
10+
- copyloopvar
11+
- gci
12+
- ginkgolinter
13+
- goconst
14+
- gocyclo
15+
- gofmt
16+
- goimports
17+
- gosimple
18+
- govet
19+
- importas
20+
- ineffassign
21+
- misspell
22+
- nakedret
23+
- prealloc
24+
- staticcheck
25+
- stylecheck
26+
- typecheck
27+
- unconvert
28+
- unparam
29+
- unused
30+
31+
linters-settings:
32+
misspell:
33+
locale: US
34+
gci:
35+
sections:
36+
- standard # Standard packages.
37+
- prefix(github.com/nvidia/doca-platform) # Packages from this go module.
38+
- default # All other packages.
39+
custom-order: true
40+
ginkgolinter:
41+
forbid-focus-container: true
42+
importas:
43+
no-unaliased: true
44+
alias:
45+
# DPF
46+
- pkg: github.com/nvidia/doca-platform/api/operator/v1alpha1
47+
alias: operatorv1
48+
- pkg: github.com/nvidia/doca-platform/api/controlplane/v1alpha1
49+
alias: controlplanev1
50+
- pkg: github.com/nvidia/doca-platform/api/dpuservice/v1alpha1
51+
alias: dpuservicev1
52+
- pkg: github.com/nvidia/doca-platform/internal/operator/controllers
53+
alias: operatorcontroller
54+
- pkg: github.com/nvidia/doca-platform/internal/servicechainset/controllers
55+
alias: sfcsetcontroller
56+
- pkg: github.com/nvidia/doca-platform/internal/dpuservice/controllers
57+
alias: dpuservicecontroller
58+
- pkg: github.com/nvidia/doca-platform/internal/controlplane/metadata
59+
alias: controlplanemeta
60+
- pkg: github.com/nvidia/doca-platform/internal/cniprovisioner/dpu/config
61+
alias: dpucniprovisionerconfig
62+
- pkg: github.com/nvidia/doca-platform/internal/cniprovisioner/host/config
63+
alias: hostcniprovisionerconfig
64+
- pkg: github.com/nvidia/doca-platform/api/provisioning/v1alpha1
65+
alias: provisioningv1
66+
67+
# Kubernetes
68+
- pkg: k8s.io/api/core/v1
69+
alias: corev1
70+
- pkg: k8s.io/api/apps/v1
71+
alias: appsv1
72+
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
73+
alias: metav1
74+
- pkg: k8s.io/apimachinery/pkg/api/errors
75+
alias: apierrors
76+
- pkg: k8s.io/apimachinery/pkg/util/errors
77+
alias: kerrors
78+
- pkg: k8s.io/component-base/logs/api/v1
79+
alias: logsv1
80+
- pkg: k8s.io/utils/exec
81+
alias: kexec
82+
- pkg: k8s.io/api/admissionregistration/v1
83+
alias: admissionregistrationv1
84+
- pkg: k8s.io/api/batch/v1
85+
alias: batchv1
86+
87+
# Third party APIs
88+
- pkg: github.com/nvidia/doca-platform/third_party/api/nvipam/api/v1alpha1
89+
alias: nvipamv1
90+
- pkg: github.com/nvidia/doca-platform/third_party/api/kamaji/api/v1alpha1
91+
alias: kamajiv1
92+
- pkg: github.com/nvidia/doca-platform/third_party/api/argocd/api/application/v1alpha1
93+
alias: argov1
94+
95+
# Controller Runtime
96+
- pkg: sigs.k8s.io/controller-runtime
97+
alias: ctrl
98+
stylecheck:
99+
# Disable ST1000: https://staticcheck.dev/docs/checks#ST1000
100+
checks: [ "all", "-ST1000" ]
101+
dot-import-whitelist:
102+
- github.com/onsi/ginkgo/v2
103+
- github.com/onsi/gomega
104+
105+
106+
issues:
107+
max-issues-per-linter: 0
108+
max-same-issues: 0
109+
exclude-use-default: false
110+
# Exclude vendored directories from linting.
111+
exclude-dirs:
112+
- third_party
113+
exclude-rules:
114+
- path: _test\.go
115+
linters:
116+
- dupl

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ARG builder_image
2+
ARG base_image
3+
4+
# Build the manager binary (no emulation)
5+
FROM --platform=${BUILDPLATFORM} ${builder_image} AS builder
6+
ARG TARGETOS
7+
ARG TARGETARCH
8+
9+
WORKDIR /workspace
10+
# Copy the Go Modules manifests
11+
COPY go.mod go.mod
12+
COPY go.sum go.sum
13+
# Cache deps before building and copying source so that we don't need to re-download as much
14+
# and so that source changes don't invalidate our downloaded layer
15+
RUN --mount=type=cache,target=/go/pkg/mod \
16+
go mod download
17+
18+
# Copy the go source
19+
COPY ./ ./
20+
21+
ARG package=.
22+
ARG gcflags
23+
ARG ldflags
24+
RUN --mount=type=cache,target=/root/.cache/go-build \
25+
--mount=type=cache,target=/go/pkg/mod \
26+
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
27+
go build -trimpath \
28+
-ldflags="${ldflags}" \
29+
-gcflags="${gcflags}" \
30+
-o manager ${package}
31+
32+
FROM ${base_image}
33+
WORKDIR /
34+
COPY --from=builder /workspace/manager .
35+
USER 65532:65532
36+
37+
ENTRYPOINT ["/manager"]

Dockerfile.bfb-registry

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Stage 1: Build Tengine
2+
ARG base_image=ubuntu:22.04
3+
FROM ${base_image} AS builder
4+
5+
ARG tengine_version=3.1.0
6+
7+
ARG PACKAGES="wget unzip build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev gettext"
8+
9+
# Enable deb-src to be able to fetch sources
10+
RUN sed -i 's/^# deb-src/deb-src/g' /etc/apt/sources.list
11+
12+
RUN apt update && apt install -y ${PACKAGES}
13+
14+
WORKDIR /workspace
15+
RUN wget https://github.com/alibaba/tengine/archive/refs/tags/${tengine_version}.zip && unzip ${tengine_version}.zip
16+
17+
WORKDIR /workspace/tengine-${tengine_version}
18+
RUN ./configure --add-dynamic-module=modules/ngx_http_concat_module
19+
RUN make && make install
20+
21+
# Create necessary directories in the builder stage
22+
RUN mkdir -p /nginx
23+
24+
# Move source code to a directory
25+
WORKDIR /workspace
26+
RUN mkdir src && \
27+
cd src && \
28+
cp /workspace/${tengine_version}.zip . && \
29+
apt-get source ${PACKAGES} && \
30+
cd /workspace && \
31+
tar -czf source-code.tar.gz src
32+
33+
# Stage 2: Create final image based on distroless
34+
FROM nvcr.io/nvidia/doca/dpf_containers:1.0.2-ubuntu22.04-distroless AS distroless
35+
36+
# copy the tengine source code
37+
ARG version=3.1.0
38+
COPY --from=builder /workspace/source-code.tar.gz source-code.tar.gz
39+
40+
# libraries for the nginx binary
41+
COPY --from=builder /lib/x86_64-linux-gnu/libpcre.so* /lib/x86_64-linux-gnu/
42+
COPY --from=builder /lib/x86_64-linux-gnu/libssl.so* /lib/x86_64-linux-gnu/
43+
COPY --from=builder /lib/x86_64-linux-gnu/libcrypto.so* /lib/x86_64-linux-gnu/
44+
COPY --from=builder /lib/x86_64-linux-gnu/libz.so* /lib/x86_64-linux-gnu/
45+
COPY --from=builder /lib/x86_64-linux-gnu/libcrypt.so* /lib/x86_64-linux-gnu/
46+
COPY --from=builder /bin/sh /bin/
47+
COPY --from=builder /bin/envsubst /bin/
48+
# ${uid}:${uid} can execute the binary but can not modify it. Refer to https://sonar-sw.nvidia.com/coding_rules?open=docker%3AS6504&rule_key=docker%3AS6504 for more details.
49+
COPY --chown=root:root --chmod=755 --from=builder /usr/local/nginx /usr/local/nginx
50+
51+
ENV uid=65532
52+
53+
# Copy nginx directory with non-root ownership. The directory is copied instead of created to avoid the need of mkdir and chown binaries.
54+
# nginx.conf and all the temp files are in the /nginx directory.
55+
# This approach complies with S6504 because we're only changing ownership of non-executable directories
56+
COPY --chown=${uid}:${uid} --chmod=700 --from=builder /nginx /nginx
57+
58+
USER ${uid}:${uid}

Dockerfile.dpf-system

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
ARG builder_image
2+
ARG base_image
3+
4+
# 1) Builder stage builds go binaries (no emulation).
5+
FROM --platform=${BUILDPLATFORM} ${builder_image} AS builder
6+
WORKDIR /workspace
7+
8+
# Copy the Go Modules manifests
9+
COPY go.mod go.mod
10+
COPY go.sum go.sum
11+
# Cache deps before building and copying source so that we don't need to re-download as much
12+
# and so that source changes don't invalidate our downloaded layer
13+
RUN --mount=type=cache,target=/go/pkg/mod \
14+
go mod download
15+
16+
COPY ./ ./
17+
18+
# Ensure that no additional tools or artifacts are included.
19+
RUN make clean
20+
21+
ARG gcflags
22+
ARG ldflags
23+
ARG TARGETARCH
24+
ARG TAG
25+
26+
ENV GO_LDFLAGS=\"${ldflags}\"
27+
ENV GO_GCFLAGS=\"${gcflags}\"
28+
ENV ARCH=${TARGETARCH}
29+
# The TAG variable is necessary for the dpfctl versioning.
30+
ENV TAG=${TAG}
31+
32+
RUN --mount=type=cache,target=/root/.cache/go-build \
33+
--mount=type=cache,target=/go/pkg/mod \
34+
make binaries-dpf-system
35+
36+
# Copy the go source code so it can be distributed in the final image.
37+
RUN go mod vendor
38+
RUN mkdir src && \
39+
find . -name '*.go' -not -path "./hack/*" -not -path "./.gocache/*" -exec cp --parents \{\} src/ \; && \
40+
tar -czf source-code.tar.gz src
41+
42+
# 2) Final stage copies artefacts from the builder and dependency stages.
43+
FROM ${base_image}
44+
ARG TARGETARCH
45+
46+
WORKDIR /
47+
48+
# Ensure all files are copied with the correct user.
49+
ENV uid=65532
50+
USER ${uid}:${uid}
51+
52+
# Add the source code.
53+
COPY --chown=${uid} --from=builder /workspace/source-code.tar.gz source-code.tar.gz
54+
55+
# Add the DPF system binaries
56+
COPY --chown=${uid} --from=builder /workspace/bin/operator .
57+
COPY --chown=${uid} --from=builder /workspace/bin/provisioning .
58+
COPY --chown=${uid} --from=builder /workspace/bin/dpuservice .
59+
COPY --chown=${uid} --from=builder /workspace/bin/servicechainset .
60+
COPY --chown=${uid} --from=builder /workspace/bin/sfc-controller .
61+
COPY --chown=${uid} --from=builder /workspace/bin/kamaji-cluster-manager .
62+
COPY --chown=${uid} --from=builder /workspace/bin/static-cluster-manager .
63+
COPY --chown=${uid} --from=builder /workspace/bin/ovshelper .
64+
COPY --chown=${uid} --from=builder /workspace/bin/dpfctl .
65+
COPY --chown=${uid} --from=builder /workspace/bin/dpu-detector .
66+
67+

0 commit comments

Comments
 (0)