Skip to content

Commit

Permalink
adding back compose, small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
1majom committed Aug 13, 2024
1 parent 2205dbe commit 586d5d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ logs/
*.mp4
.vscode/*
topo.yaml
docker-compose.yml
__pycache__/*
*.pcap
*.pcapng
Expand Down
8 changes: 4 additions & 4 deletions docker-compose-old.yml → docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: "3.8"

# Trying to resamble the original compose file
x-moq: &x-moq
build: .
environment:
Expand All @@ -23,14 +23,14 @@ services:
entrypoint: moq-api
volumes:
- ./topo.yaml:/topo.yaml:ro
command: --redis redis://redis:6379 --topo-path topo.yaml
command: --redis redis://redis:6379
ports:
- "80"

relay1:
<<: *x-moq
entrypoint: moq-relay
command: --tls-cert /etc/tls/cert --tls-key /etc/tls/key --tls-disable-verify --api http://api --node https://relay1 --dev --announce https://dir
command: --tls-cert /etc/tls/cert --tls-key /etc/tls/key --tls-disable-verify --api http://api --node https://relay1 --dev --original --announce https://dir
depends_on:
- api
- dir
Expand All @@ -41,7 +41,7 @@ services:
relay2:
<<: *x-moq
entrypoint: moq-relay
command: --tls-cert /etc/tls/cert --tls-key /etc/tls/key --tls-disable-verify --api http://api --node https://relay2 --dev --announce https://dir
command: --tls-cert /etc/tls/cert --tls-key /etc/tls/key --tls-disable-verify --api http://api --node https://relay2 --dev --original --announce https://dir
depends_on:
- api
- dir
Expand Down
5 changes: 3 additions & 2 deletions good-try.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from mininet.node import Node, OVSSwitch
from mininet.link import TCLink
from mininet import log
import os

my_debug=False
my_debug = os.getenv("MY_DEBUG", False)


def info(msg):
Expand All @@ -37,7 +38,7 @@ def relayid_to_ip(relayid):
subprocess.call(['sudo', 'mn', '-c'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
print("** Getting them needed binaries")
if my_debug:
subprocess.run(['rm', 'target/debug/moq-clock'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['rm', 'target/debug/*'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

subprocess.run(['sudo', '-u', 'szebala', '/home/szebala/.cargo/bin/cargo', 'build'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if not os.path.exists("topo.yaml"):
Expand Down
13 changes: 8 additions & 5 deletions local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

cleanup() {
echo "Stopping all background processes..."
kill $(jobs -p)
pkill -f './target/debug/moq-api'
pkill -f './target/debug/moq-relay'
pkill -f './target/debug/moq-pub'
pkill -f './target/debug/moq-sub'
}

trap cleanup SIGINT SIGTERM

REDIS=127.0.0.1 ./dev/api --bind 127.0.0.1:4442 &
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-relay --bind '127.0.0.1:4444' --node 'https://127.0.0.1:4444' --api http://127.0.0.1:4442 --tls-cert dev/localhost.crt --tls-key dev/localhost.key --tls-disable-verify --dev &
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-relay --bind '127.0.0.1:4445' --node 'https://127.0.0.1:4445' --api http://127.0.0.1:4442 --tls-cert dev/localhost.crt --tls-key dev/localhost.key --tls-disable-verify --dev &
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-relay --bind '127.0.0.1:4444' --node 'https://127.0.0.1:4444' --api http://127.0.0.1:4442 --tls-cert dev/localhost.crt --tls-key dev/localhost.key --tls-disable-verify --original --dev &
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-relay --bind '127.0.0.1:4445' --node 'https://127.0.0.1:4445' --api http://127.0.0.1:4442 --tls-cert dev/localhost.crt --tls-key dev/localhost.key --tls-disable-verify --original --dev &

# ffmpeg -hide_banner -stream_loop -1 -re -i ./dev/bbb.mp4 -c copy -an -f mp4 -movflags cmaf+separate_moof+delay_moov+skip_trailer+frag_every_frame - | RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-pub --name bbb3 https://127.0.0.1:4444 --tls-disable-verify &
# RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-sub --name bbb3 https://127.0.0.1:4445 --tls-disable-verify | ffplay -x 200 -y 100 -
# !!! you have to run it as root dumbo bc the api uses port 80
# RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/moq-sub --name bbb3 https://127.0.0.1:4445 --tls-disable-verify | ffplay -x 200 -y 100 -
# might help: -framedrop


wait

0 comments on commit 586d5d2

Please sign in to comment.