add a docker compose test file which can be used to stream audio continuously

This commit is contained in:
2025-05-07 11:51:56 +02:00
parent d35a8bee2c
commit c368fd5c85
3 changed files with 44 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
# TODO: investigate using -alpine in the future
FROM python:3.11
FROM python:3.11
# Install system dependencies and poetry
RUN apt-get update && apt-get install -y \
@@ -15,9 +15,21 @@ COPY ./src/ .
RUN sed /^StrictHostKeyChecking/d /etc/ssh/ssh_config; \
echo StrictHostKeyChecking no >> /etc/ssh/ssh_config
RUN --mount=type=cache,target=/root/.cache \
--mount=type=ssh,required=true \
pip install ./
# Install poetry
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry config --list
RUN --mount=type=ssh,required=true \
--mount=type=cache,target=/root/.cache \
poetry install --verbose
# Debug: Verify packages were installed
RUN which python
RUN pip list
#poetry config virtualenvs.create false
# make sure to install sudo apt install docker-buildx
# make sure to set IdentityFile /home/pstruebi/.ssh/id_ed25519 in ~/.ssh/config -maybe not nececcary
@@ -30,3 +42,6 @@ RUN --mount=type=cache,target=/root/.cache \
# example run commands
# interactive:
# docker run --rm -it --device /dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00 bumble-auracast bash
#/usr/local/bin/python

22
docker-compose-test.yaml Normal file
View File

@@ -0,0 +1,22 @@
services:
multicaster:
container_name: multicaster-test
privileged: true # Grants full access to all devices (for serial access)
restart: unless-stopped
ports:
- "5000:5000"
build:
dockerfile: Dockerfile
ssh:
- default=~/.ssh/id_ed25519
volumes:
- "/dev/serial:/dev/serial"
#devices:
# - /dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00
environment:
LOG_LEVEL: INFO
#vpn only seems to initiate handshake after some outgoing connection is being made
#command: >
# bash -c "(while true; do ping -c 1 vpn.pstruebi.xyz || echo 'Ping failed'; sleep 60; done) & python ./auracast/multicast_server.py"
command: python ./auracast/multicast.py # continously streaming test app

View File

@@ -536,7 +536,9 @@ if __name__ == "__main__":
#config.transport='serial:/dev/serial/by-id/usb-SEGGER_J-Link_001057705357-if02,1000000,rtscts' # transport for nrf54l15dk
#config.transport='serial:/dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_95A087EADB030B24-if00,115200,rtscts' #nrf52dongle hci_uart usb cdc
#config.transport='usb:2fe3:000b' #nrf52dongle hci_usb # TODO: iso packet over usb not supported
config.transport= 'auto'
#config.transport= 'auto'
config.transport='serial:/dev/ttyAMA2,1000000,rtscts' # transport for raspberry pi
for big in config.bigs: # TODO: encrypted streams are not working
#big.code = 'ff'*16 # returns hci/HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE_ERROR
@@ -555,7 +557,6 @@ if __name__ == "__main__":
config.octets_per_frame = 40 # 32kbps@16kHz
#config.debug = True
run_async(
broadcast(
config,