Skip to main content

A distributed parameter server for managing configuration across processes

Project description

Parameter Server

Dead simple TCP-based parameter storage that actually works. No cap.

Quick Start

# Install dependencies
make install

# Run server
make server

Note, it uses example parameter yml file.

Python Usage

from param_server.client import AsyncParameterClient

async with AsyncParameterClient() as client:
    await client.set("/camera/exposure", 100)
    value = await client.get("/camera/exposure")
    print(f"Exposure: {value}")

Production Setup

Parameters.yml

Add your production parameters to file config/params.yml.

Docker Compose (recommended)

# Build container
make docker-build

# Start container
make docker-run

# Stop container
make stop

# Server runs on 0.0.0.0:8888

Configuration (when running without make)

Drop a YAML file with your defaults:

camera:
  exposure: 100
  gain: 1.5
  fps: 30

network:
  timeout: 5000
  retries: 3

Load it: --config your-config.yml

CLI Commands

# Basic operations
param-cli set /path/to/param value
param-cli get /path/to/param
param-cli delete /path/to/param
param-cli list --prefix /camera

# Live monitoring
param-cli watch /camera/exposure

# Health check
param-cli ping

Client Libraries

Async

from param_server.client import AsyncParameterClient

client = AsyncParameterClient("localhost", 8888)
await client.connect()
await client.set("/test", 123)
value = await client.get("/test")
await client.disconnect()

Features

  • Persistent connections (low latency)
  • Auto-reconnection (handles network issues)
  • Type support: str, int, float, bool
  • Concurrent operations
  • Tree-like parameter paths
  • JSON/tree CLI output formats
  • Docker ready

Port Configuration

Default port is 8888. Change it:

# Server
param-server --port 9999

# Client
param-cli --port 9999 ping

# Python
AsyncParameterClient("localhost", 9999)

# or 
ParameterClient("localhost", 9999)

Troubleshooting

Connection refused

# Check if server is running
param-cli ping

# Check port
netstat -tlnp | grep 8888

Permission denied

# Use different port
param-server --port 9999

Docker issues

# Check logs
docker compose logs param-server

# Rebuild
docker compose build --no-cache

That's it. Simple as.

@themladypan

Project details


Download files

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

Source Distribution

async_param_server-1.1.3.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

async_param_server-1.1.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file async_param_server-1.1.3.tar.gz.

File metadata

  • Download URL: async_param_server-1.1.3.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for async_param_server-1.1.3.tar.gz
Algorithm Hash digest
SHA256 0506c8b4efeea50fa8f62b14630d7ea7e5ac488b3789b562a070001fe41850f2
MD5 b1c85fad548d7ae619320f117b426276
BLAKE2b-256 0da4892d01b7abe25e6ee1d81d3f61601144e82642a8e5fe449634dbaf08e08e

See more details on using hashes here.

File details

Details for the file async_param_server-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for async_param_server-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7267ac7ad6d90dabd8c351b75cc048724f2e1474f789c4575554b5761a7100
MD5 7f5aa39b14f47b0b44ecd7ae6ec13439
BLAKE2b-256 b95bfae17778f2eb82af357d0545a18498cb08f9ecc5046231678bfe2fb97a81

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