Skip to content

Commit 81cf481

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

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-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

+5-4
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 .
@@ -46,9 +46,10 @@ RUN dnf install -y \
4646
vim \
4747
&& dnf clean all
4848

49+
# Install TRex
4950
RUN mkdir -p /opt/trex && cd /opt/trex && git clone --branch ${TREX_VER} ${TREX_REPO}
5051
RUN cd /opt/trex/trex-core/linux_dpdk && \
51-
./b configure --no-mlx --no-bxnt --new-memory && \
52+
./b configure --no-bnxt --new-memory && \
5253
./b build
5354

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

8081
# Copy scripts
8182
COPY --chmod=550 scripts /usr/local/bin
82-
COPY --chmod=550 --from=build /utils/webserver /usr/local/bin/webserver
83+
COPY --chmod=550 --from=build /opt/app-root/src/webserver /usr/local/bin/webserver
8384

8485
# Move to the custom user
8586
USER example-cnf

trex-container-app/server/scripts/trex-server

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ n=0
1919
until [ "$n" -ge 5 ]
2020
do
2121
cd /opt/trex/trex-core/scripts
22-
./_t-rex-64 --cfg /usr/local/bin/example-cnf/trex_cfg.yaml -i --no-hw-flow-stat -c $CORE_COUNT
22+
./_t-rex-64 --cfg /usr/local/bin/example-cnf/trex_cfg.yaml --no-ofed-check -i --no-hw-flow-stat -c $CORE_COUNT
2323
n=$((n+1))
2424
sleep 5
2525
done

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

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM registry.access.redhat.com/ubi8/ubi:latest
44
RUN dnf install -y \
55
numactl \
66
numactl-devel \
7+
rdma-core \
78
nfs-utils \
89
perf \
910
tcpdump \

0 commit comments

Comments
 (0)