chunker ui redo
This commit is contained in:
@@ -89,6 +89,15 @@ services:
|
||||
mc anonymous set download local/mpr-media-in
|
||||
mc anonymous set download local/mpr-media-out
|
||||
|
||||
envoy:
|
||||
image: envoyproxy/envoy:v1.28-latest
|
||||
ports:
|
||||
- "8090:8090"
|
||||
volumes:
|
||||
- ./envoy.yaml:/etc/envoy/envoy.yaml:ro
|
||||
depends_on:
|
||||
- grpc
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
@@ -96,12 +105,14 @@ services:
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./landing.html:/etc/nginx/landing.html:ro
|
||||
- ../media/out:/app/media/out:ro
|
||||
depends_on:
|
||||
- django
|
||||
- fastapi
|
||||
- timeline
|
||||
- chunker
|
||||
- minio
|
||||
- envoy
|
||||
|
||||
# =============================================================================
|
||||
# Application Services
|
||||
@@ -139,7 +150,7 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ctrl/Dockerfile.worker
|
||||
command: celery -A admin.mpr worker -l info -Q transcode -c 2
|
||||
command: celery -A admin.mpr worker -l info -Q celery,transcode -c 2
|
||||
environment:
|
||||
<<: *common-env
|
||||
MPR_EXECUTOR: local
|
||||
@@ -163,6 +174,8 @@ services:
|
||||
VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-}
|
||||
volumes:
|
||||
- ../ui/timeline/src:/app/src
|
||||
- ../ui/timeline/vite.config.ts:/app/vite.config.ts
|
||||
- ../ui/common:/common
|
||||
|
||||
chunker:
|
||||
build:
|
||||
@@ -174,6 +187,8 @@ services:
|
||||
VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-}
|
||||
volumes:
|
||||
- ../ui/chunker/src:/app/src
|
||||
- ../ui/chunker/vite.config.ts:/app/vite.config.ts
|
||||
- ../ui/common:/common
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
64
ctrl/envoy.yaml
Normal file
64
ctrl/envoy.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
admin:
|
||||
address:
|
||||
socket_address: { address: 0.0.0.0, port_value: 9901 }
|
||||
|
||||
static_resources:
|
||||
listeners:
|
||||
- name: listener_0
|
||||
address:
|
||||
socket_address: { address: 0.0.0.0, port_value: 8090 }
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.http_connection_manager
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
||||
codec_type: auto
|
||||
stat_prefix: ingress_http
|
||||
route_config:
|
||||
name: local_route
|
||||
virtual_hosts:
|
||||
- name: local_service
|
||||
domains: ["*"]
|
||||
routes:
|
||||
- match: { prefix: "/" }
|
||||
route:
|
||||
cluster: grpc_service
|
||||
timeout: 600s
|
||||
max_stream_duration:
|
||||
grpc_timeout_header_max: 600s
|
||||
cors:
|
||||
allow_origin_string_match:
|
||||
- prefix: "*"
|
||||
allow_methods: GET, PUT, DELETE, POST, OPTIONS
|
||||
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
|
||||
expose_headers: grpc-status,grpc-message
|
||||
max_age: "1728000"
|
||||
http_filters:
|
||||
- name: envoy.filters.http.grpc_web
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
|
||||
- name: envoy.filters.http.cors
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
|
||||
- name: envoy.filters.http.router
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
||||
clusters:
|
||||
- name: grpc_service
|
||||
connect_timeout: 5s
|
||||
type: logical_dns
|
||||
lb_policy: round_robin
|
||||
typed_extension_protocol_options:
|
||||
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
|
||||
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
|
||||
explicit_http_config:
|
||||
http2_protocol_options: {}
|
||||
load_assignment:
|
||||
cluster_name: grpc_service
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: grpc
|
||||
port_value: 50051
|
||||
@@ -19,4 +19,13 @@ python -m grpc_tools.protoc \
|
||||
# Fix relative import in generated grpc stub
|
||||
sed -i 's/^import worker_pb2/from . import worker_pb2/' core/rpc/worker_pb2_grpc.py
|
||||
|
||||
# Generate TypeScript gRPC-Web client from proto
|
||||
echo "Generating TypeScript gRPC-Web client..."
|
||||
cd ui/chunker
|
||||
npx protoc \
|
||||
--ts_out ../common/api/grpc \
|
||||
--proto_path ../../core/rpc/protos \
|
||||
worker.proto
|
||||
cd ../..
|
||||
|
||||
echo "Done!"
|
||||
|
||||
@@ -29,6 +29,10 @@ http {
|
||||
server minio:9000;
|
||||
}
|
||||
|
||||
upstream envoy {
|
||||
server envoy:8090;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name mpr.local.ar;
|
||||
@@ -106,8 +110,24 @@ http {
|
||||
}
|
||||
|
||||
location /media/out/ {
|
||||
proxy_pass http://minio/mpr-media-out/;
|
||||
proxy_set_header Host $http_host;
|
||||
alias /app/media/out/;
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
# gRPC-Web proxy via Envoy
|
||||
location /grpc-web/ {
|
||||
proxy_pass http://envoy/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 600s;
|
||||
|
||||
# Critical for streaming: disable nginx response buffering
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
chunked_transfer_encoding on;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user