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-25.18.0rc1.tar.gz (48.0 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-25.18.0rc1-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file backend_ai_appproxy_worker-25.18.0rc1.tar.gz.

File metadata

File hashes

Hashes for backend_ai_appproxy_worker-25.18.0rc1.tar.gz
Algorithm Hash digest
SHA256 f83806b140ebcd33b6c4efb47388ab2a6b4e8041392aa4d1df1e45d1b8fd9931
MD5 edc2227997fc5a3ab7e3277336c427af
BLAKE2b-256 a4f989bddf18e8f4f6010bd318c23e5b2894d2858734c4db345f48a916ccd448

See more details on using hashes here.

File details

Details for the file backend_ai_appproxy_worker-25.18.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for backend_ai_appproxy_worker-25.18.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 6476e236100279a5b512abf52bb162bafe53b382162fa6f616b65630c1065fd2
MD5 483ab560bbd9a4a4fc7f3567b3a68b3f
BLAKE2b-256 6814beb72bfaeaed08cacd57e4e2275c4c5d94f36ad65ef5c949ed51a761b3f6

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