Design (for DEM developers)
This chapter contains the technical documentation of the design.
The Development Environment Manager (DEM) provides an abstraction layer for the Development Platform, which encompasses a collection of available resources, such as registries, catalogs, container engines, and more. The modules that compose the platform form the core of the DEM.
The DEM implements commands that can interact with the platform. These commands can be executed using the command line interface (CLI). Additionally, some commands utilize a Text-based User Interface (TUI) that can be presented on the user's terminal.
The CLI can communicate with the platform in two ways:
- Over the Platform API, which can be achieved by instantiating the DevEnvLocalSetup class.
- By registering a UserOutput class, which is used by the core modules to interact with the user.
The platform offers the following resources:
- Tool images (
tool_images): You can use this resource to access tool images from both your local storage and the registries.
- Container Engine (
container_engine): This resource covers various operations related to the container engine, including:
- Pulling images
- Running containers
- Removing images
- Searching for images
- Registries (
registries): This resource contains information about the available registries. You can perform actions such as:
- Adding or deleting registries
- Listing the images stored in a registry
- Pulling an image from a registry
- Local Development Environments (
local_dev_envs): This resource provides a list of local Development Environments. You can obtain information about a specific Development Environment using this resource.
- Development Environment Catalogs (
dev_env_catalogs): This resource deals with the available catalogs. You can perform the following actions:
- Adding or deleting catalogs
- Listing the Development Environments within a catalog
- Cloning a Development Environment descriptor from a catalog
As shown in the diagram, the platform module depends on the rest of the resources. This concept allows for the creation of a unified interface for all internal resources.
The relationships between classes in the core modules can be observed in the Core Class Diagram.
This module is used to create a framework for the CLI commands. You can add a new command by
extending the list of functions in the main.py file and applying the
Rich is a Python library used for formatting text with colors and styles, displaying advanced
content like tables, markdown, and syntax-highlighted code.
DEM employs this module to present information to the user in the command line.
Requests is an HTTP library for Python.
This module can be used to capture character inputs. In cases where the Rich module is not suitable, Readchar is a useful tool for obtaining user input.
For instance, when the Rich module occupies the entire terminal for a TUI panel, Readchar can be used to capture navigation input by reading individual characters.
Docker is used to communicate directly with the Docker Engine. (The Docker CLI is not utilized.)
The commands can interact with the Platform by instantiating the DevEnvLocalSetup class, which should provide all the necessary functionality from the core modules.
For a detailed description of the functionality of each command, please refer to the Commands chapter. In this section, we provide flowcharts to describe the execution logic.