Browse Source

Fix Docker test setup for negentropy interop testing

- Use pre-built dockurr/strfry image instead of building from source
- Fix strfry.conf format to match strfry 1.0.4 syntax
- Fix Dockerfile.orly to build both relay and sync binaries
- Use GOTOOLCHAIN=auto to handle Go version requirements
- Remove healthcheck dependencies to prevent startup blocking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main
woikos 4 months ago
parent
commit
85a3b448eb
No known key found for this signature in database
  1. 8
      tests/negentropy/Dockerfile.orly
  2. 3
      tests/negentropy/Dockerfile.strfry
  3. 28
      tests/negentropy/docker-compose.yml
  4. 84
      tests/negentropy/strfry.conf

8
tests/negentropy/Dockerfile.orly

@ -1,14 +1,15 @@ @@ -1,14 +1,15 @@
# ORLY relay Dockerfile for negentropy interop testing
FROM golang:1.23-alpine AS builder
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git make
WORKDIR /build
COPY . .
# Build orly binary
RUN CGO_ENABLED=0 go build -o orly ./cmd/orly
# Build orly relay binary (main.go in project root) and sync binary
RUN GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly . && \
GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly-sync ./cmd/orly
# Runtime image
FROM alpine:3.19
@ -17,6 +18,7 @@ RUN apk add --no-cache ca-certificates curl jq @@ -17,6 +18,7 @@ RUN apk add --no-cache ca-certificates curl jq
WORKDIR /app
COPY --from=builder /build/orly /app/
COPY --from=builder /build/orly-sync /app/
RUN mkdir -p /data

3
tests/negentropy/Dockerfile.strfry

@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y \ @@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y \
libsecp256k1-dev \
libflatbuffers-dev \
libzstd-dev \
libssl-dev \
zlib1g-dev \
pkg-config \
libtool \
autoconf \
@ -38,6 +40,7 @@ RUN apt-get update && apt-get install -y \ @@ -38,6 +40,7 @@ RUN apt-get update && apt-get install -y \
libsecp256k1-0 \
libflatbuffers1 \
libzstd1 \
libssl3 \
curl \
jq \
websocat \

28
tests/negentropy/docker-compose.yml

@ -8,19 +8,13 @@ @@ -8,19 +8,13 @@
services:
strfry:
build:
context: .
dockerfile: Dockerfile.strfry
image: dockurr/strfry:latest
ports:
- "7777:7777"
volumes:
- strfry-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7777"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s
- strfry-data:/strfry-db
- ./strfry.conf:/etc/strfry.conf:ro
command: ["/app/strfry", "relay", "--config=/etc/strfry.conf"]
networks:
- negentropy-test
@ -34,18 +28,16 @@ services: @@ -34,18 +28,16 @@ services:
- ORLY_PORT=3334
- ORLY_DATA_DIR=/data
- ORLY_LOG_LEVEL=info
- ORLY_SYNC_TARGET_RELAYS=ws://strfry:7777
volumes:
- orly-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3334"]
test: ["CMD", "curl", "-sf", "http://localhost:3334"]
interval: 5s
timeout: 5s
retries: 5
retries: 10
start_period: 10s
depends_on:
strfry:
condition: service_healthy
- strfry
networks:
- negentropy-test
@ -61,10 +53,8 @@ services: @@ -61,10 +53,8 @@ services:
volumes:
- sync-data:/data
depends_on:
strfry:
condition: service_healthy
orly:
condition: service_healthy
- strfry
- orly
networks:
- negentropy-test

84
tests/negentropy/strfry.conf

@ -1,36 +1,78 @@ @@ -1,36 +1,78 @@
## strfry configuration for negentropy interop testing
##
## strfry config for negentropy interop testing
##
# Directory that contains the strfry LMDB database
db = "/strfry-db/"
dbParams {
maxreaders = 256
mapsize = 10995116277760
noReadAhead = false
}
events {
maxEventSize = 65536
rejectEventsNewerThanSeconds = 900
rejectEventsOlderThanSeconds = 94608000
rejectEphemeralEventsOlderThanSeconds = 60
ephemeralEventsLifetimeSeconds = 300
maxNumTags = 2000
maxTagValSize = 1024
}
relay {
# Interface to listen on. Use 0.0.0.0 to listen on all interfaces
# Listen on all interfaces for Docker
bind = "0.0.0.0"
# Port to open for the nostr websocket protocol
port = 7777
# Enable negentropy protocol for sync
negentropy {
enabled = true
maxSyncEvents = 1000000
}
nofiles = 1000000
realIpHeader = ""
# Number of threads for handling negentropy messages
numThreads {
negentropy = 4
info {
name = "strfry test"
description = "strfry instance for negentropy interop testing"
pubkey = ""
contact = ""
icon = ""
nips = ""
}
# Nostr protocol settings
nostr {
# Maximum message size (1MB)
maxWebsocketPayloadSize = 131072
maxReqFilterSize = 200
autoPingSeconds = 55
enableTcpKeepalive = false
queryTimesliceBudgetMicroseconds = 10000
maxFilterLimit = 10000
maxSubsPerConnection = 20
writePolicy {
plugin = ""
}
compression {
enabled = true
slidingWindow = true
}
db {
# LMDB directory
path = "/data/strfry-db/"
logging {
dumpInAll = false
dumpInEvents = false
dumpInReqs = false
dbScanPerf = false
invalidEvents = true
}
events {
# Maximum events to return
maxLimit = 10000
numThreads {
ingester = 3
reqWorker = 3
reqMonitor = 3
negentropy = 4
}
negentropy {
# Enable negentropy protocol for sync testing
enabled = true
maxSyncEvents = 1000000
}
}

Loading…
Cancel
Save