]> git.puffer.fish Git - matthieu/frr.git/commitdiff
docker: add ubuntu24-ci docker image support
authorChristian Hopps <chopps@labn.net>
Sun, 12 Jan 2025 02:30:08 +0000 (02:30 +0000)
committerChristian Hopps <chopps@labn.net>
Sun, 12 Jan 2025 02:48:29 +0000 (02:48 +0000)
Signed-off-by: Christian Hopps <chopps@labn.net>
docker/ubuntu-ci/Dockerfile
docker/ubuntu22-ci/README.md
docker/ubuntu24-ci/README.md [new file with mode: 0644]

index aaad3bc172a94c0b82d0ee072a06a9ad93c1ca17..0bfcb51878f8e5121dbdcd96d5a493f381791464 100644 (file)
@@ -2,7 +2,6 @@ ARG UBUNTU_VERSION=22.04
 FROM ubuntu:$UBUNTU_VERSION
 
 ARG DEBIAN_FRONTEND=noninteractive
-ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
 
 # Update and install build requirements.
 RUN apt update && apt upgrade -y && \
@@ -77,14 +76,15 @@ RUN apt update && apt upgrade -y && \
     wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/iana/IANA-IPPM-METRICS-REGISTRY-MIB -O /usr/share/snmp/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB && \
     wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \
     wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \
+    rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED && \
     python3 -m pip install wheel && \
-    python3 -m pip install 'protobuf<4' grpcio grpcio-tools && \
+    python3 -m pip install protobuf grpcio grpcio-tools && \
     python3 -m pip install 'pytest>=6.2.4' 'pytest-xdist>=2.3.0' && \
     python3 -m pip install 'scapy>=2.4.5' && \
     python3 -m pip install xmltodict && \
     python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
 
-ARG UID=1000
+ARG UID=1010
 RUN groupadd -r -g 92 frr && \
       groupadd -r -g 85 frrvty && \
       adduser --system --ingroup frr --home /home/frr \
index 617192eb71b269e605d46b8b0e23c053ae362461..116b3c0e4af7b26d66e412c774328ee9bf0d6e56 100644 (file)
@@ -5,7 +5,7 @@ This builds an ubuntu 22.04 container for dev / test
 # Build
 
 ```
-docker build -t frr-ubuntu22:latest -f docker/ubuntu-ci/Dockerfile .
+docker build -t frr-ubuntu22:latest --build-arg=UBUNTU_VERSION=22.04 -f docker/ubuntu-ci/Dockerfile .
 ```
 
 # Run
diff --git a/docker/ubuntu24-ci/README.md b/docker/ubuntu24-ci/README.md
new file mode 100644 (file)
index 0000000..38ba0ee
--- /dev/null
@@ -0,0 +1,66 @@
+# Ubuntu 24.04
+
+This builds an ubuntu 24.04 container for dev / test
+
+# Build
+
+```
+docker build -t frr-ubuntu24:latest --build-arg=UBUNTU_VERSION=24.04 -f docker/ubuntu-ci/Dockerfile .
+```
+
+# Run
+
+```
+docker run -d --init --privileged --name frr-ubuntu24 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu24:latest
+```
+
+# Running full topotest (container stops at end)
+
+```
+docker run --init -it --privileged --name frr-ubuntu24 \
+    -v /lib/modules:/lib/modules frr-ubuntu24:latest \
+    bash -c 'cd /home/frr/frr/tests/topotests; sudo pytest -nauto --dist=loadfile'
+```
+
+# Extract results from the above run into `run-results` dir and analyze
+
+```
+tests/topotests/analyze.py -C frr-ubuntu24 -Ar run-results
+```
+
+# Extract coverage from a stopped container into host FRR source tree
+
+```
+docker export frr-ubuntu24 | tar --strip=3 --wildcards -vx '*.gc??'
+lcov -b $(pwd) --capture --directory . --output-file=coverage.info
+```
+
+# make check
+
+```
+docker exec frr-ubuntu24 bash -c 'cd ~/frr ; make check'
+```
+
+# interactive bash
+
+```
+docker exec -it frr-ubuntu24 bash
+```
+
+# Run a specific topotest
+
+```
+docker exec frr-ubuntu24 bash -c 'cd ~/frr/tests/topotests ; sudo pytest ospf_topo1/test_ospf_topo1.py'
+```
+
+# stop & remove container
+
+```
+docker stop frr-ubuntu24 ; docker rm frr-ubuntu24
+```
+
+# remove image
+
+```
+docker rmi frr-ubuntu24:latest
+```