Skip to content

Commit

Permalink
chore: add path-based routing for actors & add rg to docker compose (#…
Browse files Browse the repository at this point in the history
…1548)

Fixes RVT-4331
  • Loading branch information
NathanFlurry committed Dec 11, 2024
1 parent 147a298 commit cf8acc9
Show file tree
Hide file tree
Showing 124 changed files with 4,024 additions and 581 deletions.
66 changes: 46 additions & 20 deletions docker/dev-full/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ services:
# API
- "8080:8080"
# API internal
- "8081:8080"
- "8081:8081"
# Pegboard
- "8082:8082"
depends_on:
rivet-guard:
condition: service_started
cockroachdb:
condition: service_healthy
redis:
Expand Down Expand Up @@ -55,34 +57,29 @@ services:
networks:
- rivet-network

rivet-client:
build:
context: ../..
dockerfile: docker/dev-full/client.Dockerfile
# TODO(RVT-4168): Copmile libfdb from scratch for ARM
platform: linux/amd64
rivet-guard:
restart: unless-stopped
command: -c /etc/rivet-client/config.yaml
environment:
- RUST_BACKTRACE=1
stop_grace_period: 0s
depends_on:
foundationdb:
condition: service_healthy
image: traefik:v3.2.1
command: --configFile=/etc/rivet-guard/traefik.yaml
volumes:
- ./rivet-client:/etc/rivet-client:ro
- client-data:/var/lib/rivet-client
- ./rivet-guard:/etc/rivet-guard:ro
ports:
# Enable host networking for actors
# HTTP
- "7080:7080"
# HTTPS
- "7443:7443"
# Dashboard
- "9980:9980"
# Enable TCP & UDP port ranges.
#
# Corresponds to `actor.network.wan_port_range_min` and
# `actor.network.wan_port_range_max` in `rivet-client/config.yaml`.
# Corresponds to `server.rivet.guard.min_ingress_port_tcp` and
# `actor.network.wan_port_range_max` in `rivet-server/config.yaml`.
#
# We only reserve 100 ports instead of the default 22,000 since each
# individual port converts to an iptable rule when using Docker, which
# can cause unexpected side effects. This limits the number of actors
# using host networking to 100.
- "20000-20100:20000-20100"
- "7500-7599:7500-7599"
networks:
- rivet-network

Expand All @@ -100,6 +97,35 @@ services:
timeout: 10s
retries: 10

rivet-client:
build:
context: ../..
dockerfile: docker/dev-full/client.Dockerfile
# TODO(RVT-4168): Copmile libfdb from scratch for ARM
platform: linux/amd64
restart: unless-stopped
command: -c /etc/rivet-client/config.yaml
environment:
- RUST_BACKTRACE=1
stop_grace_period: 0s
depends_on:
foundationdb:
condition: service_healthy
volumes:
- ./rivet-client:/etc/rivet-client:ro
- client-data:/var/lib/rivet-client
ports:
# Enable host networking for actors
#
# Corresponds to `actor.network.wan_port_range_min` and
# `actor.network.wan_port_range_max` in `rivet-client/config.yaml`.
#
# We only reserve 100 ports instead of the default 22,000. See
# rivet-guard for explanation.
- "7600-7699:7600-7699"
networks:
- rivet-network

redis:
restart: unless-stopped
image: bitnami/valkey:8.0.1
Expand Down
9 changes: 5 additions & 4 deletions docker/dev-full/rivet-client/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ client:
pegboard_endpoint: ws://rivet-server:8082
network:
bind_ip: 127.0.0.1
lan_ip: 127.0.0.1
# Point to DNS name inside Docker container
lan_hostname: rivet-client
# Point to localhost since this is a dev instance
wan_ip: 127.0.0.1
wan_hostname: 127.0.0.1
# Corresponds to the port range configured in the `docker-compose.yml`
wan_port_range_min: 20000
wan_port_range_max: 20100
wan_port_range_min: 7600
wan_port_range_max: 7699
cni:
network_interface: eth0
# Don't reserve any resources on dev instances
Expand Down
Loading

0 comments on commit cf8acc9

Please sign in to comment.