maple.backend.envs.base.EnvBackend
- class maple.backend.envs.base.EnvBackend
Abstract base class for environment backends.
Provides Docker container management, health monitoring, and a unified interface for environment operations. Subclasses must implement environment-specific task listing and can override container configuration.
The backend handles: - Container lifecycle (start, stop, health checks) - Network communication with retry logic - Port mapping and startup validation - Cleanup on failure
Methods
__init__()Initialize the environment backend.
get_info(handle)Get environment information and metadata.
health(handle)Check health of a specific environment instance.
list_tasks([suite])List available tasks for this environment.
pull()Pull or verify the environment Docker image.
reset(handle[, seed])Reset the environment to initial state.
serve([num_envs, device, host_port])Start environment container(s).
setup(handle, task[, seed, env_kwargs])Setup environment with a specific task.
step(handle, action)Take a step in the environment with an action.
stop(handles)Stop multiple environment containers.
Attributes