Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions .github/workflows/hole-punch-interop-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,15 @@ jobs:
# Automatic trigger - use change detection outputs
echo "test-select=${{ steps.detect.outputs.changed-impls }}" >> $GITHUB_OUTPUT

# Negate each implementation ID in the pipe-separated list
# Always include ~failing to skip known-broken tests
CHANGED_IMPLS="${{ steps.detect.outputs.changed-impls }}"
if [ -n "$CHANGED_IMPLS" ]; then
NEGATED_IMPLS=$(echo "$CHANGED_IMPLS" | sed 's/|/|!/g;s/^/!/')
echo "test-ignore=~failing|$NEGATED_IMPLS" >> $GITHUB_OUTPUT
else
echo "test-ignore=~failing" >> $GITHUB_OUTPUT
fi
# Keep only the known failing filter. test-select already scopes
# to changed implementations, so adding negated impl patterns here
# would conflict and can yield zero selected tests.
echo "test-ignore=~failing" >> $GITHUB_OUTPUT

echo "relay-select=${{ steps.detect.outputs.changed-relays }}" >> $GITHUB_OUTPUT

# Negate each relay ID in the pipe-separated list
# Always include ~failing to skip known-broken relays
CHANGED_RELAYS="${{ steps.detect.outputs.changed-relays }}"
if [ -n "$CHANGED_RELAYS" ]; then
NEGATED_RELAYS=$(echo "$CHANGED_RELAYS" | sed 's/|/|!/g;s/^/!/')
echo "relay-ignore=~failing|$NEGATED_RELAYS" >> $GITHUB_OUTPUT
else
echo "relay-ignore=~failing" >> $GITHUB_OUTPUT
fi
# Same for relay ignore
echo "relay-ignore=~failing" >> $GITHUB_OUTPUT

echo "router-select=${{ steps.detect.outputs.changed-routers }}" >> $GITHUB_OUTPUT

Expand Down
7 changes: 4 additions & 3 deletions hole-punch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ The hole-punch test suite verifies that libp2p implementations can establish dir

**Current implementations**:
- **rust-libp2p**: v0.56
- **py-libp2p**: v0.6
- **Router**: Linux-based NAT router
- **Relay**: rust-libp2p v0.56 relay server
- **Relay**: rust-libp2p v0.56, py-libp2p v0.6 relay servers

**Protocols tested**:
- **Transports**: tcp, quic-v1, webrtc-direct, ws (WebSocket)
Expand Down Expand Up @@ -175,7 +176,7 @@ Hole-punch tests support a powerful **two-stage filtering model** with both `--*
./run.sh --impl-select "rust-v0.56"

# SELECT: Run multiple implementations (pipe-separated)
./run.sh --impl-select "rust-v0.56|go-v0.45"
./run.sh --impl-select "rust-v0.56|py-v0.6"

# SELECT with alias: Run all rust versions
./run.sh --impl-select "~rust"
Expand Down Expand Up @@ -771,7 +772,7 @@ docker ps | grep "hole-punch"
# Check what will run
./run.sh --list-tests

# Run all tests (currently only rust-v0.56)
# Run all tests
./run.sh

# Run specific transport only
Expand Down
20 changes: 20 additions & 0 deletions hole-punch/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
test-aliases:
- alias: "failing"
value: ""
- alias: "python"
value: "py-v0.6"

# Router configurations - Multiple router types for testing different NAT implementations
routers:
Expand All @@ -31,6 +33,15 @@ relays:
secureChannels: [noise, tls]
muxers: [yamux, mplex]

- id: py-v0.6
source:
type: local
path: images/python/v0.6
dockerfile: Dockerfile.relay
transports: [tcp, ws]
secureChannels: [noise, tls]
muxers: [yamux]

# Implementation definitions
implementations:
- id: rust-v0.56
Expand All @@ -41,3 +52,12 @@ implementations:
transports: [quic-v1, tcp]
secureChannels: [noise, tls]
muxers: [yamux, mplex]

- id: py-v0.6
source:
type: local
path: images/python/v0.6
dockerfile: Dockerfile.peer
transports: [tcp, ws]
secureChannels: [noise, tls]
muxers: [yamux]
23 changes: 23 additions & 0 deletions hole-punch/images/python/v0.6/Dockerfile.peer
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies (iproute2 for network route setup, build deps for fastecdsa)
RUN apt-get update && apt-get install -y \
iproute2 \
git \
build-essential \
libgmp-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application
COPY peer.py .
COPY run-peer.sh /usr/local/bin/

RUN chmod +x /usr/local/bin/run-peer.sh

ENTRYPOINT ["/usr/local/bin/run-peer.sh"]
23 changes: 23 additions & 0 deletions hole-punch/images/python/v0.6/Dockerfile.relay
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies (including build deps for fastecdsa)
RUN apt-get update && apt-get install -y \
iproute2 \
git \
build-essential \
libgmp-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application
COPY relay.py .
COPY run-relay.sh /usr/local/bin/

RUN chmod +x /usr/local/bin/run-relay.sh

ENTRYPOINT ["/usr/local/bin/run-relay.sh"]
Loading
Loading