This repository contains the completed tasks for the software engineering lab assignment focused on horizontal scaling of software systems. The tasks involved implementing load balancing algorithms, integration testing, and setting up continuous integration.
- Danil Yaremenko danilyaremenko@gmail.com
- Nikita Petrykin n.petrykin.im12@kpi.ua
- Yurii Grygorash gyv220427@gmail.com
- Yan Petrov yanemerald2004@gmail.com
The goal of this lab assignment was to deepen understanding of load balancing principles and implementation, and to practice integration testing. The tasks were carried out using a repository template provided in the assignment, which included necessary files and instructions for setting up the environment using Docker and docker-compose.
djb2 hashes the url path where the request is sent to:
pathHash := hash(r.URL.Path)
serverIndex := int(pathHash) % len(healthyServers)
Tests that check each balancer components work separately.
Tests wich check that fully prepared balancer works as expected.
The final step of the lab assignment was to build and run the project using Docker. To do this, follow the steps below:
-
Ensure Docker and docker-compose are installed on your machine.
-
Clone this repository to your local machine.
-
Navigate to the project directory in your terminal.
-
Run the following command to build and run the project:
docker-compose up --build
To run the tests, run the following command:
go test -v ./...
To run the integration tests, run the following command:
docker-compose -f docker-compose.yaml -f docker-compose.test.yaml \ up --exit-code-from test