# A Case Study on Virtual HPC Container Clusters and Machine Learning Applications
## 3 Container Architecture
### Container Clusters  
The virtual cluster architecture used in this work is based on [22]. A single container constitutes a cluster node. One acts as the supervisory node (designated _master_), while the others are worker nodes (named _worker_). The containers are grouped with Docker Compose and connected by an isolated internal network that handles process management and inter-container communication. All containers are launched from the same node image stored locally, differing only in configuration. When the cluster is enabled, the user connects to the supervisory node through a remote-control client or simply attaches to the container shell with Docker. Docker Compose allows the cluster to be started, removed, or scaled with single console commands. Once activated, it is almost immediately ready for use, so the user may begin programming and testing applications. Cluster nodes are automatically discovered by a script in the supervisory container; their addresses are written to a hosts file in a predefined location, eliminating manual preparation. Two basic types of images were distinguished. **The base image** provides only the selected MPI implementation, which has been previously compiled from source, not installed via the system package manager. In a container created from the base image, standard MPI tools can be used for production (toolchain) and running parallel applications. Manual compilation is carried out for several reasons. Primarily, sometimes this is the only way to install any version of the software. Often, in official distribution repositories, such as Debian, one must wait until a package has gone through a certain life cycle and finally reached stable status. Until then, if one is using a stable distribution and updates of the required software are released quite often, installation through the package manager usually results in downloading an older version. Secondly, not every package repository for a given system even has the chosen MPI implementation. For example, in Alpine's official repositories, OpenMPI is available, but MPICH is not. The last reason is the existence of various options and optimizations that can only be configured before compilation. **The node image** extends the base image and serves as the basis for easily building a virtual cluster environment. It creates an unprivileged user dedicated to programming and running parallel applications. A special project folder is also prepared within it, which is intended to be shared with other containers through a volume, allowing for quick and trouble-free sharing of the necessary executable files with the subordinate worker nodes. The image contains tools that facilitate the user's work with the cluster and a startup script  
Figure 1: Architecture of HPC cluster with Docker containers. that configures the container based on modifiable environmental variables. It provides the function of automatically finding cluster hosts based on the service names defined in the Compose file. The node container is equipped with both a server and client for the SSH remote control protocol. The supervisory node communicates with the worker nodes via SSH to manage the processes of parallel applications. SSH can also be used for remote control of the supervisory node from the host system or a completely different, remote machine. SSH authentication is based on the public key method, so a pair of cryptographic keys are embedded into the image. The node image is prepared in such a way that a user with only the Docker Compose configuration file (available for download from a public repository on the Internet) and the installed Docker platform can enable the cluster and test their applications with minimal input into organizing the environment. To activate the virtual cluster and open the management console, two uncomplicated Docker commands are sufficient. When running an MPI program, there is no need for explicit, manual listing of the container addresses to which parallel processes will be assigned, thanks to the function of automatic host discovery.