Skip to content
Open
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
21 changes: 21 additions & 0 deletions openshift/install-dpu-p4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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

python3 -m pip install --upgrade pip

# 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