Files
firezone/rust/connection-tests/docker-compose.lan.yml
Thomas Eizinger 11ada00617 feat: introduce firezone-connection with basic test suite (#2965)
Initial version of the `firezone-connection` crate. To begin with, we
only establish a connection in a LAN, i.e. no hole-punching, no STUN or
TURN servers, just host candidates. As such, a lot of this PR is just
scaffolding for setting up the test environment and the actual
`ConnectionPool` implementation.

For the curious, I've left some TODOs where I am going to attempt
extending the implementation once we start dealing with STUN and TURN
servers.

I also extended CI to run these tests.
2023-12-23 00:45:43 +00:00

102 lines
2.6 KiB
YAML

version: "3.8"
services:
dialer:
build:
target: debug
context: ..
args:
PACKAGE: firezone-connection-tests
cache_from:
- type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/connection-tests:main
image: us-east1-docker.pkg.dev/firezone-staging/firezone/connection-tests:${VERSION:-main}
init: true
environment:
ROLE: "dialer"
LISTEN_ADDR: 172.28.0.100
REDIS_HOST: redis # All services share the `app` network.
cap_add:
- NET_ADMIN
# depends_on:
# relay:
# condition: "service_healthy"
# redis:
# condition: "service_healthy"
networks:
app:
ipv4_address: 172.28.0.100
listener:
build:
target: debug
context: ..
args:
PACKAGE: firezone-connection-tests
cache_from:
- type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/connection-tests:main
image: us-east1-docker.pkg.dev/firezone-staging/firezone/connection-tests:${VERSION:-main}
init: true
environment:
ROLE: "listener"
LISTEN_ADDR: 172.28.0.101
REDIS_HOST: redis # All services share the `app` network.
cap_add:
- NET_ADMIN
# depends_on:
# relay:
# condition: "service_healthy"
# redis:
# condition: "service_healthy"
networks:
app:
ipv4_address: 172.28.0.101
# relay:
# environment:
# PUBLIC_IP4_ADDR: 172.28.0.102
# PUBLIC_IP6_ADDR: fcff:3990:3990::101
# LOWEST_PORT: 55555
# HIGHEST_PORT: 55666
# RUST_LOG: "debug"
# RUST_BACKTRACE: 1
# build:
# target: debug
# context: ..
# cache_from:
# - type=registry,ref=us-east1-docker.pkg.dev/firezone-staging/cache/relay:main
# args:
# PACKAGE: firezone-relay
# init: true
# healthcheck:
# test: ["CMD-SHELL", "lsof -i UDP | grep firezone-relay"]
# start_period: 20s
# interval: 30s
# retries: 5
# timeout: 5s
# ports:
# # XXX: Only 111 ports are used for local dev / testing because Docker Desktop
# # allocates a userland proxy process for each forwarded port X_X.
# #
# # Large ranges here will bring your machine to its knees.
# - "55555-55666:55555-55666/udp"
# - 3478:3478/udp
# networks:
# app:
# ipv4_address: 172.28.0.102
redis:
image: "redis:7-alpine"
# healthcheck:
# test: ["CMD-SHELL", "echo 'ready';"]
networks:
app:
ipv4_address: 172.28.0.103
networks:
app:
enable_ipv6: true
ipam:
config:
- subnet: 172.28.0.0/16
- subnet: 2001:db8:2::/64