Skip to content

Commit 7f78562

Browse files
committed
Move Scapy to dev requirements
1 parent 2ebec66 commit 7f78562

6 files changed

Lines changed: 32 additions & 9 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Thanks for improving rudder. This repository is focused on Linux eBPF TC packet
1212
Run the lightweight checks before opening a pull request:
1313

1414
```bash
15-
python -m pip install -r requirements.txt
15+
python -m pip install -r requirements-dev.txt
1616
python -m unittest discover -s tests -p 'test_*.py'
1717
python -m compileall rudder.py engine tests
1818
python - <<'PY'

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ sudo apt-get install -y \
9595
pip3 install -r requirements.txt
9696
```
9797

98-
This installs `click` (CLI framework), `PyYAML` (rule parsing), `pyroute2` (ARP neighbor table lookup), and `scapy` (test packet generation).
98+
This installs `click` (CLI framework), `PyYAML` (rule parsing), and `pyroute2`
99+
(ARP neighbor table lookup).
100+
101+
The Scapy packet generator is optional and lives in the dev/test requirements:
102+
103+
```bash
104+
pip3 install -r requirements-dev.txt
105+
```
99106

100107
## Building the eBPF Programs
101108

@@ -361,6 +368,11 @@ ls /sys/fs/bpf/rudder/ 2>/dev/null # Directory should not exist
361368
## Testing with Generated Traffic
362369

363370
The included packet generator uses Scapy to send crafted packets for validating rules.
371+
Install the dev/test requirements before using it:
372+
373+
```bash
374+
pip3 install -r requirements-dev.txt
375+
```
364376

365377
### Test Steer Rules
366378

@@ -429,7 +441,7 @@ A full test cycle on a machine with `eth0`, `eth1`, `eth2`, and `eth3`:
429441
# 1. Install dependencies
430442
sudo apt-get install -y libbpf-dev linux-headers-$(uname -r) \
431443
linux-tools-generic clang llvm iproute2 tcpdump
432-
pip3 install -r requirements.txt
444+
pip3 install -r requirements-dev.txt
433445

434446
# 2. Load steering and replication rules
435447
sudo python3 rudder.py load rules/example_steer.yaml rules/example_replicate.yaml
@@ -529,7 +541,8 @@ rudder/
529541
├── CODE_OF_CONDUCT.md # Community expectations
530542
├── CONTRIBUTING.md # Development and validation notes
531543
├── SECURITY.md # Vulnerability reporting and security scope
532-
└── requirements.txt # Python dependencies
544+
├── requirements.txt # Runtime Python dependencies
545+
└── requirements-dev.txt # Optional dev/test dependencies
533546
```
534547

535548
## Limits

deploy/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ RUN apt-get update && apt-get install -y \
1717
&& rm -rf /var/lib/apt/lists/*
1818

1919
WORKDIR /rudder
20-
COPY requirements.txt .
20+
COPY requirements.txt requirements-dev.txt ./
2121

2222
# The base image is a general Ubuntu environment, so this install intentionally
23-
# uses the system Python. Rudder is not packaged as a Python wheel yet.
24-
RUN pip3 install --break-system-packages -r requirements.txt
23+
# uses the system Python. The lab image installs dev/test requirements so
24+
# tests/gen_packets.py is available for packet-generation experiments.
25+
RUN pip3 install --break-system-packages -r requirements-dev.txt
2526

2627
COPY . .
2728

deploy/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ userspace dependency on a host.
1919
## Files
2020

2121
- `Dockerfile` builds an Ubuntu-based lab image with Python, clang/LLVM,
22-
`bpftool`, `tc`, `tcpdump`, and Rudder's Python dependencies.
22+
`bpftool`, `tc`, `tcpdump`, Rudder's runtime Python dependencies, and the
23+
optional dev/test dependency used by `tests/gen_packets.py`.
2324
- `pod.yaml` shows a privileged K3s/Multus pod with multiple attached
2425
interfaces and the host mounts needed for eBPF map pinning and kernel headers.
2526

requirements-dev.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2025-2026 .chance (dotchance)
2+
# Licensed under the Apache License, Version 2.0. See LICENSE file.
3+
4+
-r requirements.txt
5+
6+
# Scapy is only needed for tests/gen_packets.py. Keep it out of the default
7+
# runtime requirements because Rudder does not use Scapy in the daemon, CLI
8+
# policy path, TC attachment path, or eBPF map serialization path.
9+
scapy==2.5.0

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
click==8.1.7
55
pyroute2==0.7.9
66
PyYAML==6.0.1
7-
scapy==2.5.0

0 commit comments

Comments
 (0)