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
289 changes: 219 additions & 70 deletions .env.exemple
Original file line number Diff line number Diff line change
@@ -1,129 +1,278 @@
#########################################
# Server Settings for Archetype Module
#########################################
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ SERVER SETTINGS ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# ══ Channel Settings ════════════════════════════════════════════════════════════════ #
# Enable health check service
SERVER_HEALTH_CHECK=True

# Host address on which the module gRPC server listens.
# Default: [::] (all IPv6 & IPv4 interfaces)
# Enable reflection for the server
SERVER_REFLECTION=True

# Maximum number of RPCs handled in parallel by the server.
SERVER_MAX_CONCURRENT_RPCS=2000

# Maximum number of workers for sync mode
SERVER_MAX_WORKERS=10

# Number of workers in the server thread pool.
SERVER_THREAD_POOL_WORKERS=4

# Enable asyncio inspector
SERVER_ASYNCIO_INSPECTOR_STATE=False

# Port for asyncio inspector
SERVER_ASYNCIO_INSPECTOR_PORT=8765

# Maximum number of cached setups in ModuleServicer
SERVER_SETUP_CACHE_MAX=100

# Timeout for completion in ModuleServicer
SERVER_COMPLETION_TIMEOUT=300.0


# ═════════════════════════════ Server Channel Settings ══════════════════════════════ #

# Host address to bind the client to
SERVER_CHANNEL_HOST=[::]

# TCP port for the module gRPC server.
# Default: 50055
# Port to listen on
SERVER_CHANNEL_PORT=50055

# Execution mode of the server. Possible values: async | sync
# Default: async
SERVER_CHANNEL_CONTROL_FLOW=async
# Client/Server operation mode (sync/async)
SERVER_CHANNEL_COMMUNICATION_MODE=async

# Security mode of the server. Possible values: insecure | secure
# Default: insecure
# Security mode (secure/insecure)
SERVER_CHANNEL_SECURITY=insecure

# Enable mutual TLS for incoming clients: "true" or "false"
# Default: false
SERVER_CHANNEL_MTLS=false
# Enable mutual TLS
SERVER_CHANNEL_MTLS=False

#SERVER_CHANNEL_CREDENTIALS__KEY_PATH=server.key
#SERVER_CHANNEL_CREDENTIALS__CERT_PATH=cert.key
#SERVER_CHANNEL_CREDENTIALS__ROOT_CERT_PATH=ca.crt
# gRPC compression algorithm
SERVER_CHANNEL_COMPRESSION=gzip

# Hostname or IP address that the server advertises to clients for connection.
# Default: digitalkin-ada-archetype
# (Optional)Public hostname/IP sent to registry for discovery. Falls back to host if not set.
SERVER_CHANNEL_ADVERTISE_HOST=

# ══ gRPC Settings ════════════════════════════════════════════════════════════════════ #

# Compression algorithm for gRPC messages. Possible values: gzip, deflate, snappy, zstd, or none
# Default: gzip
#TODO
## ════════════════════════════ Server Credentils Settings ════════════════════════════ #
#
## Path to credentials files
#SERVER_CHANNEL_CREDENTIAL_PATH=/credentials
#
## Path to the private key
#SERVER_CHANNEL_CREDENTIAL_KEY=server.key
#
## Path to the certificate
#SERVER_CHANNEL_CREDENTIAL_CERT=server.crt
#
## (Optional) Path to CA if MTLS is active
#SERVER_CHANNEL_CREDENTIAL_CA=ca.crt


# ═══════════════════════════════ Server Grpc Settings ═══════════════════════════════ #

# gRPC compression algorithm
SERVER_GRPC_COMPRESSION=gzip

# ── Option Grpc ───────────────────────────────────────────────────────────────────── #
# Time (in milliseconds) after which a keepalive ping is sent if the connection is idle.
# Default: 120000 (2 minutes)
# Interval for server keepalive pings.
SERVER_GRPC_OPTIONS_KEEPALIVE_TIME=120000

# Time (in milliseconds) the server waits for a keepalive ping ack before closing the connection.
# Default: 20000 (20 seconds)
# Timeout for server keepalive pings.
SERVER_GRPC_OPTIONS_KEEPALIVE_TIMEOUT=20000

# Minimum time (in milliseconds) between client pings.
# Default: 10000 (10 seconds)
# Minimum interval between HTTP/2 pings on the server side.
SERVER_GRPC_OPTIONS_MIN_PING_INTERVAL=10000

# Maximum message size (in bytes) the server can receive.
# Default: 4194304 (4MB)
SERVER_GRPC_OPTIONS_MAX_RECEIVE_MESSAGE_LENGTH=4194304
# Maximum message size the server can receive, in bytes.
SERVER_GRPC_OPTIONS_MAX_RECEIVE_MESSAGE_LENGTH=104857600

# Maximum message size (in bytes) the server can send.
# Default: 4194304 (4MB)
SERVER_GRPC_OPTIONS_MAX_SEND_MESSAGE_LENGTH=4194304
# Maximum message size the server can send, in bytes.
SERVER_GRPC_OPTIONS_MAX_SEND_MESSAGE_LENGTH=104857600

# Maximum number of pings the server allows without receiving any data from the client.
# Default: 0 (unlimited)
# Maximum number of pings the server allows without receiving any data. Setting to 0 allows unlimited pings, which is important for long-running streams.
SERVER_GRPC_OPTIONS_MAX_PINGS_WITHOUT_DATA=0

# Allow keepalive pings when there are no active calls. "true" or "false"
# Default: true
SERVER_GRPC_OPTIONS_KEEPALIVE_PERMIT_WITHOUT_CALLS=true
# Allow clients to send keepalive pings even when there are no active RPCs. This is important for keeping connections alive through proxies and detecting dead clients.
SERVER_GRPC_OPTIONS_KEEPALIVE_PERMIT_WITHOUT_CALLS=True


# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ CLIENT SETTINGS ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# Maximum number of retries for queries
CLIENT_QUERY_MAX_RETRIES=2

#########################################
# gRPC Client Configuration Services Provider
#########################################
# Base backoff time in milliseconds for query retries
CLIENT_QUERY_BACKOFF_BASE_MS=50

# Host address on which the services provider gRPC server listens.
# Default: [::] (all IPv6 & IPv4 interfaces)
# Timeout in seconds for queries
CLIENT_QUERY_TIMEOUT=30


# ═════════════════════════════ Client Channel Settings ══════════════════════════════ #

# Host address on which the services provider gRPC server listens (all IPv6 & IPv4 interfaces).
SERVICES_PROVIDER_URL=[::]

# TCP port for the services provider gRPC server.
# Default: 50151
SERVICES_PROVIDER_PORT=50151

# Execution mode of the services provider. Possible values: async | sync
# Default: async
SERVICES_PROVIDER_MODE=async

# Security mode of the services provider. Possible values: insecure | secure
# Default: insecure
SERVICES_PROVIDER_SECURITY=insecure

# Enable mutual TLS for outgoing calls: "true" or "false"
# Default: false
SERVICES_PROVIDER_MTLS=false

GRPC_DNS_RESOLVER="native"
# Security mode (secure/insecure)
CLIENT_CHANNEL_SECURITY=insecure

#############################################
# Other Configuration
#############################################
# Enable mutual TLS
CLIENT_CHANNEL_MTLS=False

MODULE_ID_TOOLKIT_RAG="modules:1"

OPENAI_API_KEY=sk-xxxx
#TODO
## ════════════════════════════ Client Credentils Settings ════════════════════════════ #
#
## Path to credentials files
#CLIENT_CHANNEL_CREDENTIAL_PATH=/credentials
#
## Path to the private key
#CLIENT_CHANNEL_CREDENTIAL_KEY=client.key
#
## Path to the certificate
#CLIENT_CHANNEL_CREDENTIAL_CERT=client.crt
#
## (Optional) Path to CA if MTLS is active
#CLIENT_CHANNEL_CREDENTIAL_CA=ca.crt


# ═══════════════════════════════ Client Grpc Settings ═══════════════════════════════ #

# Maximum message size the server can receive, in bytes.
CLIENT_GRPC_MAX_RECEIVE_MESSAGE_LENGHT=104857600

# Maximum message size the server can send, in bytes.
CLIENT_GRPC_MAX_SEND_MESSAGE_LENGTH=104857600

# Interval for server keepalive pings.
CLIENT_GRPC_KEEPALIVE_TIME=120000

# Timeout for server keepalive pings.
CLIENT_GRPC_KEEPALIVE_TIMEOUT=20000

# Allow clients to send keepalive pings even when there are no active RPCs. This is important for keeping connections alive through proxies and detecting dead clients.
CLIENT_GRPC_KEEPALIVE_PERMIT_WITHOUT_CALLS=True

# Minimum time between DNS resolutions in milliseconds
CLIENT_GRPC_DNS_RESOLUTION_TIME=500

# Initial reconnect backoff time in milliseconds
CLIENT_GRPC_INITIAL_RECONNECT_TIME=1000

# Maximum reconnect backoff time in milliseconds
CLIENT_GRPC_MAX_RECONNECT_TIME=10000

########################################
# Certificate Settings (CERTIFICATE_)
########################################
# Minimum reconnect backoff time in milliseconds
CLIENT_GRPC_MIN_RECONNECT_TIME=500

# Minimum time between HTTP/2 pings in milliseconds
CLIENT_GRPC_MIN_PING_INTERVAL_TIME=30000

# Enable gRPC retries
CLIENT_GRPC_ENABLE_RETRIES=True


# ═══════════════════════════ Client Retry Policy Settings ═══════════════════════════ #

# Maximum retry attempts including the original call
CLIENT_RETRY_POLICY_MAX_ATTEMPTS=5

# Initial backoff duration (e.g., '0.1s')
CLIENT_RETRY_POLICY_INITIAL_BACKOFF=0.1

# Maximum backoff duration (e.g., '10s')
CLIENT_RETRY_POLICY_MAX_BACKOFF=10

# Multiplier for exponential backoff
CLIENT_RETRY_POLICY_BACKOFF_MULTIPLIER=2.0


# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ TASK SETTINGS ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# Maximum number of concurrent tasks allowed.
TASK_MAX_CONCURRENT_TASKS=100

# Maximum time (in seconds) to wait for a task to complete before timing out.
TASK_WAIT_TIMEOUT=30

# Maximum time (in seconds) to wait for a stream to drain before forcing closure.
TASK_STREAM_DRAIN_TIMEOUT=60

# Maximum number of tasks that can be queued before new tasks are rejected.
TASK_MAX_QUEUED_TASKS=50

# Maximum time (in seconds) to wait for a task to be admitted before timing out.
TASK_ADMISSION_TIMEOUT=5

# Maximum time (in seconds) to wait for a queue slot to become available before timing out.
TASK_QUEUE_SLOT_TIMEOUT=600

# Interval for flushing signals
TASK_SIGNAL_FLUSH_INTERVAL=0.1

# Maximum batch size for signals
TASK_SIGNAL_MAX_BATCH_SIZE=50

# Number of retries for sending signals
TASK_SIGNAL_MAX_RETRIES=3

# Backoff in ms for sending signals
TASK_SIGNAL_SEND_BACKOFF_MS=100.0

# Interval for polling signals
TASK_SIGNAL_POLL_INTERVAL=1.0

# Initial interval for polling signals
TASK_SIGNAL_INITIAL_POLL_INTERVAL=0.1

# gRPC timeout for task manager operations
TASK_GRPC_TIMEOUT=30.0

# Timeout for polling operations
TASK_POLL_TIMEOUT=1.0

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Certificate Settings ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# Directory where server/client certificates are stored
# (default: "/certificates" / local: "./certs")
CERTIFICATE_CERT_VOLUME=/certificates

# Directory where registry CA certificates are stored
# (default: "/certificates" / local: "./certs")
CERTIFICATE_REGISTRY_CERT_VOLUME=/certificates

# (Optional) Directory for services_provider client.key, client.crt, and ca.crt
# If unset, defaults to CERTIFICATE_CERT_VOLUME
CERTIFICATE_SERVICES_PROVIDER_CERT_VOLUME=/certificates

########################################
# Langfuse Tracing Configuration
########################################

# Langfuse credentials for OTEL tracing
# Note: Authentication is handled programmatically using Base64-encoded Basic auth
# (public_key:secret_key), not via OTEL_EXPORTER_OTLP_HEADERS environment variable.
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Other Configuration ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# ═════════════════════════════════ Archetype Config ═════════════════════════════════ #

MODULE_ID_TOOLKIT_RAG="modules:1"
LANGFUSE_BASE_URL=https://langfuse.xxx.com

# ═════════════════════════════════════ Api Keys ═════════════════════════════════════ #

OPENAI_API_KEY=sk-xxxx
LANGFUSE_SECRET_KEY=sk-lf-xxxx
LANGFUSE_PUBLIC_KEY=pk-lf-xxxx
LANGFUSE_BASE_URL=https://langfuse.staging.digitalkin.com
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,8 @@ requirements.txt
certs/
.report.json
docker-compose.override.yml
AGENTS.md
docker/init_pycharm_helpers.sh
.ai/

CLAUDE.md
Loading
Loading