# MP3 Group 26 Gautham Ajith and Amit Das

## Introduction

Welcome to our MP3 project. This repository consists of all the files for our HyDFS. We hope that this **README** will help guide you through understanding and using them.

## How to use

### Scripts
#### nodeHyDFS 
```
python3 nodeHyDFS.py [ip_addr] [port]
```
Note that ip_addr and port are the required arguments. These refer to ip and port that the VM will be listening on. 

The `configs\config_remote.yaml` file has the necessary ip addresses and ports used for nodeHyDFS.

### Other Important Files
We have several log files across different runs of our failure detectors.

1. `report_logs` contains all of the logs created in completing the report. This includes merge performance, calculating overheads upon failure of a node and rebalancing when a new node joins the HyDFS.
2. `report_files` contains the files used in preloading the system to gather the results for the reports
3. `gpt_sessions` consists of a pdf which aggregates GPT chat sessions used to build the HyDFS.

## Library installation required (and dependencies)
This project requires the **aioconsole** and **aiofiles** Python libraries. We also use a Python implementation of gRPCs. The following shell script makes sure that the libraries using RPCs are installed. 

```shell
#!/bin/bash

# Range of hostnames
START=2601
END=2610
HOST_PREFIX="fa25-cs425-"
HOST_SUFFIX=".cs.illinois.edu"

# Pip packages to install
PACKAGES=("grpcio" "grpcio-tools")  # Add your packages here

# Loop through each VM
for i in $(seq $START $END); do
    HOST="${HOST_PREFIX}${i}${HOST_SUFFIX}"
    echo "Installing packages on $HOST..."
    
    ssh "gajith2@$HOST" "python3 -m pip install --upgrade pip && python3 -m pip install ${PACKAGES[*]}"
    
    if [ $? -eq 0 ]; then
        echo "Packages installed successfully on $HOST"
    else
        echo "Failed to install packages on $HOST"
    fi
done
```

`dfs_pb2_grpc.py` and `dfs_pb2.py` were created by running 

```python
python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. dfs.proto
```


