Skip to content

Developer environment interface


Environment types implementing the DeveloperEnvironmentInterface interface may be managed by the env dev command group.

DeveloperEnvironmentConfig

repos class-attribute instance-attribute

repos: list[str] = field(default_factory=lambda: ['datadog-agent'])

clone class-attribute instance-attribute

clone: bool = False

DeveloperEnvironmentInterface

This interface defines the behavior of a developer environment.

app property

The Application instance.

name property

name: str

The name of the environment type e.g. linux-container.

instance property

instance: str

The instance of the environment e.g. default.

storage_dirs cached property

storage_dirs: StorageDirs

The storage directories for the environment.

config cached property

config: ConfigT

The user-defined configuration as an instance of the DeveloperEnvironmentConfig class, or subclass thereof.

config_file cached property

config_file: Path

The path to the JSON file that is used to persist the environment's configuration until the environment is removed.

shared_dir cached property

shared_dir: Path

The path to the directory that is used to share data between the host and the environment.

global_shared_dir cached property

global_shared_dir: Path

The path to the directory that is used to share data between all environments.

default_repo cached property

default_repo: str

The default repository to work on.

start abstractmethod

start() -> None

This method starts the developer environment. If this method returns early, the environment's status should contain information about the startup progress.

This method will only be called if the environment's status is stopped or nonexistent.

Users trigger this method by running the env dev start command.

stop abstractmethod

stop() -> None

This method stops the developer environment. If this method returns early, the environment's status should contain information about the shutdown progress.

This method will only be called if the environment's status is started.

Users trigger this method by running the env dev stop command.

remove abstractmethod

remove() -> None

This method removes the developer environment and all associated state.

This method will only be called if the environment's status is stopped or in an error state.

Users trigger this method by running the env dev remove command or with the -r/--remove flag of the env dev stop command.

status abstractmethod

status() -> EnvironmentStatus

This method returns the current status of the developer environment.

code abstractmethod

code(*, repo: str | None = None) -> None

This method opens the developer environment's code in the configured editor.

Users trigger this method by running the env dev code command.

Parameters:

Name Type Description Default
repo str | None

The repository to open the code for, or None to open the code for the first configured repository.

None

run_command abstractmethod

run_command(command: list[str], *, repo: str | None = None) -> None

This method runs a command inside the developer environment.

Users trigger this method by running the env dev run command.

Parameters:

Name Type Description Default
command list[str]

The command to run inside the developer environment.

required
repo str | None

The repository to run the command for, or None to run the command for the first configured repository.

None

launch_shell abstractmethod

launch_shell(*, repo: str | None = None) -> NoReturn

This method starts an interactive shell inside the developer environment.

Users trigger this method by running the env dev shell command.

Parameters:

Name Type Description Default
repo str | None

The repository to run the shell for, or None to run the shell for the first configured repository.

None

launch_gui

launch_gui() -> NoReturn

This method starts an interactive GUI inside the developer environment using e.g. RDP or VNC.

config_class classmethod

config_class() -> type[DeveloperEnvironmentConfig]

The DeveloperEnvironmentConfig class, or subclass thereof, that is used to configure the environment.