Skip to content

Commit cd16ff3

Browse files
authored
Move Grout to v0.10.2 (#123)
1 parent da6dc10 commit cd16ff3

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

documentation/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ $ oc rsh -n example-cnf deployment/grout-app
698698
699699
# check the script that has been created by the automation
700700
sh-4.4$ cat /usr/local/bin/example-cnf/run/config-grout
701-
grcli -f /usr/local/bin/example-cnf/run/grout.init 2>&1 | tee /var/log/grout/app.log
701+
grcli -f /usr/local/bin/example-cnf/run/grout.init -s /usr/local/bin/example-cnf/run/grout.sock 2>&1 | tee /var/log/grout/app.log
702702
703703
# check the config file to be applied
704704
sh-4.4$ cat /usr/local/bin/example-cnf/run/grout.init
@@ -712,10 +712,10 @@ add ip address 172.16.21.60/24 iface p1
712712
sh-4.4$ sudo /usr/local/bin/example-cnf/run/config-grout
713713
714714
# clear statistics
715-
sh-4.4$ sudo grcli clear stats
715+
sh-4.4$ sudo grcli -s /usr/local/bin/example-cnf/run/grout.sock clear stats
716716
717717
# print statistics
718-
sh-4.4$ sudo grcli show stats software
718+
sh-4.4$ sudo grcli -s /usr/local/bin/example-cnf/run/grout.sock show stats software
719719
NODE CALLS PACKETS PKTS/CALL CYCLES/CALL CYCLES/PKT
720720
port_rx 109805489408 2104 0.0 49.2 2567088141.0
721721
control_input 109805489408 39 0.0 22.6 63637321574.4

grout-container-app/cnfapp/Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@ LABEL name="NFV Example CNF Grout Application" \
1919

2020
COPY licenses /licenses
2121

22-
ENV GROUT_VER v0.9.1
22+
ENV GROUT_VER v0.10.2
2323
ENV GROUT_RPM https://github.com/DPDK/grout/releases/download/${GROUT_VER}/grout.x86_64.rpm
2424

25-
# Install prerequisite packages
26-
RUN dnf install -y \
27-
python39 \
28-
python3-pip \
29-
&& dnf clean all
30-
RUN pip3 install kubernetes
31-
3225
# check latest release from https://github.com/DPDK/grout/releases
3326
RUN dnf -y install ${GROUT_RPM}
3427

grout-container-app/cnfapp/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ add ip address 172.16.16.60/24 iface p0
3737
add ip address 172.16.21.60/24 iface p1
3838
```
3939

40-
The file created by the automation to launch the Grout configuration is saved under `/usr/local/bin/example-cnf/run/config-grout`, and it has the following content:
40+
The file created by the automation to launch the Grout configuration is saved under `/usr/local/bin/example-cnf/run/grout.sock`, and it has the following content:
4141

4242
```
4343
sh-4.4$ cat config-grout
44-
grcli -f /usr/local/bin/example-cnf/run/grout.init 2>&1 | tee /var/log/grout/app.log
44+
grcli -f /usr/local/bin/example-cnf/run/grout.init -s /usr/local/bin/example-cnf/run/grout.sock 2>&1 | tee /var/log/grout/app.log
4545
```
4646

4747
To deploy that config, we use the `grcli` command. If using `-f` argument, we will run all the commands that are defined in the file. If just using `grcli`, we'll open a CLI session with Grout and we can start interacting with the service. And also, we can use `grcli` followed by a Grout command to perform a particular action.
4848

49+
We use `-s` argument to refer to a specific location of the Grout socket API file.
50+
4951
For example, we can print statistics in the following way:
5052

5153
```
5254
# clear statistics
53-
$ sudo grcli clear stats
55+
$ sudo grcli -s /usr/local/bin/example-cnf/run/grout.sock clear stats
5456
5557
# print statistics
56-
$ sudo grcli show stats software
58+
$ sudo grcli -s /usr/local/bin/example-cnf/run/grout.sock show stats software
5759
NODE CALLS PACKETS PKTS/CALL CYCLES/CALL CYCLES/PKT
5860
port_rx 109805489408 2104 0.0 49.2 2567088141.0
5961
control_input 109805489408 39 0.0 22.6 63637321574.4
@@ -92,7 +94,7 @@ Also, you can trace the traffic received by Grout with the following configurati
9294

9395
```
9496
# enter in grout CLI
95-
$ grcli
97+
$ grcli -s /usr/local/bin/example-cnf/run/grout.sock
9698
grout# set trace all
9799
98100
# if you get the latest N traces of traffic managed by Grout, you

grout-container-app/cnfapp/scripts/grout-wrapper

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,21 @@ cat $GROUT_CONF_FILE
5555

5656
# Start Grout on background
5757
## Since v0.9.1, no socket is required, it's created as an abstract socket, available as grout.sock
58-
## Leaving it here just in case it's needed in the future
59-
#GROUT_SOCKET_FILE="/usr/local/bin/example-cnf/run/grout.sock"
58+
## However, on v0.10.2, there are permission issues because the socket is located on /run/grout.sock,
59+
## since we normally use a read-only filesystem, there are problems when creating it.
60+
## Switching to the usage of a custom grout.sock file instead, to better control it.
61+
GROUT_SOCKET_FILE="/usr/local/bin/example-cnf/run/grout.sock"
6062
echo "Starting Grout"
61-
#sudo grout -v -s $GROUT_SOCKET_FILE &
62-
sudo grout -v &
63+
sudo grout -v -s $GROUT_SOCKET_FILE &
64+
#sudo grout -v &
6365

6466
# Wait a couple of seconds, so that we ensure Grout is running before starting configuring it
6567
sleep 5
6668

6769
echo "Building Grout config script"
6870
# Build script to apply Grout configuration
6971
RUN="/usr/local/bin/example-cnf/run/config-grout"
70-
CMD="grcli -f $GROUT_CONF_FILE"
72+
CMD="grcli -f $GROUT_CONF_FILE -s $GROUT_SOCKET_FILE"
7173
CMD="${CMD} 2>&1 | tee $GROUT_LOG_FILE"
7274
echo "${CMD}" > $RUN
7375
chmod +x "$RUN"
@@ -88,7 +90,7 @@ if [[ $RUN_DEPLOYMENT == "1" ]]; then
8890
sudo /usr/local/bin/example-cnf/run/config-grout
8991

9092
# Clear statistics
91-
sudo grcli clear stats
93+
sudo grcli -s $GROUT_SOCKET_FILE clear stats
9294

9395
# Print statistics every $STAT_PERIOD seconds
9496
set +ex
@@ -97,7 +99,7 @@ if [[ $RUN_DEPLOYMENT == "1" ]]; then
9799
echo "*******************************************" 2>&1 | tee -a $GROUT_LOG_FILE
98100
date 2>&1 | tee -a $GROUT_LOG_FILE
99101
echo "*******************************************" 2>&1 | tee -a $GROUT_LOG_FILE
100-
sudo grcli show stats software 2>&1 | tee -a $GROUT_LOG_FILE
102+
sudo grcli -s $GROUT_SOCKET_FILE show stats software 2>&1 | tee -a $GROUT_LOG_FILE
101103
echo "" 2>&1 | tee -a $GROUT_LOG_FILE
102104
sleep $STATS_PERIOD
103105
done

utils/support-images/ubi9-base-grout/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ RUN dnf install -y \
88
RUN dnf install -y \
99
libibverbs \
1010
logrotate \
11-
python3 \
11+
python39 \
12+
python3-pip \
1213
numactl \
1314
rdma-core \
1415
tcpdump \
1516
sudo \
1617
&& dnf clean all
18+
19+
RUN pip3 install kubernetes

0 commit comments

Comments
 (0)