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
50 changes: 50 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
TLD_DOMAIN=blockcast.net
INFRA_SUBDOMAIN=infra
CDN_NAME=pubic
CDN_SUBDOMAIN=cdn
EDGE_HOST=gw-2da59cd0-85f7-11f0-ad41-a53a81b98aae
TO_HOST=to
TO_PORT=443

# Add the path to the cache storage luks device. typically /dev/mapper/cacheN and ensure that the dynamic encryption key is set appropriately via the beacon
#
# Also, remember to set the cache sizes based on the minimums lised below for the Relay Node profile that you are choosing.
#
CACHE0_ENC_PASSWORD=OVERRIDE-CACHE0-ENC-PASSWORD
CACHE0_DEVICE=/dev/mapper/cache0


# Selection of default sizing parameters of the various relay node profiles. Please uncomment only one of the below blocks to choose your relay node sizing

# Resource limit Defaults for Relay Node Micro profile
# Minimum Required Cache Store Size = 100 GB
# Minimum Required Cache-out Bandwidth = 200 mbps
CONTAINER_CPU_LIMIT=4.0
CONTAINER_CPU_RESERVATION=1.5
CONTAINER_MEMORY_LIMIT=8G
CONTAINER_MEMORY_RESERVATION=2G
CONTAINER_CACHE0_SIZE_GB=100

# Resource limit Defaults for Relay Node Standard profile
# Minimum Required Cache Store Size = 2000 GB
# Minimum Required Cache-out Bandwidth = 1 gbps
#CONTAINER_CPU_LIMIT=16.0
#CONTAINER_CPU_RESERVATION=4
#CONTAINER_MEMORY_LIMIT=32G
#CONTAINER_MEMORY_RESERVATION=4G

# Resource limit Defaults for Relay Node Large profile
# Minimum Required Cache Store Size = 5000 GB
# Minimum Required Cache-out Bandwidth = 10 gbps
#CONTAINER_CPU_LIMIT=32
#CONTAINER_CPU_RESERVATION=4
#CONTAINER_MEMORY_LIMIT=64G
#CONTAINER_MEMORY_RESERVATION=8G

# Resource limit Defaults for Relay Node Super profile
# Minimum Required Cache Store Size = 10000 GB
# Minimum Required Cache-out Bandwidth = 25 gbps
#CONTAINER_CPU_LIMIT=64
#CONTAINER_CPU_RESERVATION=16
#CONTAINER_MEMORY_LIMIT=128G
#CONTAINER_MEMORY_RESERVATION=16G
97 changes: 87 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
x-service: &service
image: blockcast/cdn_gateway_go:${IMAGE_VERSION:-stable}
image: blockcast/cdn_gateway_go:stable
restart: always
network_mode: "service:blockcastd"
volumes:
- ${HOME}/.blockcast/certs:/var/opt/magma/certs
- ${HOME}/.blockcast/snowflake:/etc/snowflake
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "com.centurylinklabs.watchtower.enable=true"
- ${HOME}/.blockcast/compose:/etc/magma/compose
- /var/run/docker.sock:/var/run/docker.sock

# Base relay service without cache devices
x-relay-base: &relay-base
container_name: relayats
restart: always
image: blockcast/ats-standard:9.2.4-0.90fbf13db
domainname: infra.blockcast.dev
environment:
DEBUG_PORT: '2347'
env_file:
- .env
hostname: ${EDGE_HOST:-gw-testec01}
user: "root:root"
cap_add:
- SYS_ADMIN
- SYS_PTRACE
deploy:
resources:
limits:
cpus: '${CONTAINER_CPU_LIMIT:-4.0}'
memory: ${CONTAINER_MEMORY_LIMIT:-8G}
reservations:
cpus: '${CONTAINER_CPU_RESERVATION:-1.5}'
memory: ${CONTAINER_MEMORY_RESERVATION:-2G}
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
volumes:
- ${HOME}/.blockcast/certs:/etc/ssl/magma_certs


services:
control_proxy:
Expand All @@ -19,16 +47,65 @@ services:
<<: *service
container_name: blockcastd
command: /usr/bin/blockcastd -logtostderr=true -v=0
network_mode: bridge

beacond:
<<: *service
container_name: beacond
command: /usr/bin/beacond -logtostderr=true -v=0

watchtower:
image: containrrr/watchtower

# Init container for relay-ats services - must complete successfully before relay-ats-* services start
relayatsinit:
build:
context: .
dockerfile: dockerfile-init
target: edge
args:
BASE_IMAGE: ${BASE_IMAGE:-almalinux}
RHEL_VERSION: ${RHEL_VERSION:-9-minimal}
image: blockcast/ats-standard-init:9.2.4-0.90fbf13db
container_name: relayatsinit
domainname: infra.blockcast.dev
environment:
WATCHTOWER_LABEL_ENABLE: "true"
CONTAINER_CACHE0_SIZE_GB: ${CONTAINER_CACHE0_SIZE_GB:-100}
CACHE0_ENC_PASSWORD: ${CACHE0_ENC_PASSWORD:-}
env_file:
- .env
user: "root:root"
privileged: true
cap_add:
- SYS_ADMIN
- SYS_PTRACE
devices:
- /dev/mapper/control:/dev/mapper/control:rwm
- /dev/loop-control:/dev/loop-control:rwm
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- shared:/shared
- ${HOME}/.blockcast/relaycache:/var/trafficserver/relaycache
- /dev/mapper:/dev/mapper
restart: "no"
profiles: ["relayatsnocache", "relayats"]

# ATS Relay service - use appropriate profile based on needed cache devices
# Default relay service without cache devices - use 'relay-ats-nocache' profile
relayatsnocache:
<<: *relay-base
profiles: ["relayatsnocache"]
depends_on:
relayatsinit:
condition: service_completed_successfully

# Relay service with cache0 device - use 'relayats' profile
relayats:
<<: *relay-base
profiles: ["relayats"]
depends_on:
relayatsinit:
condition: service_completed_successfully
devices:
- ${CACHE0_DEVICE}:/var/trafficserver/cache0:rwm


volumes:
shared: