Skip to main content

Backend.AI AppProxy Worker

Project description

Backend.AI App Proxy Worker

Purpose

The App Proxy Worker is a high-performance reverse proxy that routes user traffic to compute session services (Jupyter, SSH, TensorBoard, etc.) running on agents. It receives routing information from the Coordinator and handles SSL/TLS termination, load balancing, and traffic forwarding.

Key Responsibilities

1. Traffic Proxying

  • Proxy HTTP/HTTPS requests to session services
  • Proxy WebSocket connections for interactive services
  • Handle SSL/TLS termination
  • Stream responses efficiently

2. Route Resolution

  • Receive routing tables from Coordinator
  • Resolve session services from URLs
  • Cache routing information locally
  • Update routes dynamically

3. Health Checking

  • Monitor backend service health
  • Detect failed services
  • Report health status to Coordinator
  • Handle service failover

Architecture

1. Traffic Proxy (Main)

Framework: aiohttp + custom reverse proxy

Port: 5050 (default, HTTPS)

Protocol: HTTP/HTTPS, WebSocket

Key Features:

HTTP/HTTPS Proxy

  • Route user requests to session services
  • URL Pattern: https://<worker-domain>/<session-id>/<service-name>/...

WebSocket Proxy

  • Interactive service communication (Jupyter Kernel, SSH, etc.)
  • Real-time log streaming

Key Characteristics:

  • SSL/TLS termination (Let's Encrypt auto-certificate)
  • High-performance async proxy
  • Connection pooling and reuse
  • Streaming support (large file downloads)
  • Sticky session support
  • Auto-retry and failover

Processing Flow:

HTTP Proxy Flow

User → HTTPS Request → Worker (SSL termination)
                           ↓
                       Parse URL (extract session_id, service_name)
                           ↓
                       Lookup route from local cache
                           ↓
                       Resolve backend address (agent:port)
                           ↓
                       Proxy request to agent
                           ↓
                       Stream response back to user

WebSocket Proxy Flow

User → WS Upgrade Request → Worker
                               ↓
                           Establish WS connection to agent
                               ↓
                           Bidirectional message forwarding

2. REST API (Management)

Framework: aiohttp (async HTTP server)

Port: 6040 (default, separate management port)

Key Features:

  • Communication with Coordinator
  • Health check endpoints
  • Metrics exposure (Prometheus)
  • Internal management (no external access)

Component Interaction

Traffic Proxy Flow:

User (Browser) → Worker (Port 5050) → Kernel (on Agent)
                    │
                    ├─ SSL/TLS termination
                    ├─ Route resolution
                    └─ Traffic proxying

Management Flow:

Coordinator → Worker REST API (Port 6040) → Route updates

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backend_ai_appproxy_worker-26.4.7.tar.gz (57.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

backend_ai_appproxy_worker-26.4.7-py3-none-any.whl (78.1 kB view details)

Uploaded Python 3

File details

Details for the file backend_ai_appproxy_worker-26.4.7.tar.gz.

File metadata

File hashes

Hashes for backend_ai_appproxy_worker-26.4.7.tar.gz
Algorithm Hash digest
SHA256 f6ba42045d506cce1a17d283e1e7e1e2e2f8ae818bc2266e42a88ad26cac5f29
MD5 b67fd97193e192463438e97307e56d2d
BLAKE2b-256 7804f3b8155ec9c7a3d4cd1ae8042fa216473058263313a16d80c9cde8bf8d67

See more details on using hashes here.

File details

Details for the file backend_ai_appproxy_worker-26.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for backend_ai_appproxy_worker-26.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b4799105e92e025e069698bd3e5b98a38e63e7449a0bc73c95be23baf6bd82
MD5 a176d2da66d5ec3df67b39f6aae4b88b
BLAKE2b-256 4bb4b35248fc0dc98539e974ee123e5c58fba2195d819a29602a02700b7a4754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page