Skip to content

Commit 1a4bd04

Browse files
committed
Test support for Mellanox interfaces
1 parent 322f394 commit 1a4bd04

File tree

6 files changed

+40
-16
lines changed

6 files changed

+40
-16
lines changed

grout-container-app/cnfapp/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Image to build webserver
2-
FROM docker.io/library/golang:1.23 as build
2+
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as build
33

4-
WORKDIR /utils
4+
WORKDIR /opt/app-root/src
55
COPY utils/webserver.go .
66
RUN go mod init webserver.go
77
RUN GOOS=linux CGO_ENABLED=0 go build -a -o webserver .
@@ -53,7 +53,7 @@ RUN chmod 750 /var/log/grout
5353
RUN chown example-cnf /var/log/grout
5454

5555
# Copy scripts
56-
COPY --chmod=550 --from=build /utils/webserver /usr/local/bin/webserver
56+
COPY --chmod=550 --from=build /opt/app-root/src/webserver /usr/local/bin/webserver
5757
COPY --chmod=550 scripts/grout-wrapper /usr/local/bin/example-cnf/grout-wrapper
5858
COPY --chmod=550 scripts/retrieve-grout-ip-addresses /usr/local/bin/example-cnf/retrieve-grout-ip-addresses
5959

testpmd-container-app/cnfapp/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
FROM quay.io/rh-nfv-int/dpdk:v0.0.1 as build
33

44
## Image to build webserver
5-
FROM docker.io/library/golang:1.23 as build2
5+
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as build2
66

7-
WORKDIR /utils
7+
WORKDIR /opt/app-root/src
88
COPY utils/webserver.go .
99
RUN go mod init webserver.go
1010
RUN GOOS=linux CGO_ENABLED=0 go build -a -o webserver .
@@ -43,7 +43,7 @@ RUN chmod 750 /var/log/testpmd
4343
RUN chown example-cnf /var/log/testpmd
4444

4545
# Copy scripts
46-
COPY --chmod=550 --from=build2 /utils/webserver /usr/local/bin/webserver
46+
COPY --chmod=550 --from=build2 /opt/app-root/src/webserver /usr/local/bin/webserver
4747
COPY --chmod=550 --from=build /usr/local/bin/dpdk-testpmd /usr/local/bin/example-cnf/testpmd
4848
COPY --chmod=550 scripts/testpmd-wrapper /usr/local/bin/example-cnf/testpmd-wrapper
4949

testpmd-container-app/cnfapp/scripts/testpmd-wrapper

+6-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ if [ -f /sys/fs/cgroup/cpuset/cpuset.cpus ]; then
4545
elif [ -f /sys/fs/cgroup/cpuset.cpus ]; then
4646
# Applied to latest OCP 4.16 nightlies starting from 4.16.0 ec.5
4747
LCORES=$(cat /sys/fs/cgroup/cpuset.cpus)
48+
elif [ -f /proc/1/status ]; then
49+
# Applied when using a privileged pod, since /sys/fs/cgroup directory is overriden with host configuration
50+
# Extract the list of CPUs from /proc/1/status file
51+
LCORES=$(cat /proc/1/status | grep Cpus_allowed_list | awk '{print $2}')
4852
else
49-
echo "Could not find file to extract cores, existing.."
53+
echo "Could not find file to extract cores, exiting..."
5054
exit 1
5155
fi
5256

5357
if [ -z $LCORES ]; then
54-
echo "Could not find cores, existing.."
58+
echo "Could not find cores, exiting..."
5559
exit 1
5660
fi
5761

trex-container-app/app/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM docker.io/library/golang:1.23 as build
1+
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as build
22

3-
WORKDIR /utils
3+
WORKDIR /opt/app-root/src
44
COPY utils/webserver.go .
55
RUN go mod init webserver.go
66
RUN GOOS=linux CGO_ENABLED=0 go build -a -o webserver .
@@ -45,7 +45,7 @@ RUN chown example-cnf:example-cnf /var/log/trex
4545

4646
# Copy scripts
4747
COPY --chmod=550 scripts /usr/local/bin/
48-
COPY --chmod=550 --from=build /utils/webserver /usr/local/bin/webserver
48+
COPY --chmod=550 --from=build /opt/app-root/src/webserver /usr/local/bin/webserver
4949
COPY --chmod=550 pyfiles /opt/pyfiles/
5050

5151
# Move to the custom user

trex-container-app/server/Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM docker.io/library/golang:1.23 as build
1+
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as build
22

3-
WORKDIR /utils
3+
WORKDIR /opt/app-root/src
44
COPY utils/webserver.go .
55
RUN go mod init webserver.go
66
RUN GOOS=linux CGO_ENABLED=0 go build -a -o webserver .
77

88
## trex image
9-
FROM quay.io/rh-nfv-int/ubi8-base-trex:v0.0.1
9+
FROM quay.io/rh-nfv-int/ubi8-base-trex:v0.0.2
1010

1111
LABEL name="NFV Example TRexServer Application" \
1212
maintainer="telcoci" \
@@ -44,11 +44,13 @@ RUN dnf install -y \
4444
zlib-devel \
4545
binutils \
4646
vim \
47+
hostname \
4748
&& dnf clean all
4849

50+
# Install TRex
4951
RUN mkdir -p /opt/trex && cd /opt/trex && git clone --branch ${TREX_VER} ${TREX_REPO}
5052
RUN cd /opt/trex/trex-core/linux_dpdk && \
51-
./b configure --no-mlx --no-bxnt --new-memory && \
53+
./b configure --no-bnxt --new-memory && \
5254
./b build
5355

5456
RUN cd /opt && git clone ${TRAFFICGEN_REPO} && mv bench-trafficgen/trafficgen . && rm -rf bench-trafficgen
@@ -79,7 +81,8 @@ RUN chmod 664 /usr/local/bin/example-cnf/trex_cfg.yaml
7981

8082
# Copy scripts
8183
COPY --chmod=550 scripts /usr/local/bin
82-
COPY --chmod=550 --from=build /utils/webserver /usr/local/bin/webserver
84+
COPY --chmod=550 --from=build /opt/app-root/src/webserver /usr/local/bin/webserver
8385

8486
# Move to the custom user
8587
USER example-cnf
88+

utils/support-images/ubi8-base-trex/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,21 @@ RUN dnf install -y \
88
perf \
99
tcpdump \
1010
sudo \
11+
bison \
12+
wget \
1113
&& dnf clean all
14+
15+
# Install doca-ofed for Mellanox support
16+
# Check https://trex-tgn.cisco.com/trex/doc/trex_appendix_mellanox.html
17+
# Installation steps: https://docs.nvidia.com/doca/sdk/doca-host+installation+and+upgrade/index.html
18+
# (Check "Installing Software on Host" section)
19+
ENV DOCA_OFED_MAJOR_VERSION 2.10.0
20+
ENV DOCA_OFED_RPM doca-host-${DOCA_OFED_MAJOR_VERSION}-093000_25.01_rhel82.x86_64.rpm
21+
RUN cd /opt && \
22+
wget https://www.mellanox.com/downloads/DOCA/DOCA_v${DOCA_OFED_MAJOR_VERSION}/host/${DOCA_OFED_RPM} && \
23+
rpm -i ${DOCA_OFED_RPM} && \
24+
dnf clean all
25+
26+
RUN dnf install -y \
27+
doca-ofed \
28+
mlnx-fw-updater

0 commit comments

Comments
 (0)