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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.DS_Store
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/secrets.dev.yaml
**/values.dev.yaml
/bin
/target
LICENSE
50 changes: 50 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# DockerHub image settings
DOCKERHUB_USERNAME=hbwei
IMAGE_TAG=v0.0.1

# Host user/group IDs — set these to match your host user (id -u / id -g)
# so that bind-mounted files are accessible inside containers.
HOST_UID=1000
HOST_GID=1000

# quic client-side only
# Same-host: use Docker bridge gateway (10.64.89.1). Remote: use server host's routable IP.
QUIC_CLIENT_REMOTE_ADDR=10.64.89.1:12345

QUIC_DOCKER_CLIENT_CONFIG_PATH=./docker/config/quic_config_client_docker.yaml

# quic server-side only
QUIC_SERVER_ADDR=0.0.0.0:12345
QUIC_SERVER_PORT=12345

QUIC_DOCKER_SERVER_CONFIG_PATH=./docker/config/quic_config_gcloud_docker.yaml

# python client config
PYTHON_DOCKER_CLIENT_CONFIG_PATH=./docker/config/client_config_docker.yaml

# python server config
PYTHON_DOCKER_SERVER_CONFIG_PATH=./docker/config/server_config_gcloud_docker.yaml

# both client and server-side
DOCKER_LOG_CONFIG_PATH=./docker/config/logging_config_docker.yaml
EXPERIMENT_OUTPUT_DIR=/path/to/experiment2-out

# client-side only (required even in mock camera mode — bandwidth allocator needs eval data)
DASHBOARD_PORT=5000
MODEL_FULL_EVAL_DIR=/path/to/full-eval

# server-side only (not needed in mock inference mode, but must point to a valid directory — an empty one is fine)
EFFDET_MODELS_DIR=/path/to/av-models

# rust env vars
RUST_LOG=info
RUST_BACKTRACE=full

# for both client and server
EXPERIMENT_MODEL_INFO_PATH=./experiment_model_info.csv
MOCK_EFFDET_OUTPUT_PATH=./src/python/camera_stream/example_effdet_d4_output.npy
MOCK_EFFDET_INPUT_PATH=./src/python/camera_stream/mock_webcam_image.jpg

# Mock modes — set to any non-empty value (e.g. "true") to enable, leave empty to disable
MOCK_CAMERA=
MOCK_INFERENCE=
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ bandwidth_allocation/.DS_Store

**/.vscode/*
**/target/*
**/Cargo.lock

# we don't want your SSL certs/keys
**/*.key
Expand Down
311 changes: 269 additions & 42 deletions README.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions compose.gpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GPU override — include this file on hosts with NVIDIA GPUs.
# Usage: docker compose -f compose.yaml -f compose.gpu.yaml --profile server up
services:
server_python_main:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
179 changes: 179 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
services:
quic_client:
profiles: ['client']
init: true
ipc: host
stop_grace_period: 30s
user: "${HOST_UID}:${HOST_GID}"
image: ${DOCKERHUB_USERNAME}/turbo-quic-client:${IMAGE_TAG:-latest}
depends_on:
client_python_monitor:
condition: service_healthy
environment:
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: ${RUST_BACKTRACE}
QUIC_BIND_ADDR: ${QUIC_CLIENT_REMOTE_ADDR}
volumes:
- type: bind
source: ${QUIC_DOCKER_CLIENT_CONFIG_PATH}
target: /app/quic_config.yaml
read_only: true
- type: bind
source: ${EXPERIMENT_OUTPUT_DIR}
target: /app/experiment2-out
- zmq_client:/app/zmq-out
- health_signals:/health
networks:
- quic_net

quic_server:
profiles: ['server']
init: true
ipc: host
stop_grace_period: 30s
user: "${HOST_UID}:${HOST_GID}"
image: ${DOCKERHUB_USERNAME}/turbo-quic-server:${IMAGE_TAG:-latest}
environment:
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: ${RUST_BACKTRACE}
volumes:
- type: bind
source: ${QUIC_DOCKER_SERVER_CONFIG_PATH}
target: /app/quic_config.yaml
read_only: true
- type: bind
source: ${EXPERIMENT_OUTPUT_DIR}
target: /app/experiment2-out
- zmq_server:/app/zmq-out
ports:
- "${QUIC_SERVER_PORT}:${QUIC_SERVER_PORT}/udp"

client_python_main:
profiles: ['client']
init: true
ipc: host
stop_grace_period: 30s
user: "${HOST_UID}:${HOST_GID}"
image: ${DOCKERHUB_USERNAME}/turbo-python-client:${IMAGE_TAG:-latest}
volumes:
- health_signals:/health
- type: bind
source: ${PYTHON_DOCKER_CLIENT_CONFIG_PATH}
target: /app/python_config.yaml
read_only: true
- type: bind
source: ${DOCKER_LOG_CONFIG_PATH}
target: /app/logging_config.yaml
read_only: true
- type: bind
source: ${EXPERIMENT_OUTPUT_DIR}
target: /app/experiment2-out
- zmq_client:/app/zmq-out
- type: bind
source: ${MODEL_FULL_EVAL_DIR}
target: /app/full-eval
read_only: true
- type: bind
source: ${EXPERIMENT_MODEL_INFO_PATH}
target: /app/experiment_model_info.csv
read_only: true
- type: bind
source: ${MOCK_EFFDET_INPUT_PATH}
target: /app/mock_webcam_image.jpg
read_only: true
command: >
bash -c 'cd src/python && exec python client_main.py -c /app/python_config.yaml -s ${QUIC_CLIENT_REMOTE_ADDR} ${MOCK_CAMERA:+--mock-camera}'
healthcheck:
test: ["CMD", "test", "-f", "/health/client_main_ready"]
interval: 2s
timeout: 3s
start_period: 30s
retries: 30

server_python_main:
profiles: ['server']
init: true
ipc: host
stop_grace_period: 30s
user: "${HOST_UID}:${HOST_GID}"
image: ${DOCKERHUB_USERNAME}/turbo-python-server:${IMAGE_TAG:-latest}
volumes:
- type: bind
source: ${PYTHON_DOCKER_SERVER_CONFIG_PATH}
target: /app/python_config.yaml
read_only: true
- type: bind
source: ${DOCKER_LOG_CONFIG_PATH}
target: /app/logging_config.yaml
read_only: true
- type: bind
source: ${EXPERIMENT_OUTPUT_DIR}
target: /app/experiment2-out
- zmq_server:/app/zmq-out
- type: bind
source: ${EFFDET_MODELS_DIR}
target: /app/av-models
read_only: true
- type: bind
source: ${EXPERIMENT_MODEL_INFO_PATH}
target: /app/experiment_model_info.csv
read_only: true
- type: bind
source: ${MOCK_EFFDET_OUTPUT_PATH}
target: /app/example_effdet_d4_output.npy
read_only: true
command: >
bash -c 'cd src/python && exec python server_main.py -c /app/python_config.yaml ${MOCK_INFERENCE:+--mock-inference}'

client_python_monitor:
profiles: ['client']
init: true
ipc: host
stop_grace_period: 30s
user: "${HOST_UID}:${HOST_GID}"
image: ${DOCKERHUB_USERNAME}/turbo-python-monitor:${IMAGE_TAG:-latest}
depends_on:
client_python_main:
condition: service_healthy
volumes:
- health_signals:/health
- type: bind
source: ${PYTHON_DOCKER_CLIENT_CONFIG_PATH}
target: /app/python_config.yaml
read_only: true
- type: bind
source: ${EXPERIMENT_OUTPUT_DIR}
target: /app/experiment2-out
- zmq_client:/app/zmq-out
ports:
- "${DASHBOARD_PORT}:5000"
healthcheck:
test: ["CMD", "test", "-f", "/health/monitor_ready"]
interval: 2s
timeout: 3s
start_period: 30s
retries: 30

networks:
quic_net:
ipam:
config:
- subnet: 10.64.89.0/24
gateway: 10.64.89.1

volumes:
health_signals:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
zmq_client:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
zmq_server:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
10 changes: 3 additions & 7 deletions config/client_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ MAX_LOG_ENTRIES: &max-log-entries 100
SLO_TIMEOUT: &slo-timeout 200 # TODO: change this
QUIC_SHM_SIZE: &quic-shm-size 50000000

# needed for ping loop
DST_IP: &dst-ip 136.118.43.70

main_client_config_list:
- service_id: 1
max_entries: *max-log-entries
Expand Down Expand Up @@ -87,7 +84,6 @@ bandwidth_allocator_config:
bidirectional_zmq_ping_handler_sockname: ping-handler

ping_handler_config:
dst_ip: *dst-ip
max_entries: 100
thread_concurrency: 5
bidirectional_zmq_sockname: ping-handler
Expand All @@ -103,7 +99,7 @@ camera_stream_config_list:
shmem_buf_size: *quic-shm-size
camera_np_size: [1080, 1920, 3]
zmq_kill_switch_sockname: camera-kill-1-switch
mock_camera_image_path: null # set to a file path (e.g. mock_webcam_image.jpg) to use a static image instead of webcam
mock_camera_image_path: /home/hwei/turbo/src/python/camera_stream/mock_webcam_image.jpg # only used when --mock-camera is passed
- camera_id: 2 # FRONT LEFT
usb_id: 4 # TODO: CONFIGURE THIS
max_entries: *max-log-entries
Expand All @@ -113,7 +109,7 @@ camera_stream_config_list:
shmem_buf_size: *quic-shm-size
camera_np_size: [1080, 1920, 3]
zmq_kill_switch_sockname: camera-kill-2-switch
mock_camera_image_path: null
mock_camera_image_path: /home/hwei/turbo/src/python/camera_stream/mock_webcam_image.jpg # only used when --mock-camera is passed
- camera_id: 3 # FRONT RIGHT
usb_id: 8 # TODO: CONFIGURE THIS
max_entries: *max-log-entries
Expand All @@ -123,7 +119,7 @@ camera_stream_config_list:
shmem_buf_size: *quic-shm-size
camera_np_size: [1080, 1920, 3]
zmq_kill_switch_sockname: camera-kill-3-switch
mock_camera_image_path: null
mock_camera_image_path: /home/hwei/turbo/src/python/camera_stream/mock_webcam_image.jpg # only used when --mock-camera is passed

main_plotter_config:
# service 4 is for junk stream
Expand Down
12 changes: 6 additions & 6 deletions config/server_config_gcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ server_config_list:
thread_concurrency: 10
shm_filesize: *shm-filesize
zmq_kill_switch_sockname: remote-server-kill-switch-1
mock_inference_output_path: null # set to a file path (e.g. example_effdet_d4_output.npz) to skip model loading and return mock detections
mock_model_latency_csv_path: null # set to experiment_model_info.csv path to simulate per-model inference latency in mock mode
mock_inference_output_path: /home/hwei/turbo/src/python/camera_stream/example_effdet_d4_output.npy # only used when --mock-inference is passed
mock_model_latency_csv_path: /home/hwei/turbo/experiment_model_info.csv # only used when --mock-inference is passed
- service_id: 2
max_entries: *max-log-entries
model_metadata_list: *model-list-ref
Expand All @@ -51,8 +51,8 @@ server_config_list:
thread_concurrency: 10
shm_filesize: *shm-filesize
zmq_kill_switch_sockname: remote-server-kill-switch-2
mock_inference_output_path: null
mock_model_latency_csv_path: null
mock_inference_output_path: /home/hwei/turbo/src/python/camera_stream/example_effdet_d4_output.npy # only used when --mock-inference is passed
mock_model_latency_csv_path: /home/hwei/turbo/experiment_model_info.csv # only used when --mock-inference is passed
- service_id: 3
max_entries: *max-log-entries
model_metadata_list: *model-list-ref
Expand All @@ -64,5 +64,5 @@ server_config_list:
thread_concurrency: 10
shm_filesize: *shm-filesize
zmq_kill_switch_sockname: remote-server-kill-switch-3
mock_inference_output_path: null
mock_model_latency_csv_path: null
mock_inference_output_path: /home/hwei/turbo/src/python/camera_stream/example_effdet_d4_output.npy # only used when --mock-inference is passed
mock_model_latency_csv_path: /home/hwei/turbo/experiment_model_info.csv # only used when --mock-inference is passed
Loading