Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Configuration

Here you can find all available configuration options using ENV variables.

DockerComposeSettings

These environment variables are used to configure the default Docker Compose in the MADSci example lab.

NameTypeDefaultDescriptionExample
USER_IDinteger1000The user ID to use for the MADSci services inside Docker containers. This should match your host user ID to avoid file permission issues. If not set, the default value used by the container is 9999.1000
GROUP_IDinteger1000The group ID to use for the MADSci services inside Docker containers. This should match your host group ID to avoid file permission issues. If not set, the default value used by the container is 9999.1000
REPO_PATHstring"./"The path to the MADSci repository on the host machine. This is mounted into the Docker containers to provide access to the codebase."./"
CACHE_PORT | REDIS_PORTinteger6379The port on the host machine to bind the cache service (Valkey) to. This allows other services to connect to the cache running inside the Docker container.6379
DOCUMENT_DB_PORTinteger27017The port on the host machine to bind the document database service (FerretDB) to. This allows other services to connect to the document database running inside the Docker container.27017
POSTGRES_PORTinteger5432The port on the host machine to bind the PostgreSQL service to. This allows other services to connect to PostgreSQL running inside the Docker container.5432
OBJECT_STORAGE_PORTinteger8333The port on the host machine to bind the S3-compatible object storage service (SeaweedFS) to. This allows other services to connect to object storage running inside the Docker container.8333
OBJECT_STORAGE_CONSOLE_PORTinteger9333The port on the host machine to bind the object storage console (SeaweedFS master) to. This allows monitoring of the object storage cluster.9333

MadsciDeveloperSettings

Developer-focused settings for MADSci behavior.

These settings control development experience features like rich tracebacks. All settings use the MADSCI_ prefix for environment variables.

Environment Variables: MADSCI_DISABLE_RICH_TRACEBACKS: Set to true to disable rich tracebacks (default: false, rich tracebacks are enabled) MADSCI_RICH_TRACEBACKS_SHOW_LOCALS: Set to true to show local variables in tracebacks (default: false for security - can leak secrets)

Note: show_locals is disabled by default to prevent accidental exposure of sensitive data (tokens, passwords) that may be present in local variables during exceptions.

Environment Prefix: MADSCI_

NameTypeDefaultDescriptionExample
MADSCI_DISABLE_RICH_TRACEBACKSbooleanfalseDisable rich traceback handler for exception output.false
MADSCI_RICH_TRACEBACKS_SHOW_LOCALSbooleanfalseShow local variables in tracebacks. Disabled by default for security - can leak sensitive data.false

MadsciContext

Base class for MADSci context settings.

NameTypeDefaultDescriptionExample
LAB_SERVER_URLAnyUrl | nullnullThe URL of the lab server.null
EVENT_SERVER_URLAnyUrl | nullnullThe URL of the event server.null
EXPERIMENT_SERVER_URLAnyUrl | nullnullThe URL of the experiment server.null
DATA_SERVER_URLAnyUrl | nullnullThe URL of the data server.null
RESOURCE_SERVER_URLAnyUrl | nullnullThe URL of the resource server.null
WORKCELL_SERVER_URLAnyUrl | nullnullThe URL of the workcell server.null
LOCATION_SERVER_URLAnyUrl | nullnullThe URL of the location server.null

DataManagerSettings

Settings for the MADSci Data Manager.

Environment Prefix: DATA_

NameTypeDefaultDescriptionExample
DATA_SERVER_URLAnyUrl"http://localhost:8004/"The URL of the data manager server."http://localhost:8004/"
DATA_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
DATA_MANAGER_TYPEManagerType | null"data_manager"The type of manager."data_manager"
DATA_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
DATA_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
DATA_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
DATA_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
DATA_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
DATA_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
DATA_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
DATA_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
DATA_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
DATA_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
DATA_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
DATA_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
DATA_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
DATA_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
DATA_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
DATA_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
DATA_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
DATA_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
DATA_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
DATA_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
DATA_DATABASE_NAMEstring"madsci_data"The name of the MongoDB database where events are stored."madsci_data"
DATA_COLLECTION_NAMEstring"datapoints"The name of the MongoDB collection where data are stored."datapoints"
DOCUMENT_DB_URL | MONGO_DB_URL | DATA_DB_URL | DB_URL | DATA_DOCUMENT_DB_URLAnyUrl"mongodb://localhost:27017"The URL of the MongoDB-compatible document database used by the Data Manager."mongodb://localhost:27017"
DATA_FILE_STORAGE_PATHstring | Path".madsci/datapoints"The path where files are stored on the server.".madsci/datapoints"

ObjectStorageSettings

Settings for S3-compatible object storage.

Environment Prefix: OBJECT_STORAGE_

NameTypeDefaultDescriptionExample
OBJECT_STORAGE_ENDPOINTstring | nullnullEndpoint for S3-compatible storage (e.g., ‘storage.example.com:8333’)null
OBJECT_STORAGE_ACCESS_KEYstring""Access key for authentication""
OBJECT_STORAGE_SECRET_KEYstring""Secret key for authentication""
OBJECT_STORAGE_SECUREbooleanfalseWhether to use HTTPS (True) or HTTP (False)false
OBJECT_STORAGE_DEFAULT_BUCKETstring"madsci-data"Default bucket to use for storing data"madsci-data"
OBJECT_STORAGE_REGIONstring | nullnullOptional for AWS S3/other providersnull
OBJECT_STORAGE_PUBLIC_ENDPOINTstring | nullnullPublic-facing endpoint for object URLs (e.g., ‘localhost:9333’). If not set, defaults to the same value as ‘endpoint’.null

EventManagerSettings

Handles settings and configuration for the Event Manager.

Environment Prefix: EVENT_

NameTypeDefaultDescriptionExample
EVENT_SERVER_URLAnyUrl"http://localhost:8001/"The URL of the Event Manager server."http://localhost:8001/"
EVENT_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
EVENT_MANAGER_TYPEManagerType | null"event_manager"The type of manager."event_manager"
EVENT_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
EVENT_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
EVENT_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
EVENT_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
EVENT_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
EVENT_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
EVENT_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
EVENT_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
EVENT_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
EVENT_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
EVENT_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
EVENT_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
EVENT_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
EVENT_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
EVENT_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
EVENT_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
EVENT_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
EVENT_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
EVENT_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
EVENT_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
DOCUMENT_DB_URL | MONGO_DB_URL | EVENT_DB_URL | DB_URL | EVENT_DOCUMENT_DB_URLAnyUrl"mongodb://localhost:27017"The URL of the MongoDB-compatible document database used by the Event Manager."mongodb://localhost:27017"
EVENT_DATABASE_NAMEstring"madsci_events"The name of the MongoDB database where events are stored."madsci_events"
EVENT_COLLECTION_NAMEstring"events"The name of the MongoDB collection where events are stored."events"
EVENT_ALERT_LEVELEventLogLevel40The log level at which to send an alert.40
EVENT_EMAIL_ALERTSEmailAlertsConfig | nullnullThe configuration for sending email alerts.null
EVENT_RETENTION_ENABLEDbooleanfalseWhether automatic event retention is enabled.false
EVENT_SOFT_DELETE_AFTER_DAYSinteger90Days after which events are soft-deleted (archived).90
EVENT_HARD_DELETE_AFTER_DAYSinteger365Days after archive when events are permanently deleted via TTL index.365
EVENT_RETENTION_CHECK_INTERVAL_HOURSinteger24How often to run soft-delete retention checks (in hours).24
EVENT_ARCHIVE_BATCH_SIZEinteger1000Maximum number of events to archive in a single batch operation.1000
EVENT_MAX_BATCHES_PER_RUNinteger100Maximum number of batches to process per retention run (0 = unlimited).100
EVENT_BACKUP_ENABLEDbooleanfalseWhether automatic event backups are enabled.false
EVENT_BACKUP_SCHEDULEstring | nullnullCron expression for backup schedule (e.g., ‘0 2 * * *’ for 2am daily).null
EVENT_BACKUP_DIRstring | Path".madsci/backups/events"Directory for event backups.".madsci/backups/events"
EVENT_BACKUP_MAX_COUNTinteger10Maximum number of backup files to keep.10
EVENT_FAIL_ON_RETENTION_ERRORbooleanfalseIf True, raise exceptions on retention failures. If False, log and continue.false

WorkcellManagerSettings

Settings for the MADSci Workcell Manager.

Environment Prefix: WORKCELL_

NameTypeDefaultDescriptionExample
WORKCELL_SERVER_URLAnyUrl"http://localhost:8005/"The URL of the workcell manager server."http://localhost:8005/"
WORKCELL_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
WORKCELL_MANAGER_TYPEManagerType | null"workcell_manager"The type of manager."workcell_manager"
WORKCELL_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
WORKCELL_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
WORKCELL_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
WORKCELL_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
WORKCELL_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
WORKCELL_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
WORKCELL_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
WORKCELL_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
WORKCELL_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
WORKCELL_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
WORKCELL_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
WORKCELL_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
WORKCELL_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
WORKCELL_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
WORKCELL_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
WORKCELL_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
WORKCELL_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
WORKCELL_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
WORKCELL_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
WORKCELL_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
WORKCELL_NODESobject | nullnullNode URLs for the workcell, as a JSON dict mapping node names to their URLs.null
WORKCELLS_DIRECTORY | WORKCELL_WORKCELLS_DIRECTORYstring | Path | null".madsci/workcells"Directory used to store workcell-related files in. Defaults to .madsci/workcells. Workcell-related files will be stored in a sub-folder with the workcell name.".madsci/workcells"
CACHE_HOST | REDIS_HOST | WORKCELL_CACHE_HOSTstring"localhost"The hostname for the cache server (Valkey/Redis-compatible)."localhost"
CACHE_PORT | REDIS_PORT | WORKCELL_CACHE_PORTinteger6379The port for the cache server (Valkey/Redis-compatible).6379
CACHE_PASSWORD | REDIS_PASSWORD | WORKCELL_CACHE_PASSWORDstring | nullnullThe password for the cache server (Valkey/Redis-compatible).null
WORKCELL_SCHEDULER_UPDATE_INTERVALnumber5.0The interval at which the scheduler runs, in seconds. Must be >= node_update_interval5.0
WORKCELL_NODE_UPDATE_INTERVALnumber2.0The interval at which the workcell queries its node’s states and status, in seconds. Must be <= scheduler_update_interval2.0
WORKCELL_RECONNECT_ATTEMPT_INTERVALnumber30.0The interval (in seconds) at which the workcell retries connecting to disconnected nodes. A non-disruptive retry: if the node responds, its status is restored naturally; if not, it remains disconnected until the next attempt.30.0
WORKCELL_NODE_INFO_UPDATE_INTERVALnumber60.0The interval at which the workcell queries its node’s info, in seconds. Node info changes infrequently, so this can be much larger than node_update_interval to reduce network overhead.60.0
WORKCELL_COLD_START_DELAYinteger0How long the Workcell engine should sleep on startup0
WORKCELL_SCHEDULERstring"madsci.workcell_manager.schedulers.default_scheduler"Scheduler module that contains a Scheduler class that inherits from AbstractScheduler to use"madsci.workcell_manager.schedulers.default_scheduler"
DOCUMENT_DB_URL | MONGO_DB_URL | WORKCELL_MONGO_URL | MONGO_URL | WORKCELL_DOCUMENT_DB_URLAnyUrl | null"mongodb://localhost:27017"The URL for the MongoDB-compatible document database."mongodb://localhost:27017"
WORKCELL_DATABASE_NAMEstring"madsci_workcells"The name of the document database where events are stored."madsci_workcells"
WORKCELL_COLLECTION_NAMEstring"archived_workflows"The name of the document database collection where events are stored."archived_workflows"
WORKCELL_GET_ACTION_RESULT_RETRIESinteger3Number of times to retry getting an action result3

ExperimentManagerSettings

Settings for the MADSci Experiment Manager.

Environment Prefix: EXPERIMENT_

NameTypeDefaultDescriptionExample
EXPERIMENT_SERVER_URLAnyUrl"http://localhost:8002/"The URL of the experiment manager server."http://localhost:8002/"
EXPERIMENT_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
EXPERIMENT_MANAGER_TYPEManagerType | null"experiment_manager"The type of manager."experiment_manager"
EXPERIMENT_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
EXPERIMENT_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
EXPERIMENT_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
EXPERIMENT_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
EXPERIMENT_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
EXPERIMENT_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
EXPERIMENT_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
EXPERIMENT_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
EXPERIMENT_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
EXPERIMENT_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
EXPERIMENT_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
EXPERIMENT_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
EXPERIMENT_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
EXPERIMENT_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
EXPERIMENT_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
EXPERIMENT_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
EXPERIMENT_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
EXPERIMENT_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
EXPERIMENT_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
EXPERIMENT_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
DOCUMENT_DB_URL | MONGO_DB_URL | EXPERIMENT_DB_URL | DB_URL | EXPERIMENT_DOCUMENT_DB_URLAnyUrl"mongodb://localhost:27017"The URL of the MongoDB-compatible document database for the experiment manager."mongodb://localhost:27017"
EXPERIMENT_DATABASE_NAMEstring"madsci_experiments"The name of the MongoDB database where events are stored."madsci_experiments"
EXPERIMENT_COLLECTION_NAMEstring"experiments"The name of the MongoDB collection where events are stored."experiments"

ResourceManagerSettings

Settings for the MADSci Resource Manager.

Environment Prefix: RESOURCE_

NameTypeDefaultDescriptionExample
RESOURCE_SERVER_URLAnyUrl"http://localhost:8003"The URL of the resource manager server."http://localhost:8003"
RESOURCE_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
RESOURCE_MANAGER_TYPEManagerType | null"resource_manager"The type of manager."resource_manager"
RESOURCE_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
RESOURCE_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
RESOURCE_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
RESOURCE_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
RESOURCE_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
RESOURCE_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
RESOURCE_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
RESOURCE_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
RESOURCE_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
RESOURCE_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
RESOURCE_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
RESOURCE_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
RESOURCE_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
RESOURCE_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
RESOURCE_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
RESOURCE_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
RESOURCE_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
RESOURCE_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
RESOURCE_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
RESOURCE_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
RESOURCE_DEFAULT_TEMPLATESarray | nullnullDefault resource template definitions to create or update on manager startup.null
RESOURCE_DB_URLstring"postgresql://madsci:madsci@localhost:5434/resources"The URL of the database for the resource manager."postgresql://madsci:madsci@localhost:5434/resources"

LabManagerSettings

Settings for the MADSci Lab.

Environment Prefix: LAB_

NameTypeDefaultDescriptionExample
LAB_SERVER_URLAnyUrl"http://localhost:8000/"The URL of the lab manager."http://localhost:8000/"
LAB_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
LAB_MANAGER_TYPEManagerType | null"lab_manager"The type of manager."lab_manager"
LAB_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
LAB_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
LAB_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
LAB_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
LAB_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
LAB_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
LAB_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
LAB_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
LAB_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
LAB_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
LAB_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
LAB_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
LAB_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
LAB_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
LAB_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
LAB_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
LAB_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
LAB_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
LAB_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
LAB_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
LAB_DASHBOARD_FILES_PATHstring | Path | null"~/MADSci/ui/dist"Path to the static files for the dashboard. Set to None to disable the dashboard."~/MADSci/ui/dist"

LocationManagerSettings

Settings for the LocationManager.

Environment Prefix: LOCATION_

NameTypeDefaultDescriptionExample
LOCATION_SERVER_URLAnyUrl"http://localhost:8006/"The URL where this manager’s server runs."http://localhost:8006/"
LOCATION_MANAGER_IDstring | nullnullUnique identifier for this manager instance. If not set, a new ULID is generated at runtime. The registry system provides the stable ID thereafter.null
LOCATION_MANAGER_TYPEManagerType | null"location_manager"The type of manager."location_manager"
LOCATION_RATE_LIMIT_ENABLEDbooleantrueEnable rate limiting for API endpoints.true
LOCATION_RATE_LIMIT_REQUESTSinteger300Maximum number of requests allowed per long time window.300
LOCATION_RATE_LIMIT_WINDOWinteger60Long time window for rate limiting in seconds.60
LOCATION_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection. If None, short window limiting is disabled.50
LOCATION_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds. If None, short window limiting is disabled.1
LOCATION_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks.300
LOCATION_RATE_LIMIT_EXEMPT_IPSarray | nullnullList of IP addresses exempt from rate limiting. Defaults to localhost IPs (127.0.0.1, ::1) if not specified.null
LOCATION_UVICORN_WORKERSinteger | nullnullNumber of uvicorn worker processes. If None, uses uvicorn default (1).null
LOCATION_UVICORN_LIMIT_CONCURRENCYinteger | nullnullMaximum number of concurrent connections. If None, no limit is enforced.null
LOCATION_UVICORN_LIMIT_MAX_REQUESTSinteger | nullnullMaximum number of requests a worker will process before restarting. Helps prevent memory leaks.null
LOCATION_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve manager_id from the ID Registry at startup for stable identity across restarts.true
LOCATION_MANAGER_NAMEstring | nullnullName for this manager instance. Used for registry lookup and display.null
LOCATION_MANAGER_DESCRIPTIONstring | nullnullHuman-readable description of this manager instance.null
LOCATION_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
LOCATION_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
LOCATION_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integration for this managerfalse
LOCATION_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to manager name)null
LOCATION_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
LOCATION_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
LOCATION_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
LOCATION_RECONCILIATION_INTERVAL_SECONDSnumber30.0Interval in seconds between background reconciliation cycles for lazy template resolution.30.0
LOCATION_RECONCILIATION_ENABLEDbooleantrueWhether to enable background reconciliation of unresolved template references.true
LOCATION_LAB_CONFIG_FILEstring | null"locations.yaml"Path to a YAML file defining lab-level locations and training. Re-read on each reconciliation cycle with desired-state semantics. All locations created from this file are tagged as lab-managed."locations.yaml"
DOCUMENT_DB_URL | MONGO_DB_URL | LOCATION_DOCUMENT_DB_URLAnyUrl"mongodb://localhost:27017/"URL for the document database (MongoDB/FerretDB) used for persistent location storage."mongodb://localhost:27017/"
LOCATION_DATABASE_NAMEstring"madsci_locations"Name of the database for persistent location storage."madsci_locations"
CACHE_HOST | REDIS_HOST | LOCATION_CACHE_HOSTstring"localhost"The host of the cache server (Valkey/Redis-compatible) for transient state (locks, change counters)."localhost"
CACHE_PORT | REDIS_PORT | LOCATION_CACHE_PORTinteger6379The port of the cache server (Valkey/Redis-compatible) for transient state.6379
CACHE_PASSWORD | REDIS_PASSWORD | LOCATION_CACHE_PASSWORDstring | nullnullThe password for the cache server (Valkey/Redis-compatible) (if required).null

LocationTransferCapabilities

Transfer capabilities for a location manager.

Environment Prefix: LOCATION_TRANSFER_CAPABILITIES__

NameTypeDefaultDescriptionExample
LOCATION_TRANSFER_CAPABILITIES__TRANSFER_TEMPLATESarray[]Available transfer step templates[]

TransferTemplateOverrides

Override transfer templates for specific source/destination patterns.

Environment Prefix: LOCATION_TRANSFER_CAPABILITIES__OVERRIDE_TRANSFER_TEMPLATES__

NameTypeDefaultDescriptionExample
LOCATION_TRANSFER_CAPABILITIES__OVERRIDE_TRANSFER_TEMPLATES__SOURCE_OVERRIDESobject | nullnullOverride templates for specific source locations. Key is location_name or location_id.null
LOCATION_TRANSFER_CAPABILITIES__OVERRIDE_TRANSFER_TEMPLATES__TARGET_OVERRIDESobject | nullnullOverride templates for specific target locations. Key is location_name or location_id.null
LOCATION_TRANSFER_CAPABILITIES__OVERRIDE_TRANSFER_TEMPLATES__PAIR_OVERRIDESobject | nullnullOverride templates for specific (source, target) pairs. Outer key is source location_name or location_id, inner key is target location_name or location_id.null

CapacityCostConfig

Configuration for capacity-aware cost adjustments.

Environment Prefix: LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__

NameTypeDefaultDescriptionExample
LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__ENABLEDbooleanfalseWhether to enable capacity-aware cost adjustmentsfalse
LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__HIGH_CAPACITY_THRESHOLDnumber0.8Utilization ratio (quantity/capacity) above which to apply high capacity multiplier0.8
LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__FULL_CAPACITY_THRESHOLDnumber1.0Utilization ratio (quantity/capacity) above which to apply full capacity multiplier1.0
LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__HIGH_CAPACITY_MULTIPLIERnumber2.0Cost multiplier when destination resource capacity utilization is high2.0
LOCATION_TRANSFER_CAPABILITIES__CAPACITY_COST_CONFIG__FULL_CAPACITY_MULTIPLIERnumber10.0Cost multiplier when destination resource capacity is at or above capacity10.0

EventClientConfig

Configuration for an Event Client.

Inherits all HTTP client configuration from MadsciHttpClientConfig including:

Environment Prefix: EVENT_CLIENT_

NameTypeDefaultDescriptionExample
EVENT_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
EVENT_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
EVENT_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
EVENT_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
EVENT_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
EVENT_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
EVENT_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
EVENT_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
EVENT_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
EVENT_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
EVENT_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
EVENT_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
EVENT_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse
EVENT_CLIENT_NAMEstring | nullnullThe name of the event client.null
EVENT_SERVER_URLAnyUrl | nullnullThe URL of the event server.null
EVENT_CLIENT_LOG_LEVELinteger | EventLogLevel20The log level of the event client.20
EVENT_CLIENT_LOG_DIRstring | Path".madsci/logs"The directory to store logs in.".madsci/logs"
EVENT_CLIENT_LOG_ROTATION_TYPE"size" | "time" | "none""size"Type of log rotation: ‘size’ (RotatingFileHandler), ‘time’ (TimedRotatingFileHandler), or ‘none’"size"
EVENT_CLIENT_LOG_MAX_BYTESinteger10485760Maximum log file size in bytes before rotation (for size-based rotation)10485760
EVENT_CLIENT_LOG_BACKUP_COUNTinteger5Number of backup log files to keep5
EVENT_CLIENT_LOG_ROTATION_WHENstring"midnight"When to rotate logs (for time-based rotation): ‘S’, ‘M’, ‘H’, ‘D’, ‘midnight’, ‘W0’-‘W6’"midnight"
EVENT_CLIENT_LOG_ROTATION_INTERVALinteger1Interval for time-based rotation1
EVENT_CLIENT_LOG_COMPRESSION_ENABLEDbooleantrueWhether to compress rotated log files with gziptrue
EVENT_CLIENT_LOG_OUTPUT_FORMAT"json" | "console""console"Log output format: ‘json’ for structured machine-readable, ‘console’ for human-readable"console"
EVENT_CLIENT_FAIL_ON_ERRORbooleanfalseIf True, raise exceptions on logging/sending failures. If False, log errors silently and continue.false
EVENT_CLIENT_OTEL_ENABLEDbooleanfalseEnable OpenTelemetry tracing and metrics integrationfalse
EVENT_CLIENT_OTEL_SERVICE_NAMEstring | nullnullOverride service name for OpenTelemetry (defaults to client name)null
EVENT_CLIENT_OTEL_EXPORTER"console" | "otlp" | "none""console"OpenTelemetry exporter type: ‘console’ for development, ‘otlp’ for production, ‘none’ to disable"console"
EVENT_CLIENT_OTEL_ENDPOINTstring | nullnullOTLP collector endpoint (required when otel_exporter=‘otlp’)null
EVENT_CLIENT_OTEL_PROTOCOL"grpc" | "http""grpc"OTLP transport protocol (‘grpc’ or ‘http’)"grpc"
EVENT_CLIENT_OTEL_METRIC_EXPORT_INTERVAL_MSinteger10000Interval in milliseconds for exporting metrics to the collector10000

OwnershipInfo

Information about the ownership of a MADSci object.

Environment Prefix: EVENT_CLIENT_SOURCE__

NameTypeDefaultDescriptionExample
EVENT_CLIENT_SOURCE__USER_IDstring | nullnullThe ID of the user who owns the object.null
EVENT_CLIENT_SOURCE__EXPERIMENT_IDstring | nullnullThe ID of the experiment that owns the object.null
EVENT_CLIENT_SOURCE__CAMPAIGN_IDstring | nullnullThe ID of the campaign that owns the object.null
EVENT_CLIENT_SOURCE__PROJECT_IDstring | nullnullThe ID of the project that owns the object.null
EVENT_CLIENT_SOURCE__NODE_IDstring | nullnullThe ID of the node that owns the object.null
EVENT_CLIENT_SOURCE__WORKCELL_IDstring | nullnullThe ID of the workcell that owns the object.null
EVENT_CLIENT_SOURCE__LAB_IDstring | nullnullThe ID of the lab that owns the object.null
EVENT_CLIENT_SOURCE__STEP_IDstring | nullnullThe ID of the step that owns the object.null
EVENT_CLIENT_SOURCE__WORKFLOW_IDstring | nullnullThe ID of the workflow that owns the object.null
EVENT_CLIENT_SOURCE__MANAGER_IDstring | nullnullThe ID of the manager that owns the object.null

RestNodeClientConfig

Configuration for Node REST clients.

Node clients handle action operations (create, upload, start, download) that may require extended timeouts.

Environment Prefix: NODE_CLIENT_

NameTypeDefaultDescriptionExample
NODE_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
NODE_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
NODE_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
NODE_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
NODE_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
NODE_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
NODE_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout for node action operations60.0
NODE_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
NODE_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
NODE_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
NODE_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
NODE_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
NODE_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

ResourceClientConfig

Configuration for the Resource Manager client.

Environment Prefix: RESOURCE_CLIENT_

NameTypeDefaultDescriptionExample
RESOURCE_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
RESOURCE_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
RESOURCE_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
RESOURCE_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
RESOURCE_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
RESOURCE_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
RESOURCE_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
RESOURCE_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
RESOURCE_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
RESOURCE_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
RESOURCE_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
RESOURCE_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
RESOURCE_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse
RESOURCE_CLIENT_STARTUP_TIMEOUTnumber20.0Timeout in seconds for the startup polling loop that checks server availability.20.0

ExperimentClientConfig

Configuration for the Experiment Manager client.

Environment Prefix: EXPERIMENT_CLIENT_

NameTypeDefaultDescriptionExample
EXPERIMENT_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
EXPERIMENT_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
EXPERIMENT_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
EXPERIMENT_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
EXPERIMENT_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
EXPERIMENT_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
EXPERIMENT_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
EXPERIMENT_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
EXPERIMENT_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
EXPERIMENT_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
EXPERIMENT_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
EXPERIMENT_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
EXPERIMENT_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

DataClientConfig

Configuration for the Data Manager client.

The Data Manager handles data uploads and downloads that may require extended timeouts.

Environment Prefix: DATA_CLIENT_

NameTypeDefaultDescriptionExample
DATA_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
DATA_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
DATA_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
DATA_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
DATA_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
DATA_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
DATA_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
DATA_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
DATA_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
DATA_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
DATA_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
DATA_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
DATA_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

MadsciHttpClientConfig

Base configuration for MADSci HTTP clients.

This class provides standardized configuration for HTTP-based clients, including retry strategies, timeout values, and backoff algorithms. All MADSci HTTP clients should use this configuration to ensure consistency.

Attributes

retry_enabled : bool Whether to enable automatic retries for failed requests. Default: True. retry_total : int Total number of retry attempts. Default: 3. retry_backoff_factor : float Backoff factor between retries (in seconds). The actual delay is calculated as {backoff factor} * (2 ** ({retry number} - 1)). Default: 0.3. retry_status_forcelist : list[int] HTTP status codes that should trigger a retry. Default: [429, 500, 502, 503, 504]. retry_allowed_methods : Optional[list[str]] HTTP methods that are allowed to be retried. If None, uses urllib3 defaults (HEAD, GET, PUT, DELETE, OPTIONS, TRACE). Default: None. timeout_default : float Default timeout in seconds for standard requests. Default: 10. timeout_data_operations : float Timeout in seconds for data-heavy operations (e.g., uploads, downloads). Default: 60. timeout_long_operations : float Timeout in seconds for long-running operations (e.g., workflow queries, utilization). Default: 100. pool_connections : int Number of connection pool entries for the session. Default: 10. pool_maxsize : int Maximum size of the connection pool. Default: 10. rate_limit_tracking_enabled : bool Whether to track rate limit headers from server responses. Default: True. rate_limit_warning_threshold : float Threshold (0.0 to 1.0) at which to log warnings about approaching rate limits. Default: 0.8. rate_limit_respect_limits : bool Whether to proactively delay requests when approaching rate limits. Default: False.

Environment Prefix: MADSCI_CLIENT_

NameTypeDefaultDescriptionExample
MADSCI_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
MADSCI_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
MADSCI_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
MADSCI_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
MADSCI_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
MADSCI_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
MADSCI_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
MADSCI_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
MADSCI_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
MADSCI_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
MADSCI_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
MADSCI_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
MADSCI_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

LocationClientConfig

Configuration for the Location Manager client.

Environment Prefix: LOCATION_CLIENT_

NameTypeDefaultDescriptionExample
LOCATION_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
LOCATION_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
LOCATION_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
LOCATION_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
LOCATION_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
LOCATION_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
LOCATION_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
LOCATION_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
LOCATION_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
LOCATION_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
LOCATION_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
LOCATION_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
LOCATION_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse
LOCATION_CLIENT_STARTUP_RETRY_MAX_ATTEMPTSinteger5Maximum number of retry attempts for startup init operations (e.g. init_representation_template).5
LOCATION_CLIENT_STARTUP_RETRY_INITIAL_DELAYnumber1.0Initial delay in seconds between retries for startup init operations.1.0
LOCATION_CLIENT_STARTUP_RETRY_MAX_DELAYnumber15.0Maximum delay in seconds between retries for startup init operations.15.0
LOCATION_CLIENT_STARTUP_RETRY_BACKOFF_FACTORnumber2.0Exponential backoff multiplier for startup init retries.2.0

WorkcellClientConfig

Configuration for the Workcell Manager client.

The Workcell Manager handles workflow queries that may require extended timeouts.

Environment Prefix: WORKCELL_CLIENT_

NameTypeDefaultDescriptionExample
WORKCELL_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
WORKCELL_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
WORKCELL_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
WORKCELL_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
WORKCELL_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
WORKCELL_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
WORKCELL_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
WORKCELL_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
WORKCELL_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
WORKCELL_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
WORKCELL_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
WORKCELL_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
WORKCELL_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

LabClientConfig

Configuration for the Lab (Squid) client.

Environment Prefix: LAB_CLIENT_

NameTypeDefaultDescriptionExample
LAB_CLIENT_RETRY_ENABLEDbooleantrueWhether to enable automatic retries for failed requeststrue
LAB_CLIENT_RETRY_TOTALinteger3Total number of retry attempts3
LAB_CLIENT_RETRY_BACKOFF_FACTORnumber0.3Backoff factor between retries in seconds0.3
LAB_CLIENT_RETRY_STATUS_FORCELISTarray[429,500,502,503,504]HTTP status codes that should trigger a retry[429,500,502,503,504]
LAB_CLIENT_RETRY_ALLOWED_METHODSarray | nullnullHTTP methods allowed to be retried (None uses urllib3 defaults)null
LAB_CLIENT_TIMEOUT_DEFAULTnumber10.0Default timeout in seconds for standard requests10.0
LAB_CLIENT_TIMEOUT_DATA_OPERATIONSnumber60.0Timeout in seconds for data-heavy operations60.0
LAB_CLIENT_TIMEOUT_LONG_OPERATIONSnumber100.0Timeout in seconds for long-running operations100.0
LAB_CLIENT_POOL_CONNECTIONSinteger10Number of connection pool entries10
LAB_CLIENT_POOL_MAXSIZEinteger10Maximum size of the connection pool10
LAB_CLIENT_RATE_LIMIT_TRACKING_ENABLEDbooleantrueWhether to track rate limit headers from server responsestrue
LAB_CLIENT_RATE_LIMIT_WARNING_THRESHOLDnumber0.8Threshold (as fraction of limit) at which to log warnings about approaching rate limits0.8
LAB_CLIENT_RATE_LIMIT_RESPECT_LIMITSbooleanfalseWhether to proactively delay requests when approaching rate limitsfalse

NodeConfig

Basic Configuration for a MADSci Node.

Environment Prefix: NODE_

NameTypeDefaultDescriptionExample
NODE_STATUS_UPDATE_INTERVALnumber | null2.0The interval in seconds at which the node should update its status.2.0
NODE_STATE_UPDATE_INTERVALnumber | null2.0The interval in seconds at which the node should update its state.2.0
NODE_NAMEstring | nullnullName for this node. If not set, defaults to the class name.null
NODE_IDstring | nullnullUnique ID for this node. If not set, a new ULID is generated.null
NODE_TYPENodeType | nullnullThe type of thing this node provides an interface for.null
NODE_MODULE_NAMEstring | nullnullName of the node module implementation.null
NODE_MODULE_VERSIONstring | nullnullVersion of the node module implementation.null
NODE_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve node_id from the ID Registry at startup for stable identity across restarts.true
NODE_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
NODE_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0

RestNodeConfig

Default Configuration for a MADSci Node that communicates over REST.

Environment Prefix: NODE_

NameTypeDefaultDescriptionExample
NODE_STATUS_UPDATE_INTERVALnumber | null2.0The interval in seconds at which the node should update its status.2.0
NODE_STATE_UPDATE_INTERVALnumber | null2.0The interval in seconds at which the node should update its state.2.0
NODE_NAMEstring | nullnullName for this node. If not set, defaults to the class name.null
NODE_IDstring | nullnullUnique ID for this node. If not set, a new ULID is generated.null
NODE_TYPENodeType | nullnullThe type of thing this node provides an interface for.null
NODE_MODULE_NAMEstring | nullnullName of the node module implementation.null
NODE_MODULE_VERSIONstring | nullnullVersion of the node module implementation.null
NODE_ENABLE_REGISTRY_RESOLUTIONbooleantrueWhen true, resolve node_id from the ID Registry at startup for stable identity across restarts.true
NODE_LAB_URLAnyUrl | nullnullLab Manager URL for distributed registry coordination.null
NODE_REGISTRY_LOCK_TIMEOUTnumber60.0Seconds to retry registry lock acquisition on contention at startup. Should be at least 2x the lock TTL (30s) to survive ungraceful container restarts.60.0
NODE_URLAnyUrl"http://127.0.0.1:2000/"The URL used to communicate with the node. This is the base URL for the REST API."http://127.0.0.1:2000/"
NODE_UVICORN_KWARGSobject{"limit_concurrency":10}Configuration for the Uvicorn server that runs the REST API. By default, sets limit_concurrency=10 to protect against connection exhaustion attacks.{"limit_concurrency":10}
NODE_ENABLE_RATE_LIMITINGbooleantrueEnable rate limiting middleware for the REST API.true
NODE_RATE_LIMIT_REQUESTSinteger100Maximum number of requests allowed per long time window (only used if enable_rate_limiting is True).100
NODE_RATE_LIMIT_WINDOWinteger60Long time window in seconds for rate limiting (only used if enable_rate_limiting is True).60
NODE_RATE_LIMIT_SHORT_REQUESTSinteger | null50Maximum number of requests allowed per short time window for burst protection (only used if enable_rate_limiting is True). If None, short window limiting is disabled.50
NODE_RATE_LIMIT_SHORT_WINDOWinteger | null1Short time window for burst protection in seconds (only used if enable_rate_limiting is True). If None, short window limiting is disabled.1
NODE_RATE_LIMIT_CLEANUP_INTERVALinteger300Interval in seconds between cleanup operations to prevent memory leaks (only used if enable_rate_limiting is True).300

PostgreSQLBackupSettings

PostgreSQL-specific backup settings.

Environment Prefix: POSTGRES_

NameTypeDefaultDescriptionExample
POSTGRES_BACKUP_DIRPath".madsci/backups"Directory for storing backups".madsci/backups"
POSTGRES_MAX_BACKUPSinteger10Maximum number of backups to retain10
POSTGRES_VALIDATE_INTEGRITYbooleantruePerform integrity validation after backuptrue
POSTGRES_COMPRESSIONbooleantrueEnable backup compressiontrue
DB_URLstring"postgresql://madsci:madsci@localhost:5432/postgres"PostgreSQL connection URL"postgresql://madsci:madsci@localhost:5432/postgres"
POSTGRES_BACKUP_FORMATstring"custom"pg_dump format: custom, plain, directory, tar"custom"

DocumentDBBackupSettings

Document database backup settings.

Environment Prefix: DOCUMENT_DB_

NameTypeDefaultDescriptionExample
DOCUMENT_DB_BACKUP_DIRPath".madsci/backups"Directory for storing backups".madsci/backups"
DOCUMENT_DB_MAX_BACKUPSinteger10Maximum number of backups to retain10
DOCUMENT_DB_VALIDATE_INTEGRITYbooleantruePerform integrity validation after backuptrue
DOCUMENT_DB_COMPRESSIONbooleantrueEnable backup compressiontrue
DOCUMENT_DB_URL | MONGO_DB_URLAnyUrl"mongodb://localhost:27017"Document database connection URL (FerretDB/MongoDB-compatible)"mongodb://localhost:27017"
DOCUMENT_DB_DATABASEstring | nullnullDatabase name to backupnull
DOCUMENT_DB_COLLECTIONSarray | nullnullSpecific collections to backup (all if None)null

DocumentDBMigrationSettings

Configuration settings for document database migration operations.

Environment Prefix: DOCUMENT_DB_MIGRATION_

NameTypeDefaultDescriptionExample
DOCUMENT_DB_URL | MONGO_DB_URL | MONGODB_URL | MONGO_URL | DATABASE_URL | DB_URLAnyUrl"mongodb://localhost:27017"Document database connection URL (FerretDB/MongoDB-compatible, e.g., mongodb://localhost:27017). Defaults to localhost instance."mongodb://localhost:27017"
DOCUMENT_DB_MIGRATION_DATABASEstring | nullnullDatabase name to migrate (e.g., madsci_events, madsci_data)null
SCHEMA_FILE | DOCUMENT_DB_SCHEMA_FILE | MONGODB_SCHEMA_FILEstring | Path | nullnullExplicit path to schema.json. If not provided, will auto-detect based on database name.null
DOCUMENT_DB_MIGRATION_BACKUP_DIRstring | Path".madsci/backups/document_db"Directory where database backups will be stored.".madsci/backups/document_db"
DOCUMENT_DB_MIGRATION_TARGET_VERSIONstring | nullnullTarget version to migrate to (defaults to current MADSci version)null
DOCUMENT_DB_MIGRATION_BACKUP_ONLYbooleanfalseOnly create a backup, do not run migrationfalse
DOCUMENT_DB_MIGRATION_RESTORE_FROMstring | Path | nullnullRestore from specified backup directory instead of migratingnull
DOCUMENT_DB_MIGRATION_CHECK_VERSIONbooleanfalseOnly check version compatibility, do not migratefalse
DOCUMENT_DB_MIGRATION_VALIDATE_SCHEMAbooleanfalseValidate current database schema against expected schemafalse

DatabaseMigrationSettings

Configuration settings for PostgreSQL database migration operations.

Environment Prefix: RESOURCES_MIGRATION_

NameTypeDefaultDescriptionExample
RESOURCES_MIGRATION_DB_URLstring | nullnullPostgreSQL connection URL (e.g., postgresql://user:pass@localhost:5432/postgres). If not provided, will try RESOURCES_DB_URL environment variable.null
RESOURCES_MIGRATION_TARGET_VERSIONstring | nullnullTarget version to migrate to (defaults to current MADSci version)null
RESOURCES_MIGRATION_BACKUP_DIRstring | Path".madsci/backups/postgresql"Directory where database backups will be stored.".madsci/backups/postgresql"
RESOURCES_MIGRATION_BACKUP_ONLYbooleanfalseOnly create a backup, do not run migrationfalse
RESOURCES_MIGRATION_RESTORE_FROMstring | Path | nullnullRestore from specified backup file instead of migratingnull
RESOURCES_MIGRATION_GENERATE_MIGRATIONstring | nullnullGenerate a new migration file with the given messagenull