Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Dockerfile.IntelP4.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,31 @@ WORKDIR /src
RUN dnf install -y \
kmod \
gettext \
python3-pip \
python3-devel \
pciutils \
libnl3 \
libedit \
net-tools \
libatomic \
libconfig \
gcc gcc-c++ \
&& dnf clean all
&& dnf clean all \
&& python3 -m ensurepip --upgrade

RUN mkdir -p /opt/${P4_NAME}
COPY cmd/intelvsp/$P4_NAME/* /opt/${P4_NAME}/
COPY cmd/intelvsp/p4sdk/entrypoint.sh /
COPY cmd/intelvsp/p4sdk/es2k_skip_p4.conf.template /


RUN python3 -m pip install --no-cache-dir \
netaddr==1.2.1

WORKDIR /

# Add steps for cachito
ENV REMOTE_SOURCES=${REMOTE_SOURCES:-"./openshift/"}
ENV REMOTE_SOURCES_DIR=${REMOTE_SOURCES_DIR:-"/cachito"}
COPY ${REMOTE_SOURCES} ${REMOTE_SOURCES_DIR}
COPY openshift/install-dpu.sh .
RUN chmod +x install-dpu.sh \
&& ./install-dpu.sh
COPY openshift/install-dpu-p4.sh .
RUN chmod +x install-dpu-p4.sh \
&& ./install-dpu-p4.sh

# Remove packages which are only needed for cachito
RUN dnf remove -y gcc gcc-c++ \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OPERATOR_SDK_VERSION ?= v1.37.0
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27.1
ENVTEST_K8S_VERSION = 1.31.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -306,7 +306,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) GOFLAGS='' go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.16
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) GOFLAGS='' go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.20

.PHONY: operator-sdk
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
Expand Down
19 changes: 19 additions & 0 deletions openshift/install-dpu-p4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -euo pipefail

PIP_OPTS="--no-cache-dir"
# Check if we are building the image in the OSBS environment. If so, source the
# env vars specific for enabling cachito.
if [ -d ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps ]; then
source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env
cd ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/app/openshift
export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=16
else
cd ${REMOTE_SOURCES_DIR}
fi

# Install the packages in order of build dependency to avoid issues during installation.
python3 -m pip install ${PIP_OPTS} -r requirements-p4.txt

rm -rf ${REMOTE_SOURCES_DIR}
1 change: 1 addition & 0 deletions openshift/requirements-p4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
netaddr==1.2.1
2 changes: 1 addition & 1 deletion taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vars:
sh: if [[ "{{.BINDIR}}" = /* ]]; then echo "{{.BINDIR}}"; else echo "$(pwd)/{{.BINDIR}}"; fi
REGISTRY:
sh: hostname | sed 's/$/:5000/'
ENVTEST_K8S_VERSION: 1.27.1
ENVTEST_K8S_VERSION: 1.31.0
CONTROLLER_TOOLS_VERSION: v0.19.0
KUSTOMIZE_VERSION: v5.6.0
GINKGO_VERSION:
Expand Down