This project is a 🐾 pet project designed to perform 📤 distributed computations of matrix operations such as:
- ✂️ QR decomposition
- 📐 LU decomposition
- 🔄 LDL decomposition
- 🔃 Inverse matrix calculation
The system consists of two main 🧩 components:
- 🖥️ Qt-based client application: A 🖱️ graphical interface for user interaction.
- ☁️ K3s-based cluster: A distributed computational 🔙 backend deployed across 🖨️ three physical devices.
The Qt application provides the following ⚙️ functionality:
- 👤 User Management: Registration and 🔑 login using 📧 email or username.
- 🧮 Matrix Management:
- 📂 Upload matrix files in
.mtxformat to the 🖥️ server. - 🖼️ Display uploaded matrices in the UI.
- 📂 Upload matrix files in
- 📊 Operation Selection and Execution:
- 📩 Send selected matrix operations (✂️ QR, 📐 LU, 🔄 LDL, 🔃 inverse) to the ☁️ cluster.
- 📤 Receive and display computation 📝 results.
The cluster consists of multiple 🛖 pods orchestrated by K3s and spans 🌐 three devices:
- 2 🍊 Orange Pi Zero 3 boards (LAN-connected with 🌍 public IPs).
- 1 Virtual Dedicated Server (VDS) in 🇩🇪 Germany.
The cluster’s 👑 master node runs on one of the 🍊 Orange Pi Zero 3 boards and orchestrates the deployment and recovery of 🐳 Docker containers. Below is a detailed 🗺️ breakdown of the cluster’s components:
- Acts as the 🚪 single entry point for all client 📨 requests.
- Handles:
- 🔀 Forwarding client requests to appropriate 🛖 pods.
- ✅ Validating responses from other 🛖 pods.
- Communication: HTTP-based 🌐 REST API.
- Stores user 🧑💻 data (
users.db): 🔑 login, 🔒 password, 📧 email, and name. - Built with 🐍 Python, ⚡ FastAPI, and 📒 SQLite.
- Synchronizes with 🍃 MongoDB using HTTP 📨 requests.
- 🍃 MongoDB Container:
- Uses 📦 GridFS to store matrices in 🧩 chunks.
- 🍃 Mongo Control Pod:
- Provides HTTP 🌐 endpoints for matrix management (📤 upload, 📥 retrieve, 📃 list).
- Features 🧮 deduplication using 🧮 hash functions to avoid redundant 🗃️ storage.
- Built with 🐍 Python, ⚡ FastAPI, and 🌐 HTTPx.
- Distributes 🧮 matrix computation tasks to ⚙️ worker pods.
- Responsibilities:
- Converts
.mtx📂 files tonumpyarrays. - Queries ⚙️ worker pod status (using 📊 psutil) to identify the least loaded pod.
- Requests matrix 🗂️ data from 🍃 MongoDB.
- Converts
- Perform actual 🧮 matrix computations (✂️ QR, 📐 LU, 🔄 LDL, 🔃 inverse).
- Execution:
- 🔄 Asynchronous processing via 🐍 Python threads.
- 📝 Results are fetched by the ⚙️ Worker Node Controller Pod.
- Typically, 3 ⚙️ worker pods are active, but the system can 📈 scale horizontally by adding more ⚙️ pods.
- 🐳 Docker
- ☁️ K3s
- 🖥️ Qt Development Environment
- Clone the 🗂️ repository:
git clone <repository-url> cd docker_servers
- 🏗️ Build and push Docker 🐳 images:
./push_all_images_to_docker_hub.sh
- Apply Kubernetes YAML 🗒️ configurations:
kubectl apply -f yaml_files_for_k8s/
- Navigate to the
qt🗂️ directory:cd qt - 🛠️ Build the application:
mkdir build && cd build cmake .. && make
▶️ Run the client:./DB_client
Each 🛖 pod and the ☁️ cluster as a whole are tested using test.sh scripts, which use curl to perform 🔁 end-to-end tests.
- Navigate to the pod’s 🧪 test directory, e.g.,
main_server/tests/. - Run the test 🛠️ script:
./tests.sh
The 🗂️ repository includes multiple .mtx 📂 files in the tests/ directories for testing matrix computations, ranging from 🟦 small matrices to 🟥 large ones (up to 🗂️ 257 MB).
.
├── 🐳 docker_servers
│ ├── 🛠️ configs
│ ├── 🍃 db_mongo
│ ├── 📒 db_sqlite
│ ├── 🐳 docker-compose.yml
│ ├── 🏗️ main_server
│ ├── 🍃 mongo_app
│ ├── 📒 sqlite_app
│ ├── ⚙️ worker_node
│ ├── ⚙️ worker_node_control_server
│ └── 🗒️ yaml_files_for_k8s
├── 🖥️ qt
│ ├── ✂️ calculation_matrix_form.cpp
│ ├── ⬇️ download_files_form.cpp
│ ├── 🔑 login_form.cpp
│ └── ...
└── 📽️ presentation.pptx
- Currently supports only
.mtx📂 file format. - Requires manual 📈 scaling of ⚙️ worker pods for large-scale 🔁 operations.
- ➕ Add support for additional 🧮 matrix formats.
- 🤖 Automate ⚙️ worker pod scaling based on 📊 load.
- 🛠️ Introduce advanced 📈 logging and 🕵️ monitoring tools for the ☁️ cluster.
This project is 🆓 open-source and licensed under the 🅼🅸🆃 License.





