Creating Containers

BugZoo uses Docker containers to provide a controlled, sandbox for interacting with historical software bugs. Individual containers in BugZoo are represented as Container instances. All interaction with containers, including their creation and destruction, is managed through the ContainerManager class, exposed by the client’s containers property (e.g., client.containers).

To provision (i.e., create) a container for a given bug:

bug = client.bugs['manybugs:python:69223-69224']
container = client.containers.provision(bug)

To iterate over the unique identifiers (UIDs) of the containers associated with a given BugZoo instance and to fetch a container by its UID:

for uid in client.containers:
  container = client.containers[uid]

To check whether the underlying Docker container for a given Container is still alive:


Note that containers will not be automatically destroyed when their corresponding Container instance goes out of scope. Containers must be explicitly destroyed via the ContainerManager as follows:

del client.containers[container.uid]

All containers created by a BugZoo server will be automatically destroyed when the server closes.

API Reference

class Container[source]

Containers provide ephemeral, mutable instances of registered bugs, and are used to conduct studies of software bugs. Behind the scenes, containers are implemented as Docker containers.

id → str
to_dict() → Dict[str, Any][source]
static from_dict(d: Dict[str, Any]) → bugzoo.core.container.Container[source]
class ContainerManager[source]
__getitem__(uid: str) → bugzoo.core.container.Container[source]

Fetches a container by its ID.


uid – the ID of the container.


the container with the given ID.


KeyError – if no container is found with the given ID.

__delitem__(uid: str) → None[source]

Deletes a given container.


uid – the ID of the container.


KeyError – if no container is found with the given ID, or the container has already been destroyed.

__contains__(uid: str) → bool[source]

Checks whether a container with a given ID exists.


uid: the ID of the container.


True if the container exists; false if not.

__iter__() → Iterator[str][source]

Returns an iterator over the identifiers of all of the containers that are currently running on the server.

provision(bug: bugzoo.core.bug.Bug, *, plugins: Optional[List[bugzoo.core.tool.Tool]] = None) → bugzoo.core.container.Container[source]

Provisions a container for a given bug.

is_alive(container: bugzoo.core.container.Container) → bool[source]

Determines whether or not a given container is still alive.