Skip to content

Commit

Permalink
fix(ion)fix docker and scripts (ionorg#512)
Browse files Browse the repository at this point in the history
* fix(ion)fix docker and scripts

* fix(ion)fix docker and scripts

* fix(ion)fix docker
  • Loading branch information
adwpc authored Mar 28, 2021
1 parent 1e49b85 commit a17c9f8
Show file tree
Hide file tree
Showing 96 changed files with 417 additions and 3,019 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ cmd/avp/avp
node_modules/
cover.out
out
.DS_Store
.DS_Store
main
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ go_deps:
go mod download
go generate ./...

build:
build: go_deps
go build -o bin/biz $(GO_LDFLAGS) cmd/biz/main.go
go build -o bin/islb $(GO_LDFLAGS) cmd/islb/main.go
go build -o bin/sfu $(GO_LDFLAGS) cmd/sfu/main.go
go build -o bin/avp $(GO_LDFLAGS) cmd/avp/main.go
start-bin:

start-services:
docker network create ionnet || true
docker-compose -f docker-compose.yml up -d redis nats etcd
docker-compose -f docker-compose.yml up -d redis nats

stop-services:
docker-compose -f docker-compose.yml stop redis nats etcd
docker-compose -f docker-compose.yml stop redis nats

run:
docker-compose up --build
Expand All @@ -35,8 +36,7 @@ test: go_deps start-services
-timeout 120s \
-coverpkg=${GO_COVERPKGS} -coverprofile=cover.out -covermode=atomic \
-v -race ${GO_TESTPKGS}

protos:
proto:
docker build -t protoc-builder ./protos && \
docker run -v $(CURDIR):/workspace protoc-builder \
protoc \
Expand Down
25 changes: 1 addition & 24 deletions configs/biz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,6 @@ level = "info"
[nats]
url = "nats://127.0.0.1:4222"

[redis]
addrs = [":6379"]
password = ""
db = 0

[signal.jsonrpc]
#listen ip port
host = "0.0.0.0"
port = "8443"
# cert= "configs/certs/cert.pem"
# key= "configs/certs/key.pem"
path = "/ws"

[signal.jsonrpc.auth_connection]
enabled = false
key_type = "HMAC" # this selects the Signing method https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethod
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.jsonrpc.auth_room]
enabled = false
key_type = "HMAC"
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.grpc]
#listen ip port
host = "0.0.0.0"
Expand All @@ -42,4 +19,4 @@ allow_all_origins = true
# key= "configs/certs/key.pem"

[avp]
elements = ["webmsaver"]
elements = ["webmsaver"]
4 changes: 0 additions & 4 deletions configs/docker/avp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ pprof = ":6063"
# data center id
dc = "dc1"

[etcd]
# ["ip:port", "ip:port"]
addrs = ["etcd:2379"]

[nats]
url = "nats://nats:4222"

Expand Down
22 changes: 4 additions & 18 deletions configs/docker/biz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,16 @@ dc = "dc1"
level = "info"
# level = "debug"

[etcd]
# ["ip:port", "ip:port"]
addrs = ["etcd:2379"]

[nats]
url = "nats://nats:4222"

[signal]
[signal.grpc]
#listen ip port
host = "0.0.0.0"
port = "8443"
port = "5551"
allow_all_origins = true
# cert= "configs/certs/cert.pem"
# key= "configs/certs/key.pem"
path = "/ws"

[signal.auth_connection]
enabled = false
key_type = "HMAC" # this selects the Signing method https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethod
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.auth_room]
enabled = false
key_type = "HMAC"
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[avp]
elements = ["webmsaver"]
elements = ["webmsaver"]
4 changes: 0 additions & 4 deletions configs/docker/islb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ dc = "dc1"
[log]
level = "info"

[etcd]
# ["ip:port", "ip:port"]
addrs = ["etcd:2379"]

[nats]
url = "nats://nats:4222"

Expand Down
55 changes: 46 additions & 9 deletions configs/docker/sfu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ pprof = ":6062"
# data center id
dc = "dc1"

[etcd]
# ["ip:port", "ip:port"]
addrs = ["etcd:2379"]

[nats]
url = "nats://nats:4222"

Expand All @@ -15,13 +11,29 @@ url = "nats://nats:4222"
# size of ballast. Be aware that the ballast should be less than the half of memory
# available.
ballast = 0
# enable prometheus sfu statistics
withstats = false

[router]
# Limit the remb bandwidth in kbps
# zero means no limits
maxbandwidth = 1500
# max buffer time by ms for video tracks
maxbuffertime = 1000
# max number of video tracks packets the SFU will keep track
maxpackettrack = 500
# Sets the audio level volume threshold.
# Values from [0-127] where 0 is the loudest.
# Audio levels are read from rtp extension header according to:
# https://tools.ietf.org/html/rfc6464
audiolevelthreshold = 40
# Sets the interval in which the SFU will check the audio level
# in [ms]. If the active speaker has changed, the sfu will
# emit an event to clients.
audiolevelinterval=1000
# Sets minimum percentage of events required to fire an audio level
# according to the expected events from the audiolevelinterval,
# calculated as audiolevelinterval/packetization time (20ms for 8kHz)
# Values from [0-100]
audiolevelfilter = 20

[router.simulcast]
# Prefer best quality initially
Expand All @@ -33,7 +45,7 @@ enabletemporallayer = false
[webrtc]
# Range of ports that ion accepts WebRTC traffic on
# Format: [min, max] and max - min >= 100
# portrange = [50000, 60000]
portrange = [15000, 15200]
# if sfu behind nat, set iceserver
# [[webrtc.iceserver]]
# urls = ["stun:stun.stunprotocol.org:3478"]
Expand All @@ -47,6 +59,8 @@ enabletemporallayer = false
# "plan-b"
# "unified-plan-with-fallback"
sdpsemantics = "unified-plan"
# toggle multicast dns support: https://tools.ietf.org/html/draft-mdns-ice-candidates-00
mdns = true

[webrtc.candidates]
# In case you're deploying ion-sfu on a server which is configured with
Expand All @@ -58,8 +72,31 @@ sdpsemantics = "unified-plan"
# Multiple public IP addresses can be specified as a comma separated list
# if the sfu is deployed in a DMZ between two 1-1 NAT for internal and
# external users.
# nat1to1 = ["1.2.3.4"]
# icelite = true
nat1to1 = ["127.0.0.1"]
icelite = true

[turn]
# Enables embeded turn server
enabled = false
# Sets the realm for turn server
realm = "ion"
# The address the TURN server will listen on.
address = "0.0.0.0:3478"
# Certs path to config tls/dtls
# cert="path/to/cert.pem"
# key="path/to/key.pem"
# Port range that turn relays to SFU
# WARNING: It shouldn't overlap webrtc.portrange
# Format: [min, max]
# portrange = [5201, 5400]
[turn.auth]
# Use an auth secret to generate long-term credentials defined in RFC5389-10.2
# NOTE: This takes precedence over `credentials` if defined.
# secret = "secret"
# Sets the credentials pairs
credentials = "pion=ion,pion2=ion2"

[log]
# 0 - INFO 1 - DEBUG 2 - TRACE
v = 1
level = "info"
4 changes: 2 additions & 2 deletions configs/sfu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enabletemporallayer = false
[webrtc]
# Range of ports that ion accepts WebRTC traffic on
# Format: [min, max] and max - min >= 100
portrange = [5000, 5200]
portrange = [10000, 50000]
# if sfu behind nat, set iceserver
# [[webrtc.iceserver]]
# urls = ["stun:stun.stunprotocol.org:3478"]
Expand Down Expand Up @@ -99,4 +99,4 @@ credentials = "pion=ion,pion2=ion2"
[log]
# 0 - INFO 1 - DEBUG 2 - TRACE
v = 1
level = "info"
level = "info"
65 changes: 0 additions & 65 deletions docker-compose.stable.yml

This file was deleted.

8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ services:
volumes:
- "./configs/docker/sfu.toml:/configs/sfu.toml"
ports:
- "5000-5200:5000-5200/udp"
- "15000-15200:15000-15200/udp"
- 3478:3478
depends_on:
- nats
- islb
networks:
- ionnet

Expand All @@ -38,6 +40,7 @@ services:
- "./out:/out/"
depends_on:
- nats
- islb
networks:
- ionnet

Expand All @@ -49,9 +52,10 @@ services:
volumes:
- "./configs/docker/biz.toml:/configs/biz.toml"
ports:
- 8443:8443
- 5551:5551
depends_on:
- nats
- islb
networks:
- ionnet

Expand Down
2 changes: 1 addition & 1 deletion docker/biz.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN cd $GOPATH/src/github.com/pion/ion && go mod download
COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/biz/json-rpc
WORKDIR $GOPATH/src/github.com/pion/ion/cmd/biz
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /biz .

FROM alpine:3.12.1
Expand Down
28 changes: 0 additions & 28 deletions docs/README.md

This file was deleted.

Loading

0 comments on commit a17c9f8

Please sign in to comment.